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

Disassembly:
push 0xffffffffffffffff
push 0x4a07a0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x54
mov eax, dword [0x4ef578]
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x14], eax
mov ebp, dword [esp + 0x84]
lea ecx, [esp + 0x18]
push ebp
lea edx, [esp + 0x18]
push ecx
mov ecx, dword [esp + 0x84]
lea eax, [esp + 0x28]
push edx
xor edi, edi
push eax
push ecx
mov dword [esp + 0x80], edi
call fcn.0040d590
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
add esp, 0x14
lea edx, [esp + 0x10]
push edx
push 0x20019
push edi
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40d9ec
mov ecx, dword [esp + 0x18]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea edx, [esp + 0x84]
lea eax, [esp + 0x1c]
push edx
mov edx, dword [esp + 0x14]
push edi
push eax
push edi
push ecx
push edx
mov dword [esp + 0x9c], edi
call ebx
test eax, eax
jne case.default.0x40d7e4
mov eax, dword [esp + 0x1c]
cmp eax, 3
jne 0x40d7b0
cmp dword [esp + 0x80], 2
je 0x40d7da
jmp case.default.0x40d7e4
cmp eax, 1
je 0x40d7ba
cmp eax, 2
jne 0x40d7c3
cmp dword [esp + 0x80], edi
je 0x40d7da
cmp eax, 4
jne case.default.0x40d7e4
cmp dword [esp + 0x80], 1
jne case.default.0x40d7e4
dec eax
cmp eax, 3
ja case.default.0x40d7e4
jmp dword [eax*4 + 0x40daa4]
lea ecx, [esp + 0x28]
call fcn.0040e6b0
mov eax, dword [esp + 0x84]
lea ecx, [esp + 0x28]
push eax
mov byte [esp + 0x70], 1
call fcn.0040e6d0
mov esi, eax
cmp esi, edi
je 0x40d880
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x84]
push ecx
push esi
push edi
push edi
push edx
push eax
call ebx
test eax, eax
jne 0x40d880
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [esp + 0x1c], 1
jne 0x40d84e
push esi
call fcn.00423d40
mov edx, dword [esp + 0x78]
add esp, 4
mov dword [edx], eax
jmp 0x40d865
mov eax, dword [esp + 0x84]
push eax
push esi
call fcn.00423dd0
mov ecx, dword [esp + 0x7c]
add esp, 8
mov dword [ecx], eax
lea ecx, [esp + 0x28]
mov byte [esp + 0x6c], 0
mov dword [esp + 0x28], 0x4d04f0
call fcn.0040e8b0
jmp 0x40da7d
mov byte [esp + 0x6c], 0
mov dword [esp + 0x28], 0x4d04f0
lea ecx, [esp + 0x28]
jmp 0x40d9dc
mov ecx, dword [esp + 0x18]
lea edx, [esp + 0x84]
lea eax, [esp + 0x24]
push edx
mov edx, dword [esp + 0x14]
push eax
push edi
push edi
push ecx
push edx
mov dword [esp + 0x9c], 4
call ebx
test eax, eax
jne case.default.0x40d7e4
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [esp + 0x74]
mov edx, dword [esp + 0x24]
mov dword [ecx], edx
jmp 0x40da7d
lea ecx, [esp + 0x50]
call fcn.0040e6b0
mov eax, dword [esp + 0x84]
lea ecx, [esp + 0x50]
push eax
mov byte [esp + 0x70], 2
call fcn.0040e6d0
mov edi, eax
test edi, edi
je 0x40d9cb
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
lea ecx, [esp + 0x84]
push ecx
push edi
push 0
push 0
push edx
push eax
call ebx
test eax, eax
jne 0x40d9cb
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
push 0
push 0
push edi
call ebx
lea ecx, [esp + 0x3c]
mov dword [esp + 0x84], eax
call fcn.0040e6b0
mov edx, dword [esp + 0x84]
lea ecx, [esp + 0x3c]
push edx
mov byte [esp + 0x70], 3
call fcn.0040e6d0
mov esi, eax
test esi, esi
je 0x40d9b5
mov eax, dword [esp + 0x84]
push eax
push esi
push edi
call ebx
push esi
call fcn.00423d40
mov ecx, dword [esp + 0x78]
mov esi, 0x4d04f0
add esp, 4
mov byte [esp + 0x6c], 2
mov dword [ecx], eax
lea ecx, [esp + 0x3c]
mov dword [esp + 0x3c], esi
call fcn.0040e8b0
lea ecx, [esp + 0x50]
mov byte [esp + 0x6c], 0
mov dword [esp + 0x50], esi
call fcn.0040e8b0
jmp 0x40da7d
lea ecx, [esp + 0x3c]
mov byte [esp + 0x6c], 2
mov dword [esp + 0x3c], 0x4d04f0
call fcn.0040e8b0
mov byte [esp + 0x6c], 0
mov dword [esp + 0x50], 0x4d04f0
lea ecx, [esp + 0x50]
call fcn.0040e8b0
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
dec ebp
mov ecx, dword [esp + 0x7c]
neg ebp
sbb ebp, ebp
add ebp, 3
lea eax, [ebp + ebp*2]
lea eax, [ecx + eax*4]
mov ecx, dword [eax + 8]
test ecx, ecx
jne 0x40da3c
mov eax, dword [esp + 0x80]
sub eax, 0
je 0x40da30
dec eax
je 0x40da24
dec eax
jne 0x40da7d
mov edx, dword [esp + 0x74]
mov dword [edx], 0
jmp 0x40da7d
mov eax, dword [esp + 0x74]
mov dword [eax], 0
jmp 0x40da7d
mov ecx, dword [esp + 0x74]
mov dword [ecx], 0
jmp 0x40da7d
mov ecx, dword [esp + 0x80]
sub ecx, 0
je 0x40da6c
dec ecx
je 0x40da68
dec ecx
jne 0x40da7d
mov eax, dword [eax]
add eax, 8
mov ecx, dword [eax - 4]
push ecx
push eax
call fcn.00423dd0
mov edx, dword [esp + 0x7c]
add esp, 8
mov dword [edx], eax
jmp 0x40da7d
mov eax, dword [eax]
jmp 0x40da77
mov edx, dword [eax]
push edx
call fcn.00423d40
add esp, 4
mov ecx, dword [esp + 0x74]
mov dword [ecx], eax
lea ecx, [esp + 0x14]
mov dword [esp + 0x6c], 0xffffffff
call fcn.00495195
mov ecx, dword [esp + 0x64]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x60
ret