Function at 0x40f590
Capabilities:
Modify service

Disassembly:
sub esp, 8
push ebp
push esi
mov esi, dword [esp + 0x14]
xor ebp, ebp
cmp esi, ebp
jne 0x40f5a8
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 0x40f5e0
sub eax, 1
je 0x40f5d6
mov dword [esp + 8], 2
jmp 0x40f5e8
mov dword [esp + 8], 4
jmp 0x40f5e8
mov dword [esp + 8], 3
cmp word [esi + 0x202], bp
push ebx
lea ebx, [esi + 0x202]
jne 0x40f611
lea ecx, [esi + 2]
push ecx
push 0x421914
push 0xffffffffffffffff
push 0x100
push ebx
call fcn.0041454f
add esp, 0x14
push edi
xor edi, edi
mov dword [esp + 0x1c], ebp
cmp dword [esi + 0x8408], edi
je 0x40f751
mov edi, dword [esi + 0x8404]
lea edx, [esi + 2]
push edi
push edx
call fcn.004010f0
add esp, 8
test eax, eax
je 0x40f72f
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 0x40f68e
push str.edit_service__
push str.canon
push 0xc00001fa
call fcn.0041439a
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.00414570
add esp, 0xc
cmp dword [esi + 0x4040c], 0
mov eax, 0x42198c
je 0x40f6b3
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 0x40f7b4
cmp eax, edi
je 0x40f6fc
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.0041439a
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 0x40f722
cmp dword [esi + 0x8410], ebp
je 0x40f761
mov ebp, dword [esi + 0x840c]
jmp 0x40f761
cmp byte [esp + 0x20], 0
je 0x40f761
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 0x40f77c
mov ebp, 0x42198c
jmp 0x40f6a3
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.004019a0
add esp, 4
test eax, eax
je 0x40f6a3
mov eax, dword [esp + 0x1c]
cmp eax, edi
je 0x40f7a9
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 0x40f711
cmp eax, edi
je 0x40f7c8
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 0x40f7f3
mov eax, dword [esi + 0x40408]
mov ecx, dword [esi + 0x704b0]
push eax
push ecx
lea edx, [esi + 2]
push edx
call fcn.0040cfb0
add esp, 0xc
test eax, eax
jne 0x40f722
cmp word [esi + 0x402], 0
lea eax, [esi + 0x402]
jne 0x40f80a
cmp byte [esp + 0x20], 0
je 0x40f81e
push eax
mov eax, dword [esi + 0x704b0]
push eax
lea ecx, [esi + 2]
push ecx
call fcn.0040d6c0
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 0x40f870
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7c
je 0x40f870
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 0x40f8b3
mov eax, dword [esp + 0x20]
push eax
push esi
call fcn.0040b2e0
add esp, 8
test eax, eax
je 0x40f8aa
push 0x4000021d
call fcn.0041439a
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.0040e820
add esp, 4
pop edi
pop ebx
pop esi
xor eax, eax
pop ebp
add esp, 8
ret