Function at 0x406430
Capabilities:
Check if file exists
Query or enumerate registry value
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4627f0
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x47d0e0]
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
mov ebx, edx
mov dword [ebp - 0x38], ecx
push 0xf003f
push 0
push 0
mov dword [ebp - 4], 1
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov esi, eax
mov dword [ebp - 0x34], esi
test esi, esi
jne 0x406499
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.02__d
push ebx
call fcn.004017e0
add esp, 0xc
jmp 0x406639
push 0x14
push dword [ebp + 8]
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov edi, eax
mov dword [ebp - 0x3c], edi
test edi, edi
jne 0x4064cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.03__d
push ebx
call fcn.004017e0
add esp, 0xc
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x406639
lea eax, [ebp - 0x2c]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x4064f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.04__d
push ebx
call fcn.004017e0
add esp, 0xc
jmp 0x40662b
cmp dword [ebp - 0x28], 1
je 0x406513
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x34]
call esi
mov bl, 1
jmp 0x40663b
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x406617
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push str.05__d
push ebx
call fcn.004017e0
add esp, 0xc
cmp esi, 2
jne 0x40662b
lea ecx, [ebp - 0x30]
mov dword [ebp - 0x44], 1
mov dword [ebp - 0x40], 0x104
call fcn.00401f30
lea eax, [ebp + 8]
mov byte [ebp - 4], 2
push eax
mov edx, str.SYSTEMCurrentControlSetServices_
lea ecx, [ebp - 0x38]
call fcn.004055f0
add esp, 4
mov edi, eax
mov byte [ebp - 4], 3
mov edx, 1
mov esi, dword [ebp - 0x30]
mov ecx, dword [esi - 8]
sub edx, dword [esi - 4]
sub ecx, 0x104
or ecx, edx
jge 0x4065a2
push 0x104
lea ecx, [ebp - 0x30]
call fcn.004018f0
mov esi, dword [ebp - 0x30]
lea eax, [ebp - 0x40]
push eax
push esi
lea eax, [ebp - 0x44]
push eax
push str.ImagePath
push dword [edi]
push reloc.WS2_32.dll_bind
call dword [sym.imp.SHLWAPI.dll_SHGetValueA]
lea ecx, [ebp - 0x38]
mov byte [ebp - 4], 2
mov edi, eax
call fcn.00401b50
test edi, edi
jne 0x40660a
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x4065e0
push 0x80004005
call fcn.00401b90
push eax
push esi
call fcn.0044c015
add esp, 8
test eax, eax
sete al
push 2
test al, al
je 0x4065fc
push str.05__d_0
jmp 0x406601
push str.05__d_1
push ebx
call fcn.004017e0
add esp, 0xc
lea ecx, [ebp - 0x30]
call fcn.00401b50
mov edi, dword [ebp - 0x3c]
jmp 0x40662b
mov eax, dword [ebp - 0x38]
push str.06_00
push ebx
mov byte [eax], 1
call fcn.004017e0
add esp, 8
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x34]
call esi
xor bl, bl
mov byte [ebp - 4], 0
or esi, 0xffffffff
mov ecx, dword [ebp + 8]
mov eax, esi
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], eax
dec eax
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
jg 0x406683
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov edi, dword [eax + 4]
mov dword [ebp - 0x3c], edi
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x40667e
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call edi
jmp 0x406683
mov ecx, edx
call dword [ebp - 0x3c]
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [ebp + 0xc]
add ecx, 0xfffffff0
lock xadd dword [ecx + 0xc], esi
dec esi
test esi, esi
jg 0x4066b9
mov edx, dword [ecx]
push ecx
mov eax, dword [edx]
mov esi, dword [eax + 4]
cmp eax, vtable.ATL::CAtlStringMgr.0
jne 0x4066b5
mov eax, dword [edx + 4]
push 0
push dword [eax + 4]
call edi
jmp 0x4066b9
mov ecx, edx
call esi
mov al, bl
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.00444f5f
mov esp, ebp
pop ebp
ret