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

Disassembly:
push ebp
push edi
mov edi, ecx
push esi
mov esi, edx
push ebx
sub esp, 0x4c
lea edx, [esp + 0x34]
mov dword [esp + 0x34], 0
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegOpenKeyExW]
sub esp, 0x14
test eax, eax
jne 0x401c00
lea eax, [esp + 0x38]
mov dword [esp + 0x3c], 0
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
lea ebp, [esp + 0x3c]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], 0
mov dword [esp + 8], 0
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_RegQueryValueExW]
mov dword [esp + 4], edi
mov dword [esp + 0x28], eax
call eax
sub esp, 0x18
mov ebx, eax
test eax, eax
jne 0x401c90
mov ebx, dword [esp + 0x38]
lea eax, [ebx - 1]
cmp eax, 1
ja 0x401bf0
mov eax, dword [esp + 0x3c]
lea ebx, [eax + eax]
mov eax, dword [sym.imp.kernel32.dll_GetProcessHeap]
mov dword [esp + 0x24], eax
call eax
mov dword [esp + 8], ebx
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [esp + 4], 0
mov dword [esp + 0x2c], eax
call eax
sub esp, 0xc
mov ebx, eax
mov dword [esp + 0x10], eax
lea eax, [esp + 0x38]
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x14], ebp
mov dword [esp + 8], 0
mov dword [esp + 4], edi
mov dword [esp], eax
mov eax, dword [esp + 0x28]
call eax
sub esp, 0x18
mov ebp, eax
test eax, eax
jne 0x401de0
cmp dword [esp + 0x38], 2
je 0x401cc8
mov eax, dword [esp + 0x34]
test eax, eax
je 0x401be4
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_RegCloseKey]
sub esp, 4
add esp, 0x4c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [section..data], 8
jne 0x401c48
xor ebx, ebx
jmp 0x401bd0
test byte [section..data], 8
je 0x401bf9
mov ebx, eax
mov eax, esi
call fcn.00401600
mov dword [esp + 0x14], ebx
xor ebx, ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.RegOpenKeyExW__s__failed___ld__n
mov dword [esp + 8], str.get_value
mov dword [esp + 4], 0x407000
mov dword [esp], 3
call fcn.004018f0
jmp 0x401bd0
mov eax, edi
call fcn.00401600
mov edi, eax
mov eax, esi
call fcn.00401600
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str._s___s_if_of_an_unsupported_type___lu__n
mov dword [esp + 8], str.get_value
xor ebx, ebx
mov dword [esp + 4], 0x407000
mov dword [esp], 3
call fcn.004018f0
jmp 0x401bd0
test byte [section..data], 8
je 0x401bf9
mov eax, edi
call fcn.00401600
mov edi, eax
mov eax, esi
call fcn.00401600
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.unable_to_get_the_size_of__s___s___ld__n
jmp 0x401c6c
mov edi, dword [sym.imp.kernel32.dll_ExpandEnvironmentStringsW]
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], ebx
call edi
sub esp, 0xc
mov esi, eax
mov dword [esp + 0x3c], eax
test eax, eax
je 0x401e68
mov eax, dword [esp + 0x24]
add esi, esi
call eax
mov dword [esp + 8], esi
mov dword [esp], eax
mov eax, dword [esp + 0x2c]
mov dword [esp + 4], 0
call eax
sub esp, 0xc
mov esi, eax
mov eax, dword [esp + 0x3c]
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 8], eax
call edi
sub esp, 0xc
test eax, eax
je 0x401d53
mov edi, esi
test byte [section..data], 8
jne 0x401e20
test ebx, ebx
je 0x401e9b
cmp ebx, edi
je 0x401e9b
mov esi, edi
xor ebp, ebp
jmp 0x401d8c
call dword [sym.imp.kernel32.dll_GetLastError]
mov edi, eax
mov eax, ebx
call fcn.00401600
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov eax, dword [0x40b004]
mov dword [esp], str._s:error:_ExpandEnvironmentStringsW__s__failed___lu__n
mov dword [esp + 4], eax
call fcn.004018d0
test esi, esi
setne al
mov ebp, eax
test ebx, ebx
je 0x401dac
xor edi, edi
mov eax, dword [esp + 0x24]
call eax
mov dword [esp + 8], ebx
mov ebx, edi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
mov eax, ebp
test al, al
je 0x401bd0
mov eax, dword [esp + 0x24]
call eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x401bd0
mov eax, edi
call fcn.00401600
mov edi, eax
mov eax, esi
call fcn.00401600
mov dword [esp + 0xc], edi
xor edi, edi
mov dword [esp + 8], eax
mov eax, dword [0x40b004]
mov dword [esp + 0x10], ebp
mov dword [esp], str._s:error:_unable_to_get_the_value_of__s___s___ld__n
mov dword [esp + 4], eax
call fcn.004018d0
jmp 0x401d3d
mov eax, esi
call fcn.00401600
mov esi, eax
mov eax, ebx
call fcn.00401600
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str._s___expand_____s_n
mov dword [esp + 8], str.get_value
mov dword [esp + 4], 0x407000
mov dword [esp], 3
call fcn.004018f0
jmp 0x401d3d
call dword [sym.imp.kernel32.dll_GetLastError]
xor edi, edi
mov esi, eax
mov eax, ebx
call fcn.00401600
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov eax, dword [0x40b004]
mov dword [esp], str._s:error:_ExpandEnvironmentStringsW__s__failed___lu__n
mov dword [esp + 4], eax
call fcn.004018d0
jmp 0x401d3d
mov ebx, edi
jmp 0x401bd0