Function at 0x406610
Capabilities:
Create service
Get hostname
Get user security identifier
Manipulate user privileges
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2d0
lea eax, [ebp - 0x2d0]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x40688d
lea ecx, [ebp - 0x2d0]
lea edx, [ecx + 2]
mov edi, edi
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406640
sub ecx, edx
sar ecx, 1
lea eax, [ebp - 0x2d0]
cmp word [eax + ecx*2], 0x5c
lea eax, [eax + ecx*2]
je 0x40666f
nop
xor ecx, ecx
mov word [eax], cx
cmp word [eax - 2], 0x5c
lea eax, [eax - 2]
jne 0x406660
push edi
lea edi, [ebp - 0x2d0]
add edi, 0xfffffffe
lea esp, [esp]
mov ax, word [edi + 2]
add edi, 2
test ax, ax
jne 0x406680
push esi
mov ecx, 7
mov esi, str.ap2decoder.exe
rep movsd dword es:[edi], dword [esi]
push 3
push 0
push 0
movsw word es:[edi], word [esi]
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 4], eax
test eax, eax
je 0x40688b
mov edi, dword [ebp + 0x18]
push ebx
push dword [ebp + 0x1c]
lea ecx, [ebp - 0x2d0]
push edi
push dword [ebp + 0x14]
push 0
push 0
push ecx
push 1
push dword [ebp + 0x10]
push 0x10
push 0
push dword [ebp + 0xc]
push dword [ebp + 8]
push eax
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov ebx, eax
test ebx, ebx
je 0x406877
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [0x4af748], 0
je 0x406855
xor eax, eax
push 0x60
push eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], eax
mov word [ebp - 0x20], ax
mov dword [ebp - 0x1e], eax
mov word [ebp - 0x1a], ax
mov word [ebp - 0x18], ax
mov dword [ebp - 0x16], eax
mov word [ebp - 0x12], ax
mov word [ebp - 0x4c], ax
mov dword [ebp - 0x4a], eax
mov dword [ebp - 0x46], eax
mov dword [ebp - 0x42], eax
mov dword [ebp - 0x3e], eax
mov dword [ebp - 0x3a], eax
mov dword [ebp - 0x36], eax
mov dword [ebp - 0x32], eax
mov dword [ebp - 0x2e], eax
mov word [ebp - 0xc8], ax
lea eax, [ebp - 0xc6]
push eax
mov dword [ebp - 0x64], 0x18
call fcn.00449690
add esp, 0xc
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x4c]
push eax
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0x31
mov dword [ebp - 0x28], 0x11
call dword [sym.imp.KERNEL32.dll_GetComputerNameW]
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x20]
push eax
call fcn.004065c0
add esp, 8
lea eax, [ebp - 8]
push eax
push 0xf0fff
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0x20]
push eax
mov dword [ebp - 8], 0
call sub.ADVAPI32.dll_LsaOpenPolicy
test eax, eax
jne 0x406877
push 0x5c
push edi
call fcn.004497e2
mov esi, eax
add esp, 8
test esi, esi
je 0x4067cd
add esi, 2
jmp 0x4067cf
mov esi, edi
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0xc]
push eax
push 0
push esi
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x406877
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xc8]
push eax
lea eax, [ebp - 0xc]
push eax
push edi
push esi
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
lea eax, [ebp - 0x18]
push str.SeServiceLogonRight
push eax
call fcn.004065c0
add esp, 8
lea eax, [ebp - 0x18]
push 1
push eax
push edi
push dword [ebp - 8]
call sub.ADVAPI32.dll_LsaAddAccountRights
push dword [ebp - 8]
mov esi, eax
call sub.ADVAPI32.dll_LsaClose
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
test esi, esi
jne 0x406877
mov esi, dword [ebp - 4]
push 0x10
push dword [ebp + 8]
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, eax
test ebx, ebx
je 0x40687a
push 0
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
jmp 0x40687a
mov esi, dword [ebp - 4]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
test ebx, ebx
je 0x40688a
push ebx
call esi
pop ebx
pop esi
pop edi
mov esp, ebp
pop ebp
ret