Function at 0x40fa40
Capabilities:
Create service
Persist via run registry key
Persist via windows service

Disassembly:
push 0xffffffffffffffff
push 0x479c89
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x258
mov al, byte [0x4a709c]
test al, al
mov dword [esp], str._service
jne 0x40fa72
mov dword [esp], str._noconsole__service
push ebx
push ebp
push esi
push edi
xor edi, edi
mov dword [esp + 0x14], edi
push 0x104
mov dword [esp + 0x274], edi
call fcn.00459034
add esp, 4
mov ebx, eax
push edi
mov dword [esp + 0x18], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push 0x104
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x40fab0
mov byte [ebx], al
mov eax, ebx
mov dword [esp + 0x270], 1
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40fac0
mov ebp, dword [esp + 0x280]
sub eax, edx
xor ecx, ecx
cmp ebp, edi
lea esi, [eax + 4]
jle 0x40fb02
lea esp, [esp]
mov eax, dword [esp + 0x284]
mov eax, dword [eax + ecx*4]
lea edi, [eax + 1]
lea ecx, [ecx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40faf0
sub eax, edi
inc ecx
cmp ecx, ebp
lea esi, [esi + eax + 3]
jl 0x40fae0
mov edi, dword [esp + 0x10]
mov eax, edi
lea edx, [eax + 1]
jmp 0x40fb10
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40fb10
sub eax, edx
add eax, esi
push eax
call fcn.00459034
mov ebp, eax
mov dword [esp + 0x60], ebp
push edi
push ebx
push str.__s___s
push ebp
mov byte [esp + 0x284], 2
call fcn.00459600
mov eax, dword [esp + 0x294]
add esp, 0x14
xor ebx, ebx
test eax, eax
jle 0x40fbce
mov edi, ebp
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40fb53
mov cx, word [0x484c38]
mov eax, dword [esp + 0x284]
mov word [edi], cx
mov dl, byte [0x484c3a]
mov byte [edi + 2], dl
mov eax, dword [eax + ebx*4]
mov ecx, eax
lea ebx, [ebx]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x40fb80
mov edi, ebp
sub eax, ecx
mov esi, ecx
dec edi
mov edi, edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40fb90
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, ebp
dec edi
lea esp, [esp]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40fbb0
mov eax, dword [esp + 0x280]
mov cx, word [0x484c34]
inc ebx
cmp ebx, eax
mov word [edi], cx
jl 0x40fb50
mov al, byte [0x4a709c]
test al, al
je 0x40fe29
push 2
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [esp + 0x18], eax
test eax, eax
mov byte [esp + 0x270], 3
jne 0x40fc2b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x484b40
lea ecx, [esp + 0x16c]
call fcn.0044ba90
push 0x49859c
lea edx, [esp + 0x64]
mov esi, eax
mov ecx, 0x41
lea edi, [esp + 0x64]
push edx
rep movsd dword es:[edi], dword [esi]
call fcn.00459658
mov ecx, dword [esp + 0x27c]
push 0
mov esi, dword [esp + 0x27c]
push 0
push 0
push 0
push 0
push ebp
push 0
push 2
push 0x110
push 0xf003f
push ecx
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov dword [esp + 0x10], eax
test eax, eax
mov byte [esp + 0x270], 4
jne 0x40fc9f
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x484c18
lea ecx, [esp + 0x16c]
call fcn.0044ba90
push 0x49859c
lea edx, [esp + 0x64]
mov esi, eax
mov ecx, 0x41
lea edi, [esp + 0x64]
push edx
rep movsd dword es:[edi], dword [esi]
call fcn.00459658
push 0
lea ecx, [esp + 0x4c]
call fcn.0040e690
push 0
lea ecx, [esp + 0x20]
mov byte [esp + 0x274], 5
call fcn.0040e690
push 0
mov bl, 6
push reloc.WS2_32.dll_bind
lea ecx, [esp + 0x38]
mov byte [esp + 0x278], bl
call fcn.0040ee60
push str.SYSTEMCurrentControlSetServicesEventLogApplication
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x278], 7
call fcn.0040ef20
lea ecx, [esp + 0x30]
mov byte [esp + 0x270], bl
call fcn.0040e6b0
push esi
lea ecx, [esp + 0x20]
push ecx
lea ecx, [esp + 0x50]
call fcn.0040ef20
mov ebx, dword [esp + 0x14]
mov eax, ebx
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40fd20
sub eax, edx
test eax, eax
jle 0x40fd42
lea ecx, [ecx]
cmp byte [eax + ebx], 0x5c
je 0x40fd3d
dec eax
test eax, eax
jg 0x40fd30
jmp 0x40fd42
mov byte [eax + ebx + 1], 0
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40fd47
sub eax, edx
mov edx, eax
mov eax, str.logmessages.dll
lea esi, [eax + 1]
lea ebx, [ebx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40fd60
sub eax, esi
lea edx, [eax + edx + 1]
push edx
call fcn.00459034
mov esi, eax
add esp, 4
mov dword [esp + 0x44], esi
mov edx, esi
mov byte [esp + 0x270], 8
mov eax, ebx
sub edx, ebx
lea ebx, [ebx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40fd90
mov edi, esi
dec edi
lea ecx, [ecx]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x40fda0
mov eax, dword [str.logmessages.dll]
mov dword [edi], eax
mov ecx, dword [0x484c0c]
mov dword [edi + 4], ecx
mov edx, dword [0x484c10]
mov dword [edi + 8], edx
mov eax, dword [0x484c14]
push esi
push str.EventMessageFile
lea ecx, [esp + 0x50]
mov dword [edi + 0xc], eax
call fcn.0040e550
push 5
push str.TypesSupported
lea ecx, [esp + 0x50]
call fcn.0040e630
push esi
call fcn.00459039
add esp, 4
lea ecx, [esp + 0x1c]
mov byte [esp + 0x270], 5
call fcn.0040e6b0
lea ecx, [esp + 0x48]
mov byte [esp + 0x270], 4
call fcn.0040e6b0
mov ecx, dword [esp + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ecx
call esi
mov edx, dword [esp + 0x18]
push edx
call esi
jmp 0x40fe9f
push 0
lea ecx, [esp + 0x20]
call fcn.0040e690
push 0
mov bl, 9
push reloc.WS2_32.dll_bind
lea ecx, [esp + 0x38]
mov byte [esp + 0x278], bl
call fcn.0040ee60
push str.SoftwareMicrosoftWindowsCurrentVersionRunServices
lea eax, [esp + 0x34]
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x278], 0xa
call fcn.0040ef20
lea ecx, [esp + 0x30]
mov byte [esp + 0x270], bl
call fcn.0040e6b0
mov ecx, dword [esp + 0x278]
push ebp
push ecx
lea ecx, [esp + 0x24]
call fcn.0040e5c0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x270], 2
call fcn.0040e6b0
mov ebx, dword [esp + 0x14]
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebp
call fcn.00459039
push ebx
call fcn.00459039
mov ecx, dword [esp + 0x270]
add esp, 8
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
mov dword fs:[0], ecx
add esp, 0x264
ret