Function at 0x402f30
Capabilities:
Modify service

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x576078
mov eax, dword fs:[0]
push eax
sub esp, 0x20
push ebx
push esi
push edi
mov eax, dword [0x628f58]
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.0040f890
mov edi, eax
mov dword [ebp - 0x18], edi
test edi, edi
je 0x403338
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 0x402f91
cmp ecx, dword [esi]
jne 0x402f91
lock inc dword [eax]
jmp 0x402fbe
mov eax, dword [ecx]
lea edi, [esi + 4]
push 2
push dword [edi]
call dword [eax]
mov esi, eax
test esi, esi
je 0x40334c
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.00404330
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 0x403351
mov eax, dword [esi - 8]
mov ebx, 1
mov ecx, ebx
sub eax, edx
sub ecx, dword [esi - 4]
or eax, ecx
jge 0x402ff5
push edx
lea ecx, [ebp - 0x14]
call fcn.004044c0
mov esi, dword [ebp - 0x14]
push dword [esi - 8]
push esi
call fcn.00555633
add esp, 8
test eax, eax
js 0x403351
cmp eax, dword [esi - 8]
jg 0x403351
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 0x403040
cmp ecx, dword [edi]
jne 0x403040
lock inc dword [eax]
jmp 0x403071
mov eax, dword [ecx]
lea ebx, [edi + 4]
push 2
push dword [ebx]
call dword [eax]
mov edi, eax
test edi, edi
je 0x40335b
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.00404330
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 0x403360
mov eax, dword [edi - 8]
mov ecx, ebx
sub ecx, dword [edi - 4]
sub eax, edx
or eax, ecx
jge 0x4030a0
push edx
lea ecx, [ebp - 0x10]
call fcn.004044c0
mov edi, dword [ebp - 0x10]
push dword [edi - 8]
push edi
call fcn.00555633
add esp, 8
test eax, eax
js 0x403351
cmp eax, dword [edi - 8]
jg 0x403351
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 0x4030ee
cmp ecx, dword [edi]
jne 0x4030ee
lock inc dword [eax]
jmp 0x40311f
mov eax, dword [ecx]
lea ebx, [edi + 4]
push 2
push dword [ebx]
call dword [eax]
mov edi, eax
test edi, edi
je 0x40336a
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.00404330
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 0x40336f
mov eax, dword [edi - 8]
sub ebx, dword [edi - 4]
sub eax, ecx
or eax, ebx
jge 0x40314c
push ecx
lea ecx, [ebp - 0x18]
call fcn.004044c0
mov edi, dword [ebp - 0x18]
push dword [edi - 8]
push edi
call fcn.00555633
add esp, 8
test eax, eax
js 0x403351
cmp eax, dword [edi - 8]
jg 0x403351
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 0x4031d9
push 1
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
test eax, eax
je 0x4031a4
push eax
mov dword [ebp - 0x1c], 1
call ebx
push dword [ebp - 0x20]
call ebx
cmp dword [ebp - 0x1c], 0
je 0x4031d9
cmp dword [ebp - 0x24], 2
jle 0x4031d2
mov edx, dword [ebp - 0x28]
mov edx, dword [edx + 8]
movzx eax, word [edx]
cmp eax, 0x2d
je 0x4031c8
cmp eax, 0x2f
jne 0x4031d2
add edx, 2
mov ecx, esi
call fcn.0040f2a0
xor bl, bl
jmp 0x4032cc
sub esp, 0x14
mov edx, edi
mov ecx, esi
call fcn.0040f590
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 0x403220
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
push eax
push 0x60ae58
call fcn.0040e850
add esp, 8
jmp 0x4032a6
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 0x403297
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 0x40325b
call ebx
push eax
push str.OpenService_failed_w_err_0x_08lx_n
call fcn.0040e850
add esp, 8
jmp 0x403297
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 0x403285
call ebx
push eax
push str.ChangeServiceConfig2_failed_w_err_0x_08lx_n
call fcn.0040e850
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 0x4032b8
call ebx
push eax
push 0x605c48
call fcn.004048f0
add esp, 8
jmp 0x4032c5
push str.Service_Install_Success
call fcn.004048f0
add esp, 4
call fcn.0040f9d0
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 0x4032ea
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 0x403308
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 0x403324
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.00404470
push 0x80070057
call fcn.00404450
call fcn.00404470
push 0x80070057
call fcn.00404450
call fcn.00404470
push 0x80070057
call fcn.00404450
int3