Function at 0x4161b0
Capabilities:
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43d6be
mov eax, dword fs:[0]
push eax
sub esp, 0x44
push ebx
push esi
push edi
mov eax, dword [0x45b00c]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], 0
call fcn.004020d0
mov dword [ebp - 4], 0
mov ecx, ebx
mov eax, dword [ebx]
mov dword [ebp - 0x14], 1
call dword [eax + 0x44]
mov edi, dword [ebp + 0x10]
lea ecx, [ebx + 0x10]
mov eax, dword [edi + 4]
mov dword [ebx + 4], eax
mov eax, dword [edi + 8]
mov dword [ebx + 8], eax
mov eax, dword [edi + 0xc]
mov dword [ebx + 0xc], eax
mov eax, dword [ebx + 0x10]
call dword [eax + 0x44]
lea eax, [edi + 0x10]
push eax
lea ecx, [ebx + 0x10]
call fcn.00402f40
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0xc]
test eax, eax
jne 0x416246
cmp dword [ecx + 0x24], eax
mov eax, 0x445b48
je 0x416246
mov eax, dword [ecx + 0x1c]
lea ecx, [ebp - 0x10]
push ecx
push 0x20019
push 0
push eax
push 0x80000001
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4163bc
mov edi, dword [ebp + 0xc]
mov dword [ebp + 0x10], eax
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x41627f
cmp dword [edi + 0x24], eax
mov eax, 0x445b48
je 0x41627f
mov eax, dword [edi + 0x1c]
lea ecx, [ebp + 0x10]
push ecx
push 0
lea ecx, [ebp + 8]
push ecx
push 0
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4163b3
mov eax, dword [ebp + 8]
cmp eax, 1
je 0x4162ae
cmp eax, 2
jne 0x4163b3
lea ecx, [ebp - 0x34]
call fcn.00428230
mov dword [ebp - 4], 1
lea ecx, [ebp - 0x50]
call fcn.00428230
mov byte [ebp - 4], 2
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x28]
add ecx, 2
mov dword [ebp + 0xc], ecx
test eax, eax
je 0x4162e9
push ecx
lea ecx, [ebp - 0x34]
call fcn.00428ab0
mov esi, eax
mov eax, dword [ebp - 0x28]
jmp 0x41631e
test ecx, ecx
jne 0x4162f1
xor esi, esi
jmp 0x41631e
mov esi, dword [ebp - 0x1c]
mov eax, 0x40
test esi, esi
cmovle esi, eax
mov eax, ecx
cdq
idiv esi
mov eax, dword [ebp - 0x34]
sub esi, edx
add esi, ecx
lea ecx, [ebp - 0x34]
push esi
call dword [eax]
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x24], esi
mov esi, eax
mov dword [ebp - 0x20], ecx
push dword [ebp - 0x20]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
mov eax, dword [edi + 0xc]
add esp, 0xc
test eax, eax
jne 0x416340
cmp dword [edi + 0x24], eax
mov eax, 0x445b48
je 0x416340
mov eax, dword [edi + 0x1c]
lea ecx, [ebp + 0x10]
push ecx
push esi
push 0
push 0
push eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x41639b
cmp dword [ebp - 0x20], eax
mov edi, dword [ebp - 0x28]
cmove edi, eax
cmp dword [ebp + 8], 2
jne 0x416393
mov esi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
push eax
push eax
push edi
call esi
inc eax
push eax
push ecx
lea ecx, [ebp - 0x50]
lea eax, [eax*2 + 2]
push eax
call fcn.00415a70
push eax
push edi
call esi
mov edi, dword [ebp - 0x44]
xor eax, eax
cmp dword [ebp - 0x3c], eax
cmove edi, eax
push edi
mov ecx, ebx
call fcn.0042a7f0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x50]
call fcn.00403370
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x34]
call fcn.00403370
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc