Function at 0x40cbe0
Capabilities:
Modify service
Query or enumerate registry value

Disassembly:
sub esp, 0x224
mov eax, dword [0x422760]
xor eax, esp
mov dword [esp + 0x220], eax
mov eax, dword [esp + 0x22c]
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x240]
xor esi, esi
mov dword [esp + 0x2c], eax
mov ebp, 0x41e5d8
mov dword [esp + 0x18], esi
cmp edi, esi
je 0x40cfdd
cmp word [edi], si
je 0x40cfdd
push 5
call fcn.0040c840
add esp, 4
mov dword [esp + 0x1c], eax
cmp eax, esi
jne 0x40cc56
push 0x400001fb
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 8
lea eax, [esi + 1]
jmp 0x40d0b2
movzx ecx, word [edi]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [esp + 0x10], esi
mov eax, edi
cmp cx, si
je 0x40ce34
movzx ecx, cx
inc esi
cmp cx, 0x2b
jne 0x40cc7e
mov dword [esp + 0x10], eax
jmp 0x40cc83
test cx, cx
je 0x40cc8c
add eax, 2
cmp word [eax], 0
jne 0x40cc83
movzx ecx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40cc71
cmp dword [esp + 0x10], 0
mov dword [esp + 0x18], esi
je 0x40ce34
lea ecx, [esp + 0x14]
push ecx
push 0x20019
push 0
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x40ccfc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00404fa0
add esp, 4
push eax
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push str._s:__s_n
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
add esp, 0x10
mov eax, 2
jmp 0x40d0b2
mov ecx, dword [esp + 0x14]
mov esi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
lea edx, [esp + 0x20]
push edx
push 0
lea eax, [esp + 0x30]
push eax
push 0
push str.List
push ecx
call esi
test eax, eax
jne 0x40cddb
mov edx, dword [esp + 0x20]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov ebp, eax
mov dword [esp + 0x10], ebp
test ebp, ebp
jne 0x40cd65
push str.set_service_dependencies__
push str.groups
push 0xc00001fa
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 0x10
lea eax, [ebp + 3]
jmp 0x40d0b2
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x20]
push eax
push ebp
lea ecx, [esp + 0x30]
push ecx
push 0
push str.List
push edx
call esi
test eax, eax
je 0x40ce25
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00404fa0
add esp, 4
push eax
push str.List
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push str._s_s:__s
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
add esp, 0x14
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, dword [esp + 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, 4
jmp 0x40d0b2
cmp eax, 2
je 0x40ce25
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00404fa0
add esp, 4
push eax
push str.List
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push str._s_s:__s
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
mov ecx, dword [esp + 0x28]
add esp, 0x14
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, 4
jmp 0x40d0b2
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x18]
mov eax, esi
shl eax, 9
add eax, 4
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
cmp word [edi], 0
mov ebp, eax
mov dword [esp + 0x24], 0
je 0x40cfba
lea esp, [esp]
cmp word [edi], 0x2b
jne 0x40cf36
cmp word [edi + 2], 0
lea ebx, [edi + 2]
je 0x40cea5
mov esi, dword [esp + 0x10]
mov ecx, esi
cmp word [ecx], 0
je 0x40cea5
push ebx
push esi
call fcn.004094c0
add esp, 8
test eax, eax
jne 0x40cef8
cmp word [esi], ax
je 0x40ce9c
add esi, 2
cmp word [esi], 0
jne 0x40ce93
add esi, 2
cmp word [esi], 0
jne 0x40ce80
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push ebp
push 0
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40cec9
push eax
push 0
call ebx
push eax
call esi
push 0x433
call fcn.00404fa0
add esp, 4
push eax
push edi
push str._s:__s
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
add esp, 0x10
mov eax, 5
jmp 0x40d0b2
mov eax, esi
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40cf00
sub eax, edx
sar eax, 1
lea edx, [eax + eax]
push edx
push esi
push ebx
call fcn.004127c0
push edi
push 0x41d488
push 0xffffffffffffffff
lea eax, [esp + 0x48]
push 0x100
push eax
call fcn.004126d2
add esp, 0x20
jmp 0x40cf58
mov edx, dword [esp + 0x1c]
push 0x100
lea ecx, [esp + 0x34]
push ecx
push 4
push edi
push edx
call fcn.0040c880
add esp, 0x14
test eax, eax
je 0x40d041
lea eax, [esp + 0x30]
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40cf60
mov ebx, dword [esp + 0x24]
sub eax, edx
sar eax, 1
lea esi, [eax + 1]
lea eax, [esi + esi]
push eax
lea ecx, [esp + 0x34]
push ecx
lea edx, [ebp + ebx*2]
push edx
call fcn.004127c0
add ebx, esi
add esp, 0xc
cmp word [edi], 0
mov dword [esp + 0x24], ebx
je 0x40cfa9
jmp 0x40cfa0
add edi, 2
cmp word [edi], 0
jne 0x40cfa0
add edi, 2
cmp word [edi], 0
jne 0x40ce60
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40cfd2
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [esp + 0x2c]
push 0
push 0
push 0
push ebp
push 0
push 0
push 0
push 0xffffffffffffffff
push 0xffffffffffffffff
push 0xffffffffffffffff
push edx
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
jne 0x40d09c
test esi, esi
je 0x40d016
push ebp
push eax
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.00404fa0
add esp, 4
push eax
push 0x4000020b
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 0xc
or eax, 0xffffffff
jmp 0x40d0b2
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push ebp
push 0
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call esi
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40d065
push eax
push 0
call ebx
push eax
call esi
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 0x433
call fcn.00404fa0
add esp, 4
push eax
push edi
push str._s:__s
call fcn.00412306
add eax, 0x40
push eax
call fcn.00413926
add esp, 0x10
mov eax, 5
jmp 0x40d0b2
test esi, esi
je 0x40d0b0
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor eax, eax
mov ecx, dword [esp + 0x230]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004126f3
add esp, 0x224
ret