Function at 0x406560
Capabilities:
Query service status
Start service

Disassembly:
sub esp, 0x528
mov eax, dword [0x41851c]
push ebx
push ebp
push esi
mov dword [esp + 0x134], eax
push edi
xor eax, eax
mov ecx, 0x7f
lea edi, [esp + 0x13c]
push 0x80000000
push eax
push eax
rep stosd dword es:[edi], eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x4065a6
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebp
jmp 0x40672f
lea ecx, [esp + 0x138]
lea edx, [esp + 0x338]
push ecx
push str.SYSTEMCurrentControlSetServices_s
push 0x200
push edx
call fcn.00406c10
add esp, 0x10
lea eax, [esp + 0x10]
lea ecx, [esp + 0x338]
push eax
push 0x20019
push 0
push ecx
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
mov ebp, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40668a
call fcn.00406410
and eax, 0xff
test eax, eax
je 0x40669a
lea eax, [esp + 0x138]
push 0x14
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
je 0x40671f
lea ecx, [esp + 0x18]
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40663d
cmp dword [esp + 0x1c], 4
je 0x406716
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x406716
call ebp
cmp eax, 0x420
je 0x406716
cmp eax, 0xb7
je 0x406716
mov esi, dword [sym.imp.KERNEL32.dll_SetLastError]
push eax
call esi
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call ebp
push eax
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x528
ret
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x406607
call fcn.00406410
and eax, 0xff
mov dword [esp + 0x14], eax
je 0x406728
lea edx, [esp + 0x138]
push 0x10
push edx
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
je 0x40671f
lea eax, [esp + 0x18]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x4066d8
cmp dword [esp + 0x1c], 4
je 0x406716
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x406716
call ebp
mov ebx, eax
cmp ebx, 0x420
je 0x406716
cmp ebx, 0xb7
je 0x406716
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x528
ret
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x406728
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 0x164
push 0x42
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov esi, eax
test esi, esi
jne 0x40675f
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x528
ret
mov dword [esi + 0x44], 1
call dword [sym.imp.KERNEL32.dll_GetVersion]
mov ebx, dword [esp + 0x53c]
cmp ax, 4
mov edi, ebx
jne 0x4067a7
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 8
jbe 0x4067d3
lea ecx, [ebx + 8]
lea edx, [esp + 0x34]
push ecx
push str.._s
push 0x104
push edx
call fcn.00406c10
add esp, 0x10
jmp 0x4067e0
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp ecx, 8
jbe 0x4067d3
lea eax, [ebx + 8]
lea ecx, [esp + 0x34]
push eax
push str..Global_s
push 0x104
push ecx
call fcn.00406c10
add esp, 0x10
jmp 0x4067e0
mov ecx, 0x41
xor eax, eax
lea edi, [esp + 0x34]
rep stosd dword es:[edi], eax
xor eax, eax
mov ecx, 0x10
push eax
push eax
push 3
push eax
lea edi, [esi + 4]
push eax
lea edx, [esp + 0x48]
push 0xc0000000
rep stosd dword es:[edi], eax
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi], eax
je 0x406877
push esi
call fcn.00406380
add esp, 4
test al, al
jne 0x406825
call ebp
mov edi, eax
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40687b
push esi
call fcn.00406310
lea eax, [esi + 0x50]
mov edx, ebx
add esp, 4
mov dword [esi + 0x160], 0
mov edi, 0x10c
sub edx, eax
mov cl, byte [edx + eax]
test cl, cl
je 0x406862
mov byte [eax], cl
inc eax
dec edi
jne 0x406844
dec eax
pop edi
mov byte [eax], 0
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x528
ret
test edi, edi
jne 0x406867
dec eax
mov byte [eax], 0
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x528
ret
call ebp
mov edi, eax
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push esi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_SetLastError]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x528
ret