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

Disassembly:
sub esp, 0x224
mov eax, dword [0x428930]
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, 0x42196c
mov dword [esp + 0x18], esi
cmp edi, esi
je 0x40d39d
cmp word [edi], si
je 0x40d39d
push 5
call fcn.0040ca40
add esp, 4
mov dword [esp + 0x1c], eax
cmp eax, esi
jne 0x40d016
push 0x400001fb
call fcn.0041438a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 8
lea eax, [esi + 1]
jmp 0x40d472
movzx ecx, word [edi]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [esp + 0x10], esi
mov eax, edi
cmp cx, si
je 0x40d1f4
movzx ecx, cx
inc esi
cmp cx, 0x2b
jne 0x40d03e
mov dword [esp + 0x10], eax
jmp 0x40d043
test cx, cx
je 0x40d04c
add eax, 2
cmp word [eax], 0
jne 0x40d043
movzx ecx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40d031
cmp dword [esp + 0x10], 0
mov dword [esp + 0x18], esi
je 0x40d1f4
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 0x40d0bc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004020f0
add esp, 4
push eax
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push str._s:__s_n
call fcn.0041438a
add eax, 0x40
push eax
call fcn.00414f38
add esp, 0x10
mov eax, 2
jmp 0x40d472
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 0x40d19b
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 0x40d125
push str.set_service_dependencies__
push str.groups
push 0xc00001fa
call fcn.0041438a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 0x10
lea eax, [ebp + 3]
jmp 0x40d472
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 0x40d1e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004020f0
add esp, 4
push eax
push str.List
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push str._s_s:__s
call fcn.0041438a
add eax, 0x40
push eax
call fcn.00414f38
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 0x40d472
cmp eax, 2
je 0x40d1e5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.004020f0
add esp, 4
push eax
push str.List
push str.SYSTEMCurrentControlSetControlServiceGroupOrder
push str._s_s:__s
call fcn.0041438a
add eax, 0x40
push eax
call fcn.00414f38
mov ecx, dword [esp + 0x28]
add esp, 0x14
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, 4
jmp 0x40d472
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 0x40d37a
lea esp, [esp]
cmp word [edi], 0x2b
jne 0x40d2f6
cmp word [edi + 2], 0
lea ebx, [edi + 2]
je 0x40d265
mov esi, dword [esp + 0x10]
mov ecx, esi
cmp word [ecx], 0
je 0x40d265
push ebx
push esi
call fcn.004082b0
add esp, 8
test eax, eax
jne 0x40d2b8
cmp word [esi], ax
je 0x40d25c
add esi, 2
cmp word [esi], 0
jne 0x40d253
add esi, 2
cmp word [esi], 0
jne 0x40d240
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 0x40d289
push eax
push 0
call ebx
push eax
call esi
push 0x433
call fcn.004020f0
add esp, 4
push eax
push edi
push str._s:__s
call fcn.0041438a
add eax, 0x40
push eax
call fcn.00414f38
add esp, 0x10
mov eax, 5
jmp 0x40d472
mov eax, esi
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d2c0
sub eax, edx
sar eax, 1
lea edx, [eax + eax]
push edx
push esi
push ebx
call fcn.00414560
push edi
push 0x4218f4
push 0xffffffffffffffff
lea eax, [esp + 0x48]
push 0x100
push eax
call fcn.0041453f
add esp, 0x20
jmp 0x40d318
mov edx, dword [esp + 0x1c]
push 0x100
lea ecx, [esp + 0x34]
push ecx
push 4
push edi
push edx
call fcn.0040ca80
add esp, 0x14
test eax, eax
je 0x40d401
lea eax, [esp + 0x30]
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d320
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.00414560
add ebx, esi
add esp, 0xc
cmp word [edi], 0
mov dword [esp + 0x24], ebx
je 0x40d369
jmp 0x40d360
add edi, 2
cmp word [edi], 0
jne 0x40d360
add edi, 2
cmp word [edi], 0
jne 0x40d220
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40d392
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 0x40d45c
test esi, esi
je 0x40d3d6
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.004020f0
add esp, 4
push eax
push 0x4000020b
call fcn.0041438a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 0xc
or eax, 0xffffffff
jmp 0x40d472
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 0x40d425
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.004020f0
add esp, 4
push eax
push edi
push str._s:__s
call fcn.0041438a
add eax, 0x40
push eax
call fcn.00414f38
add esp, 0x10
mov eax, 5
jmp 0x40d472
test esi, esi
je 0x40d470
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.00414adc
add esp, 0x224
ret