Function at 0x403010
Capabilities:
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x57e5a8
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x634f58]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x24], ecx
call fcn.004115a0
mov edi, eax
mov dword [ebp - 0x18], edi
test edi, edi
je 0x403418
mov ebx, dword [edi]
mov ecx, dword [ebx - 0x10]
lea esi, [ebx - 0x10]
mov edx, dword [ecx]
call dword [edx + 0x10]
cmp dword [esi + 0xc], 0
mov ecx, eax
lea eax, [esi + 0xc]
jl 0x403071
cmp ecx, dword [esi]
jne 0x403071
lock inc dword [eax]
jmp 0x40309e
mov eax, dword [ecx]
lea edi, [esi + 4]
push 2
push dword [edi]
call dword [eax]
mov esi, eax
test esi, esi
je 0x40342c
mov eax, dword [edi]
lea ecx, [esi + 0x10]
mov dword [esi + 4], eax
mov edx, dword [edi]
inc edx
push edx
push ebx
call fcn.00404410
mov edi, dword [ebp - 0x18]
add esp, 8
add esi, 0x10
mov dword [ebp - 0x14], esi
mov dword [ebp - 4], 0
mov edx, dword [esi - 0xc]
test edx, edx
js 0x403431
mov eax, dword [esi - 8]
mov ebx, 1
mov ecx, ebx
sub eax, edx
sub ecx, dword [esi - 4]
or eax, ecx
jge 0x4030d5
push edx
lea ecx, [ebp - 0x14]
call fcn.004045a0
mov esi, dword [ebp - 0x14]
push dword [esi - 8]
push esi
call fcn.00559461
add esp, 8
test eax, eax
js 0x403431
cmp eax, dword [esi - 8]
jg 0x403431
mov dword [esi - 0xc], eax
xor ecx, ecx
mov word [esi + eax*2], cx
mov eax, dword [edi + 4]
mov ecx, dword [eax - 0x10]
lea edi, [eax - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [edi + 0xc], 0
mov ecx, eax
lea eax, [edi + 0xc]
jl 0x403120
cmp ecx, dword [edi]
jne 0x403120
lock inc dword [eax]
jmp 0x403151
mov eax, dword [ecx]
lea ebx, [edi + 4]
push 2
push dword [ebx]
call dword [eax]
mov edi, eax
test edi, edi
je 0x40343b
mov eax, dword [ebx]
lea ecx, [edi + 0x10]
mov dword [edi + 4], eax
mov edx, dword [ebx]
inc edx
push edx
push dword [ebp - 0x20]
call fcn.00404410
add esp, 8
mov ebx, 1
add edi, 0x10
mov dword [ebp - 0x10], edi
mov byte [ebp - 4], 1
mov edx, dword [edi - 0xc]
test edx, edx
js 0x403440
mov eax, dword [edi - 8]
mov ecx, ebx
sub ecx, dword [edi - 4]
sub eax, edx
or eax, ecx
jge 0x403180
push edx
lea ecx, [ebp - 0x10]
call fcn.004045a0
mov edi, dword [ebp - 0x10]
push dword [edi - 8]
push edi
call fcn.00559461
add esp, 8
test eax, eax
js 0x403431
cmp eax, dword [edi - 8]
jg 0x403431
mov dword [edi - 0xc], eax
xor ecx, ecx
mov word [edi + eax*2], cx
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 8]
mov ecx, dword [eax - 0x10]
lea edi, [eax - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ecx]
call dword [eax + 0x10]
cmp dword [edi + 0xc], 0
mov ecx, eax
lea eax, [edi + 0xc]
jl 0x4031ce
cmp ecx, dword [edi]
jne 0x4031ce
lock inc dword [eax]
jmp 0x4031ff
mov eax, dword [ecx]
lea ebx, [edi + 4]
push 2
push dword [ebx]
call dword [eax]
mov edi, eax
test edi, edi
je 0x40344a
mov eax, dword [ebx]
lea ecx, [edi + 0x10]
mov dword [edi + 4], eax
mov edx, dword [ebx]
inc edx
push edx
push dword [ebp - 0x20]
call fcn.00404410
add esp, 8
mov ebx, 1
add edi, 0x10
mov dword [ebp - 0x18], edi
mov byte [ebp - 4], 2
mov ecx, dword [edi - 0xc]
test ecx, ecx
js 0x40344f
mov eax, dword [edi - 8]
sub ebx, dword [edi - 4]
sub eax, ecx
or eax, ebx
jge 0x40322c
push ecx
lea ecx, [ebp - 0x18]
call fcn.004045a0
mov edi, dword [ebp - 0x18]
push dword [edi - 8]
push edi
call fcn.00559461
add esp, 8
test eax, eax
js 0x403431
cmp eax, dword [edi - 8]
jg 0x403431
xor ecx, ecx
mov dword [edi - 0xc], eax
push 5
push ecx
push ecx
mov word [edi + eax*2], cx
mov dword [ebp - 0x1c], ecx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [ebp - 0x20], eax
test eax, eax
je 0x4032b9
push 1
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
test eax, eax
je 0x403284
push eax
mov dword [ebp - 0x1c], 1
call ebx
push dword [ebp - 0x20]
call ebx
cmp dword [ebp - 0x1c], 0
je 0x4032b9
cmp dword [ebp - 0x24], 2
jle 0x4032b2
mov edx, dword [ebp - 0x28]
mov edx, dword [edx + 8]
movzx eax, word [edx]
cmp eax, 0x2d
je 0x4032a8
cmp eax, 0x2f
jne 0x4032b2
add edx, 2
mov ecx, esi
call fcn.00410fb0
xor bl, bl
jmp 0x4033ac
sub esp, 0x14
mov edx, edi
mov ecx, esi
call fcn.004112a0
add esp, 0x14
mov dword [ebp - 0x20], 0
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x403300
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
push eax
push 0x615de0
call fcn.004102f0
add esp, 8
jmp 0x403386
push eax
call dword [sym.imp.ADVAPI32.dll_LockServiceDatabase]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x28], eax
test eax, eax
je 0x403377
push 2
push esi
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ecx, eax
mov dword [ebp - 0x24], ecx
test ecx, ecx
jne 0x40333b
call ebx
push eax
push str.OpenService_failed_w_err_0x_08lx_n
call fcn.004102f0
add esp, 8
jmp 0x403377
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 0x2c]
push eax
push 1
push ecx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov dword [ebp - 0x20], eax
test eax, eax
jne 0x403365
call ebx
push eax
push str.ChangeServiceConfig2_failed_w_err_0x_08lx_n
call fcn.004102f0
add esp, 8
push dword [ebp - 0x28]
call dword [sym.imp.ADVAPI32.dll_UnlockServiceDatabase]
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp dword [ebp - 0x20], 0
jne 0x403398
call ebx
push eax
push 0x610a60
call fcn.004049d0
add esp, 8
jmp 0x4033a5
push str.Service_Install_Success
call fcn.004049d0
add esp, 4
call fcn.004116e0
mov bl, 1
lea edx, [edi - 0x10]
mov byte [ebp - 4], 1
or edi, 0xffffffff
mov eax, edi
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4033ca
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov byte [ebp - 4], 0
mov eax, edi
mov edx, dword [ebp - 0x10]
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4033e8
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov dword [ebp - 4], 0xffffffff
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], edi
dec edi
test edi, edi
jg 0x403404
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call fcn.00404550
push 0x80070057
call fcn.00404530
call fcn.00404550
push 0x80070057
call fcn.00404530
call fcn.00404550
push 0x80070057
call fcn.00404530
int3