Function at 0x41d590
Capabilities:
Create service
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x48c0d8
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x4c4074]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x28], 0x4a9bc0
mov dword [ebp - 0x24], eax
mov dword [ebp - 4], 0
test eax, eax
jne 0x41d6b3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call fcn.00420c00
mov al, byte [eax + 0x1c]
test al, al
je 0x41d9d2
call fcn.00420c00
test byte [eax + 0x20], 8
je 0x41d9d2
call fcn.00420c00
mov esi, eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da0b
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 3
lea ecx, [ebp - 0x14]
push 0x1d
push str.Unable_to_open_SCM_error_code
call fcn.004023a0
push edi
lea ecx, [ebp - 0x14]
call fcn.00420960
mov ebx, eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da15
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov byte [ebp - 4], 6
lea ecx, [ebp - 0x10]
push 0
push 0x4a85e8
call fcn.004023a0
push ecx
push ebx
push ecx
lea eax, [ebp - 0x10]
mov ecx, esi
push eax
call fcn.00420d60
mov byte [ebp - 4], 3
or esi, 0xffffffff
mov edx, dword [ebp - 0x10]
mov eax, esi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41d6a7
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x14]
jmp 0x41d7d5
mov ecx, dword [ebx + 0x28]
mov eax, dword [ecx]
call dword [eax + 0xc]
mov ecx, dword [ebx + 0x28]
mov edi, eax
mov edx, dword [ecx]
call dword [edx + 4]
mov ecx, dword [ebx + 0x28]
mov esi, eax
mov edx, dword [ecx]
call dword [edx]
push 0
push 0
push 0
push 0
push 0
push edi
push 1
push 3
push 0x10
push 0xf01ff
push esi
push eax
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov ecx, dword [ebx + 4]
mov esi, eax
cmp esi, ecx
je 0x41d704
mov edx, dword [ebx]
mov ecx, ebx
call dword [edx + 4]
mov dword [ebx + 4], esi
mov ecx, esi
test ecx, ecx
jne 0x41d7f3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
call fcn.00420c00
mov al, byte [eax + 0x1c]
test al, al
je 0x41d9d2
call fcn.00420c00
test byte [eax + 0x20], 8
je 0x41d9d2
call fcn.00420c00
mov esi, eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da1f
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov byte [ebp - 4], 0xd
lea ecx, [ebp - 0x10]
push 0x22
push str.Create_Service_failed_error_code:
call fcn.004023a0
push edi
lea ecx, [ebp - 0x10]
call fcn.00420960
mov ebx, eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da29
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 0x10
lea ecx, [ebp - 0x14]
push 0
push 0x4a85e8
call fcn.004023a0
push ecx
push ebx
push ecx
lea eax, [ebp - 0x14]
mov ecx, esi
push eax
call fcn.00420d60
mov byte [ebp - 4], 0xd
or esi, 0xffffffff
mov edx, dword [ebp - 0x14]
mov eax, esi
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41d7ce
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x10]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x41d9d2
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x41d9d2
call fcn.00420c00
or esi, 0xffffffff
mov al, byte [eax + 0x1c]
test al, al
je 0x41d8c3
call fcn.00420c00
test byte [eax + 0x20], 8
je 0x41d8c3
call fcn.00420c00
mov edi, eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da33
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov byte [ebp - 4], 0x17
lea ecx, [ebp - 0x10]
push 0x15
push str.CreateService_SUCCESS
call fcn.004023a0
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da3d
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 0x1a
lea ecx, [ebp - 0x14]
push 0
push 0x4a85e8
call fcn.004023a0
push ecx
lea eax, [ebp - 0x10]
push eax
push ecx
lea eax, [ebp - 0x14]
mov ecx, edi
push eax
call fcn.00420d60
mov byte [ebp - 4], 0x17
mov eax, esi
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41d8a5
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov eax, esi
mov edx, dword [ebp - 0x10]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41d8c3
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebx + 0x28]
mov dword [ebp - 0x18], 0
mov eax, dword [ecx]
call dword [eax + 8]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push 1
push dword [ebx + 4]
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x41d9c8
call fcn.00420c00
mov al, byte [eax + 0x1c]
test al, al
je 0x41d9c8
call fcn.00420c00
test byte [eax + 0x20], 8
je 0x41d9c8
call fcn.00420c00
mov edi, eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da47
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov byte [ebp - 4], 0x21
lea ecx, [ebp - 0x10]
push 0x2e
push str.Unable_to_set_service_description_error_code:
call fcn.004023a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp - 0x10]
call fcn.00420960
mov dword [ebp - 0x20], eax
call fcn.00403d50
mov ecx, eax
test ecx, ecx
je 0x41da51
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
mov byte [ebp - 4], 0x24
lea ecx, [ebp - 0x14]
push 0
push 0x4a85e8
call fcn.004023a0
push ecx
push dword [ebp - 0x20]
lea eax, [ebp - 0x14]
push ecx
push eax
mov ecx, edi
call fcn.00420d60
mov byte [ebp - 4], 0x21
mov eax, esi
mov edx, dword [ebp - 0x14]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x41d9ac
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov edx, dword [ebp - 0x10]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], esi
dec esi
test esi, esi
jg 0x41d9c8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebx + 0x28]
mov eax, dword [ecx]
call dword [eax + 0x14]
xor edi, edi
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x28], 0x4a9bc0
test eax, eax
je 0x41d9f5
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [ebp - 0x24], 0
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
push 0x80004005
call fcn.004024c0
int3