Function at 0x422782
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
push 0x28
mov eax, 0x4d0f37
call fcn.004b17f0
xor ebx, ebx
mov dword [ebp - 0x10], ebx
call fcn.0049d1fb
push eax
lea ecx, [ebp - 0x28]
call fcn.0042149e
push ecx
mov dword [ebp - 4], ebx
mov eax, esp
mov dword [ebp - 0x30], esp
push dword [edi]
mov dword [ebp - 0x24], 1
push str.ScmDirectRegister__s_
push eax
call fcn.00466a00
add esp, 0xc
call fcn.00421d1d
pop ecx
push ebx
push ecx
mov ecx, esp
mov dword [ebp - 0x30], esp
push str.In_progress
call fcn.0042341f
push ecx
mov byte [ebp - 4], 1
mov ecx, esp
mov dword [ebp - 0x2c], esp
push edi
call fcn.0042340a
mov eax, dword [ebp + 8]
push ecx
mov byte [ebp - 4], 2
mov esi, esp
mov dword [ebp - 0x20], esp
push ecx
add eax, 0xc
mov ecx, esp
mov dword [ebp - 0x1c], esp
push eax
call fcn.0042340a
push edi
call fcn.00421b89
mov byte [ebp - 4], 3
call fcn.00478650
push eax
mov byte [ebp - 4], bl
call fcn.00467bc0
add esp, 0x14
cmp eax, ebx
jne 0x42285c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push eax
push dword [edi]
push str.ScmDirectRegister:_could_NOT_mark_service_into_registry__LE_d_
push ecx
call fcn.00466a00
add esp, 0x10
call fcn.00421d1d
pop ecx
push 0xb
pop esi
mov ecx, dword [ebp - 0x28]
add ecx, 0xfffffff0
call fcn.0042101a
mov eax, esi
call fcn.004b18c8
ret
call fcn.0049d1fb
push eax
lea ecx, [ebp - 0x1c]
call fcn.0042149e
mov byte [ebp - 4], 4
call fcn.0049d1fb
push eax
lea ecx, [ebp - 0x14]
call fcn.0042149e
mov byte [ebp - 4], 5
call fcn.0049d1fb
push eax
lea ecx, [ebp - 0x18]
call fcn.0042149e
mov ecx, dword [ebp + 8]
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp + 0xc]
mov byte [ebp - 4], 6
mov edx, edi
mov dword [ebp - 0x20], ebx
call fcn.004222f1
lea eax, [edi + 0x18]
mov ecx, dword [eax]
add esp, 0x14
cmp dword [ecx - 0xc], ebx
jne 0x4228cf
push ebx
lea ecx, [ebp - 0x2c]
call fcn.0042341f
mov dword [ebp - 0x10], 1
mov eax, dword [eax]
push ebx
push ebx
push ebx
push ebx
push eax
push dword [ebp - 0x1c]
push dword [edi + 0x24]
push dword [ebp - 0x20]
push dword [edi + 0x1c]
push 2
push dword [ebp - 0x18]
push dword [ebp - 0x14]
push dword [ebp + 0x10]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
test byte [ebp - 0x10], 1
mov esi, eax
je 0x42290a
mov ecx, dword [ebp - 0x2c]
and dword [ebp - 0x10], 0xfffffffe
add ecx, 0xfffffff0
call fcn.0042101a
cmp esi, ebx
jne 0x4229cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
jne 0x422a47
push ecx
mov eax, esp
mov dword [ebp - 0x30], esp
push str.ScmDirectRegister:_service_already_exists._Trying_OpenService__ChangeServiceConfig.
push eax
call fcn.00466a00
pop ecx
pop ecx
call fcn.00421d1d
pop ecx
push 2
push dword [ebp - 0x14]
push dword [ebp + 0x10]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
cmp esi, ebx
je 0x422a24
lea eax, [edi + 0x18]
mov ecx, dword [eax]
cmp dword [ecx - 0xc], ebx
jne 0x42296b
push ebx
lea ecx, [ebp - 0x30]
call fcn.0042341f
or dword [ebp - 0x10], 2
push dword [ebp - 0x18]
mov eax, dword [eax]
push ebx
push ebx
push ebx
push ebx
push eax
push dword [ebp - 0x1c]
push dword [edi + 0x24]
push dword [ebp - 0x20]
push dword [edi + 0x1c]
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
mov ebx, eax
neg ebx
sbb bl, bl
inc bl
test byte [ebp - 0x10], 2
je 0x4229a1
mov ecx, dword [ebp - 0x30]
add ecx, 0xfffffff0
call fcn.0042101a
test bl, bl
je 0x4229c6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp - 0x30], esp
push eax
push str.ScmDirectRegister:_ChangeServiceConfig_failed:_LE_d
push ecx
call fcn.00466a00
add esp, 0xc
call fcn.00421d1d
pop ecx
xor ebx, ebx
cmp esi, ebx
je 0x422a47
push ecx
lea eax, [ebp - 0x14]
mov dword [ebp - 0x30], esp
mov ecx, esp
push eax
call fcn.00423aca
push dword [ebp + 8]
mov ebx, edi
call fcn.0042262c
pop ecx
pop ecx
test eax, eax
jne 0x4229ee
and dword [ebp - 0x24], eax
xor ebx, ebx
cmp esi, ebx
je 0x4229fb
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x18]
add ecx, 0xfffffff0
call fcn.0042101a
mov ecx, dword [ebp - 0x14]
add ecx, 0xfffffff0
call fcn.0042101a
mov ecx, dword [ebp - 0x1c]
add ecx, 0xfffffff0
call fcn.0042101a
mov esi, dword [ebp - 0x24]
jmp 0x422849
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp - 0x30], esp
push eax
push str.ScmDirectRegister:_OpenService_failed:_LE_d
push ecx
call fcn.00466a00
add esp, 0xc
call fcn.00421d1d
pop ecx
jmp 0x4229c8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ecx
mov ecx, esp
mov dword [ebp + 8], esp
push eax
push dword [ebp - 0x14]
push str.ScmDirectRegister:_FAILED_creating_service__s:_LE_d
push ecx
call fcn.00466a00
add esp, 0x10
call fcn.00421d1d
pop ecx
mov dword [ebp - 0x24], 1
jmp 0x4229f0