Function at 0x40c270
Capabilities:
Query environment variable
Query or enumerate registry key

Disassembly:
push 0xffffffffffffffff
push 0x4b0b28
mov eax, dword fs:[0]
push eax
sub esp, 0x34
push ebp
push esi
push edi
mov eax, dword [0x4ca1d0]
xor eax, esp
push eax
lea eax, [esp + 0x44]
mov dword fs:[0], eax
mov esi, ecx
mov dword [esp + 0x24], esi
lea eax, [esp + 0x1c]
push eax
push str.SYSTEMCurrentControlSetServices
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
test eax, eax
je 0x40c2d7
push eax
push str.RegOpenKey_Error__x
push esi
call fcn.00408af0
add esp, 0xc
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
add esp, 0x40
ret
mov eax, dword [esp + 0x1c]
push 0
push 0
push 0
push 0
push 0
push 0
lea ecx, [esp + 0x30]
push ecx
lea edx, [esp + 0x44]
push edx
push 0
push 0
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
test eax, eax
jne 0x40c514
mov edx, dword [0x4d3dfc]
mov eax, dword [edx + 0xc]
inc dword [esp + 0x18]
mov ecx, 0x4d3dfc
call eax
lea edi, [eax + 0x10]
mov dword [esp + 0x20], edi
mov edx, dword [0x4d3dfc]
mov eax, dword [edx + 0xc]
mov ecx, 0x4d3dfc
mov dword [esp + 0x4c], 0
call eax
add eax, 0x10
mov dword [esp + 0x14], eax
xor ebp, ebp
mov byte [esp + 0x4c], 1
cmp dword [esp + 0x28], ebp
jbe 0x40c4cb
mov eax, dword [edi - 8]
mov edx, dword [esp + 0x18]
mov ecx, 1
sub ecx, dword [edi - 4]
sub eax, edx
or eax, ecx
jge 0x40c378
push edx
lea ecx, [esp + 0x24]
call fcn.00407c90
mov edx, dword [esp + 0x18]
mov edi, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push edx
push edi
push ebp
push ecx
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyW]
mov esi, eax
mov eax, dword [edi - 8]
push eax
push edi
call fcn.00495a6d
add esp, 8
test eax, eax
jl 0x40c532
cmp eax, dword [edi - 8]
jg 0x40c532
xor edx, edx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], dx
test esi, esi
jne 0x40c4c0
mov edx, dword [esp + 0x1c]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [esp + 0x2c]
push edx
call fcn.00408270
test eax, eax
je 0x40c4c0
mov eax, dword [0x4d3dfc]
mov edx, dword [eax + 0xc]
mov ecx, 0x4d3dfc
call edx
lea esi, [eax + 0x10]
mov dword [esp + 0x10], esi
mov eax, dword [esi - 8]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x8000
or eax, ecx
mov byte [esp + 0x4c], 2
jge 0x40c418
push 0x8000
lea ecx, [esp + 0x14]
call fcn.00407c90
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
push 0x8000
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov eax, dword [esi - 8]
push eax
push esi
call fcn.00495a6d
add esp, 8
test eax, eax
jl 0x40c532
cmp eax, dword [esi - 8]
jg 0x40c532
xor ecx, ecx
mov dword [esi - 0xc], eax
mov word [esi + eax*2], cx
cmp dword [esi - 0xc], ecx
jne 0x40c479
lea ecx, [esp + 0x14]
call fcn.00408370
mov ecx, dword [esp + 0x24]
lea edx, [esp + 0x14]
push edx
lea eax, [esp + 0x30]
push eax
add ecx, 0x348
call fcn.0040bb20
jmp 0x40c49f
lea ecx, [esp + 0x10]
call fcn.00408370
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [esp + 0x28]
lea edx, [esp + 0x3c]
push edx
add ecx, 0x348
call fcn.0040bb20
mov esi, dword [esp + 0x10]
lea eax, [esi - 0x10]
mov byte [esp + 0x4c], 1
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c4c0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
inc ebp
cmp ebp, dword [esp + 0x28]
jb 0x40c351
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
mov byte [esp + 0x4c], 0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c4f0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
mov dword [esp + 0x4c], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40c514
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
add esp, 0x40
ret
push 0x80070057
call fcn.004010b0
int3