Function at 0x40e6e0
Capabilities:
Create service
Persist via windows service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47c377
mov eax, dword fs:[0]
push eax
sub esp, 0x22c
mov eax, dword [0x4a5018]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
push 0x208
lea eax, [ebp - 0x218]
push 0
push eax
call fcn.004573c0
add esp, 0xc
lea eax, [ebp - 0x218]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x40e755
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Cannot_install_service___d__n
call fcn.0040ec80
add esp, 8
jmp 0x40ea94
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
mov esi, dword [0x4aaa7c]
test esi, esi
je 0x40e776
lock inc dword [esi + 4]
mov esi, dword [0x4aaa7c]
mov ecx, dword [0x4aaa78]
mov dword [ebp - 0x22c], ecx
mov dword [ebp - 0x228], esi
mov dword [ebp - 4], 0
lea edx, [ebp - 0x21c]
mov eax, dword [ecx]
push edx
call dword [eax + 0x68]
push dword [eax]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
mov edx, dword [ebp - 0x21c]
or ebx, 0xffffffff
add edx, 0xfffffff0
mov eax, ebx
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40e7ca
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
test esi, esi
je 0x40e7f4
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x40e7f4
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
mov eax, ebx
lock xadd dword [esi + 8], eax
jne 0x40e7f4
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x220], eax
test eax, eax
jne 0x40e86c
mov eax, dword [0x4aa568]
test eax, eax
jne 0x40e840
push 0x2c
call fcn.004551d2
add esp, 4
mov dword [ebp - 0x224], eax
mov ecx, eax
mov dword [ebp - 4], 1
call fcn.0040dba0
mov dword [ebp - 4], 0xffffffff
mov dword [0x4aa568], eax
push str.OpenSCManager_fail
push str.InstallService
push eax
call fcn.0040e150
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.0040ec80
add esp, 8
jmp 0x40ea94
mov edi, dword [0x4aaa7c]
test edi, edi
je 0x40e880
lock inc dword [edi + 4]
mov edi, dword [0x4aaa7c]
mov eax, dword [0x4aaa78]
mov dword [ebp - 0x21c], eax
mov dword [ebp - 0x22c], eax
mov dword [ebp - 0x228], edi
mov dword [ebp - 4], 2
mov ecx, eax
test edi, edi
je 0x40e8b9
lock inc dword [edi + 4]
mov eax, dword [0x4aaa78]
mov edi, dword [0x4aaa7c]
mov dword [ebp - 0x21c], eax
mov dword [ebp - 0x238], eax
mov dword [ebp - 0x234], edi
mov byte [ebp - 4], 3
lea edx, [ebp - 0x224]
mov eax, dword [ecx]
push edx
call dword [eax + 0x88]
mov esi, eax
mov byte [ebp - 4], 4
lea eax, [ebp - 0x230]
mov ecx, dword [ebp - 0x21c]
push eax
mov edx, dword [ecx]
call dword [edx + 0x88]
push 0
push 0
push 0
push 0
push 0
lea ecx, [ebp - 0x218]
push ecx
push 1
push 2
push 0x10
push 0xf01ff
push dword [esi]
push dword [eax]
push dword [ebp - 0x220]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov edx, dword [ebp - 0x230]
mov ecx, ebx
mov dword [ebp - 0x21c], eax
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], ecx
dec ecx
test ecx, ecx
jg 0x40e942
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 3
mov eax, ebx
mov edx, dword [ebp - 0x224]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40e963
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test edi, edi
je 0x40e986
mov eax, ebx
lock xadd dword [edi + 4], eax
jne 0x40e986
mov eax, dword [edi]
mov ecx, edi
call dword [eax]
mov eax, ebx
lock xadd dword [edi + 8], eax
jne 0x40e986
mov eax, dword [edi]
mov ecx, edi
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
mov esi, dword [ebp - 0x228]
test esi, esi
je 0x40e9b5
mov eax, ebx
lock xadd dword [esi + 4], eax
jne 0x40e9b5
mov eax, dword [esi]
mov ecx, esi
call dword [eax]
lock xadd dword [esi + 8], ebx
dec ebx
jne 0x40e9b5
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
mov esi, dword [ebp - 0x21c]
test esi, esi
jne 0x40ea30
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
push eax
push str.CreateService_failed___d__n
call fcn.0040ec80
mov esi, dword [0x4aa568]
add esp, 8
test esi, esi
jne 0x40ea0c
push 0x2c
call fcn.004551d2
add esp, 4
mov dword [ebp - 0x21c], eax
mov ecx, eax
mov dword [ebp - 4], 5
call fcn.0040dba0
mov esi, eax
mov dword [ebp - 4], 0xffffffff
mov dword [0x4aa568], esi
call edi
push eax
push str.CreateService_fail__error___d
push str.InstallService
push esi
call fcn.0040e150
add esp, 0x10
push dword [ebp - 0x220]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40ea94
push str.Service_installed_successfully_n
call fcn.0040ec80
mov eax, dword [0x4aa568]
add esp, 4
test eax, eax
jne 0x40ea70
push 0x2c
call fcn.004551d2
add esp, 4
mov dword [ebp - 0x21c], eax
mov ecx, eax
mov dword [ebp - 4], 6
call fcn.0040dba0
mov dword [ebp - 4], 0xffffffff
mov dword [0x4aa568], eax
push str.Service_installed_successfully
push str.InstallService
push eax
call fcn.0040e150
add esp, 0xc
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push dword [ebp - 0x220]
call esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00454d47
mov esp, ebp
pop ebp
ret