Function at 0x4069a0
Capabilities:
Create process on windows
Delete service
Query service status
Resolve function by parsing pe exports
Stop service

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
mov eax, dword [0x452004]
xor eax, esp
mov dword [esp + 0x70], eax
push ebx
push esi
push edi
push ecx
push 0x452b08
mov edi, ecx
mov edx, 0x20019
push ecx
lea ecx, [esp + 0x2c]
xor ebx, ebx
call fcn.00409340
test eax, eax
js 0x406a38
lea eax, [esp + 0x1c]
mov dword [esp + 0x10], 0xa
push eax
push ecx
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x18]
or esi, 0xffffffff
mov dword [esp + 0x1c], str.Start
call fcn.004093e0
test eax, eax
js 0x406a26
mov eax, dword [esp + 0x1c]
cmp dword [eax + 4], 4
jne 0x406a11
cmp dword [eax + 8], 4
jne 0x406a11
mov esi, dword [eax + 0xc]
push eax
push 0
push dword [0x453afc]
call dword [sym.imp.ntdll.dll_RtlFreeHeap]
push dword [esp + 0x20]
call dword [sym.imp.ntdll.dll_NtClose]
xor ebx, ebx
cmp esi, 1
sete bl
mov edx, dword [edi + 0x10]
lea eax, [ebx + ebx]
mov ecx, dword [edi + 0x18]
and edx, 0xfffffffd
or edx, eax
mov dword [edi + 0x10], edx
mov edx, str.ProcessHacker.exe
call fcn.004073e0
mov esi, eax
test esi, esi
je 0x406a5e
mov ecx, dword [esi + 4]
jmp 0x406a60
xor ecx, ecx
call fcn.00409560
test al, al
je 0x406afa
test esi, esi
je 0x406a76
mov esi, dword [esi + 4]
jmp 0x406a78
xor esi, esi
push 0x38
lea eax, [esp + 0x2c]
mov dword [esp + 0x28], 0x3c
push 0
push eax
call fcn.00415060
add esp, 0xc
mov dword [esp + 0x34], esi
lea eax, [esp + 0x24]
mov dword [esp + 0x38], str._uninstallkph__s
mov dword [esp + 0x28], 0x440
mov dword [esp + 0x40], 1
push eax
mov dword [esp + 0x30], 0
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
test eax, eax
je 0x406c38
mov esi, dword [esp + 0x5c]
push 0
push 0
push esi
call dword [sym.imp.ntdll.dll_NtWaitForSingleObject]
push esi
call dword [sym.imp.ntdll.dll_NtClose]
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x70]
xor ecx, esp
call fcn.00413aae
mov esp, ebp
pop ebp
ret
push 1
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
test esi, esi
je 0x406bfa
push 0x24
push str.KProcessHacker3
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
push esi
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x406bfa
xor eax, eax
mov dword [esp + 0x20], 0
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
lea eax, [esp + 0x20]
push eax
push 0x24
lea eax, [esp + 0x2c]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x406bf3
cmp dword [esp + 0x28], 1
je 0x406bf3
mov esi, 0x3c
xor eax, eax
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x6c], eax
mov dword [esp + 0x70], eax
mov dword [esp + 0x74], eax
mov dword [esp + 0x78], eax
lea eax, [esp + 0x60]
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ControlService]
lea eax, ds:[esp + 0x20]
push eax
push 0x24
lea eax, [esp + 0x2c]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x406bd1
cmp dword [esp + 0x28], 1
je 0x406bf3
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0xff676980
push eax
push 0
mov dword [esp + 0x1c], 0xffffffff
call dword [sym.imp.ntdll.dll_NtDelayExecution]
sub esi, 1
jne 0x406b82
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 1
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
test esi, esi
je 0x406c38
push 0x10000
push str.KProcessHacker3
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
push esi
mov edi, eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x406c38
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [esp + 0x7c]
mov al, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.00413aae
mov esp, ebp
pop ebp
ret