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

Disassembly:
sub esp, 8
push ebx
push ebp
push esi
mov esi, dword [esp + 0x24]
sub ebx, ebx
push edi
cmp esi, ebx
mov dword [esp + 0x10], ebx
je 0x40adc7
mov dword [esi], ebx
mov ecx, dword [esp + 0x1c]
cmp ecx, ebx
je 0x40af53
mov eax, dword [esp + 0x20]
cmp eax, ebx
je 0x40af53
cmp byte [eax], 0
je 0x40af53
cmp esi, ebx
je 0x40af53
lea edx, [esp + 0x14]
push edx
push 0x20019
push ebx
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x40af53
mov edi, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x20]
push eax
push ebx
push ecx
push ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
push edi
push edx
call ebx
or eax, eax
jne 0x40af3e
mov eax, dword [esp + 0x1c]
push eax
call fcn.0041b345
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x40af3e
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x24]
push ebp
push edx
push 0
push edi
push eax
call ebx
or eax, eax
jne 0x40af35
mov eax, dword [esp + 0x20]
cmp eax, 1
jne 0x40aec0
mov ecx, dword [esp + 0x1c]
inc ecx
push ecx
call fcn.0041b345
push eax
pop edi
add esp, 4
or edi, edi
mov dword [esi], edi
je 0x40af35
mov edx, dword [esp + 0x1c]
xor eax, eax
lea ecx, [edx + 1]
push ecx
pop edx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [esi]
push eax
push ebp
push ecx
call dword [sym.imp.KERNEL32.DLL_lstrcpynA]
mov dword [esp + 0x10], 1
jmp 0x40af35
cmp eax, 2
jne 0x40af35
mov ebx, dword [sym.imp.KERNEL32.DLL_ExpandEnvironmentStringsA]
push eax
mov eax, dword [esi]
lea edx, [esp + 0x2c]
push edx
push eax
mov byte [esp + 0x34], 0
mov byte [esp + 0x35], 0
call ebx
cmp eax, 2
mov dword [esp + 0x1c], eax
jbe 0x40af35
inc eax
push eax
call fcn.0041b345
push eax
pop edi
add esp, 4
or edi, edi
mov dword [esi], edi
je 0x40af35
mov ecx, dword [esp + 0x1c]
xor eax, eax
inc ecx
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
push edx
pop ecx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [esi]
push eax
push ecx
push ebp
call ebx
cmp eax, dword [esp + 0x1c]
ja 0x40af2d
test eax, eax
mov dword [esp + 0x10], 1
ja 0x40af35
mov dword [esp + 0x10], 0
push ebp
call fcn.0041b272
add esp, 4
mov edx, dword [esp + 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x10]
or eax, eax
jne 0x40afa0
mov ebx, eax
mov ebp, dword [esp + 0x2c]
or ebp, ebp
je 0x40af96
push ebp
pop edi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
call fcn.0041b345
push eax
pop edx
add esp, 4
or edx, edx
mov dword [esi], edx
je 0x40af96
push ebp
pop edi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
push edi
pop esi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
push eax
pop ecx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 8
ret
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 8
ret