Function at 0x40f580
Capabilities:
Modify service

Disassembly:
sub esp, 8
push ebp
push esi
mov esi, dword [esp + 0x14]
xor ebp, ebp
cmp esi, ebp
jne 0x40f598
pop esi
lea eax, [ebp + 1]
pop ebp
add esp, 8
ret
mov eax, dword [esi + 0x8414]
and eax, 0x100
or eax, 0x10
mov dword [esi + 0x8414], eax
mov eax, dword [esi + 0x8400]
sub eax, 2
je 0x40f5d0
sub eax, 1
je 0x40f5c6
mov dword [esp + 8], 2
jmp 0x40f5d8
mov dword [esp + 8], 4
jmp 0x40f5d8
mov dword [esp + 8], 3
cmp word [esi + 0x202], bp
push ebx
lea ebx, [esi + 0x202]
jne 0x40f601
lea ecx, [esi + 2]
push ecx
push 0x4218f4
push 0xffffffffffffffff
push 0x100
push ebx
call fcn.0041453f
add esp, 0x14
push edi
xor edi, edi
mov dword [esp + 0x1c], ebp
cmp dword [esi + 0x8408], edi
je 0x40f741
mov edi, dword [esi + 0x8404]
lea edx, [esi + 2]
push edi
push edx
call fcn.004010f0
add esp, 8
test eax, eax
je 0x40f71f
mov eax, dword [esi + 0x8408]
lea ecx, [eax + eax + 2]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [esp + 0x1c], eax
test eax, eax
jne 0x40f67e
push str.edit_service__
push str.canon
push 0xc00001fa
call fcn.0041438a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 0x10
pop edi
pop ebx
pop esi
mov eax, 5
pop ebp
add esp, 8
ret
mov edx, dword [esi + 0x8408]
lea ecx, [edx + edx + 2]
push ecx
push edi
push eax
call fcn.00414560
add esp, 0xc
cmp dword [esi + 0x4040c], 0
mov eax, 0x42196c
je 0x40f6a3
xor eax, eax
mov edx, dword [esp + 0x1c]
mov ecx, dword [esi + 0x8414]
push ebx
push ebp
push edx
mov edx, dword [esi + 0x704b0]
push eax
mov eax, dword [esp + 0x20]
push 0
push 0
push 0
push 0xffffffffffffffff
push eax
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
mov eax, dword [esp + 0x1c]
jne 0x40f7a4
cmp eax, edi
je 0x40f6ec
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004020f0
add esp, 4
push eax
push 0x4000020b
call fcn.0041438a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 0xc
pop edi
pop ebx
pop esi
mov eax, 5
pop ebp
add esp, 8
ret
lea edx, [esp + 0x1c]
push edx
push edi
call fcn.004016e0
add esp, 8
test eax, eax
jne 0x40f712
cmp dword [esi + 0x8410], ebp
je 0x40f751
mov ebp, dword [esi + 0x840c]
jmp 0x40f751
cmp byte [esp + 0x20], 0
je 0x40f751
mov edi, str.LocalSystem
mov dword [esp + 0x1c], edi
mov eax, dword [esp + 0x1c]
push eax
call fcn.00401940
add esp, 4
test eax, eax
je 0x40f76c
mov ebp, 0x42196c
jmp 0x40f693
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.004019a0
add esp, 4
test eax, eax
je 0x40f693
mov eax, dword [esp + 0x1c]
cmp eax, edi
je 0x40f799
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push edi
push 0x40000205
jmp 0x40f701
cmp eax, edi
je 0x40f7b8
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [esi + 0x4040c], 0
je 0x40f7e3
mov eax, dword [esi + 0x40408]
mov ecx, dword [esi + 0x704b0]
push eax
push ecx
lea edx, [esi + 2]
push edx
call fcn.0040cfa0
add esp, 0xc
test eax, eax
jne 0x40f712
cmp word [esi + 0x402], 0
lea eax, [esi + 0x402]
jne 0x40f7fa
cmp byte [esp + 0x20], 0
je 0x40f80e
push eax
mov eax, dword [esi + 0x704b0]
push eax
lea ecx, [esi + 2]
push ecx
call fcn.0040d6b0
add esp, 0xc
mov ecx, dword [esi + 0x704b0]
xor edx, edx
cmp dword [esi + 0x8400], 1
lea eax, [esp + 0x14]
sete dl
push eax
push 3
push ecx
mov dword [esp + 0x20], edx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x40f860
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7c
je 0x40f860
push 0
push eax
call fcn.004020f0
add esp, 4
push eax
lea edx, [esi + 2]
push edx
push 0x40000429
push 1
call fcn.00402230
add esp, 0x14
cmp byte [esi], 0
jne 0x40f8a3
mov eax, dword [esp + 0x20]
push eax
push esi
call fcn.0040b2d0
add esp, 8
test eax, eax
je 0x40f89a
push 0x4000021d
call fcn.0041438a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 8
pop edi
pop ebx
pop esi
mov eax, 6
pop ebp
add esp, 8
ret
push esi
call fcn.0040e810
add esp, 4
pop edi
pop ebx
pop esi
xor eax, eax
pop ebp
add esp, 8
ret