Function at 0x40cfb0
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, 0x42198c
mov dword [esp + 0x18], esi
cmp edi, esi
je 0x40d3ad
cmp word [edi], si
je 0x40d3ad
push 5
call fcn.0040ca50
add esp, 4
mov dword [esp + 0x1c], eax
cmp eax, esi
jne 0x40d026
push 0x400001fb
call fcn.0041439a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 8
lea eax, [esi + 1]
jmp 0x40d482
movzx ecx, word [edi]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [esp + 0x10], esi
mov eax, edi
cmp cx, si
je 0x40d204
movzx ecx, cx
inc esi
cmp cx, 0x2b
jne 0x40d04e
mov dword [esp + 0x10], eax
jmp 0x40d053
test cx, cx
je 0x40d05c
add eax, 2
cmp word [eax], 0
jne 0x40d053
movzx ecx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x40d041
cmp dword [esp + 0x10], 0
mov dword [esp + 0x18], esi
je 0x40d204
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 0x40d0cc
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.0041439a
add eax, 0x40
push eax
call fcn.00414f48
add esp, 0x10
mov eax, 2
jmp 0x40d482
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 0x40d1ab
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 0x40d135
push str.set_service_dependencies__
push str.groups
push 0xc00001fa
call fcn.0041439a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 0x10
lea eax, [ebp + 3]
jmp 0x40d482
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 0x40d1f5
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.0041439a
add eax, 0x40
push eax
call fcn.00414f48
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 0x40d482
cmp eax, 2
je 0x40d1f5
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.0041439a
add eax, 0x40
push eax
call fcn.00414f48
mov ecx, dword [esp + 0x28]
add esp, 0x14
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, 4
jmp 0x40d482
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 0x40d38a
lea esp, [esp]
cmp word [edi], 0x2b
jne 0x40d306
cmp word [edi + 2], 0
lea ebx, [edi + 2]
je 0x40d275
mov esi, dword [esp + 0x10]
mov ecx, esi
cmp word [ecx], 0
je 0x40d275
push ebx
push esi
call fcn.004082b0
add esp, 8
test eax, eax
jne 0x40d2c8
cmp word [esi], ax
je 0x40d26c
add esi, 2
cmp word [esi], 0
jne 0x40d263
add esi, 2
cmp word [esi], 0
jne 0x40d250
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 0x40d299
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.0041439a
add eax, 0x40
push eax
call fcn.00414f48
add esp, 0x10
mov eax, 5
jmp 0x40d482
mov eax, esi
lea edx, [eax + 2]
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d2d0
sub eax, edx
sar eax, 1
lea edx, [eax + eax]
push edx
push esi
push ebx
call fcn.00414570
push edi
push 0x421914
push 0xffffffffffffffff
lea eax, [esp + 0x48]
push 0x100
push eax
call fcn.0041454f
add esp, 0x20
jmp 0x40d328
mov edx, dword [esp + 0x1c]
push 0x100
lea ecx, [esp + 0x34]
push ecx
push 4
push edi
push edx
call fcn.0040ca90
add esp, 0x14
test eax, eax
je 0x40d411
lea eax, [esp + 0x30]
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d330
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.00414570
add ebx, esi
add esp, 0xc
cmp word [edi], 0
mov dword [esp + 0x24], ebx
je 0x40d379
jmp 0x40d370
add edi, 2
cmp word [edi], 0
jne 0x40d370
add edi, 2
cmp word [edi], 0
jne 0x40d230
mov esi, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
test eax, eax
je 0x40d3a2
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 0x40d46c
test esi, esi
je 0x40d3e6
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.0041439a
add eax, 0x40
push eax
call fcn.004022a0
add esp, 0xc
or eax, 0xffffffff
jmp 0x40d482
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 0x40d435
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.0041439a
add eax, 0x40
push eax
call fcn.00414f48
add esp, 0x10
mov eax, 5
jmp 0x40d482
test esi, esi
je 0x40d480
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.00414aec
add esp, 0x224
ret