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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0xa4
mov edi, ecx
mov esi, dword [ebp + 8]
lea eax, [ebp - 0x18]
mov dword [eax - 4], esp
mov dword [eax + 8], 0xffffffff
mov dword [eax + 4], 0x541430
mov ecx, dword fs:[0]
mov dword [eax], ecx
mov dword fs:[0], eax
mov ecx, edi
push 0
call fcn.0053da14
test al, al
mov dword [ebp - 0x2c], edi
je 0x540e72
mov ecx, esi
xor esi, esi
lea eax, [ebp - 0x28]
mov dword [eax], esi
lea ebx, [ebp - 0x34]
mov dword [ebx], esi
call fcn.005405e8
push ebx
push esi
lea ecx, [ebp - 0x28]
push ecx
push esi
push eax
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [edi + 0x30], eax
test eax, eax
je 0x540f36
mov dword [ebp - 0x10], 0xffffffff
mov esi, dword [ebp + 8]
mov dword [ebp - 0x30], esp
sub esp, 0x28
mov eax, esp
mov dword [ebp - 0x20], eax
lea ecx, [eax + 8]
mov dword [ebp - 0x24], ecx
mov edx, edi
push esi
call fcn.00540770
add esp, 4
lea ecx, [ebp - 0x5c]
call fcn.0043fd32
lea ecx, [ebp - 0x7c]
call fcn.0043fd32
mov dword [ebp - 0x10], 6
lea ecx, [ebp - 0x9c]
push str.Cant_read_value_of__s
call fcn.00401278
mov dword [ebp - 0x10], 7
lea eax, [ebp - 0x5c]
push eax
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00445492
add esp, 0xc
lea ecx, [ebp - 0xb0]
push eax
call fcn.00447d20
mov eax, dword [ebp - 0x2c]
mov eax, dword [eax + 0x30]
mov ecx, dword [ebp - 0x20]
mov dword [ecx], eax
lea esi, [ebp - 0xb0]
mov dword [ecx + 4], esi
call fcn.00492b51
add esp, 0x28
mov esp, dword [ebp - 0x30]
mov ecx, esi
call fcn.00440f8a
lea ecx, [ebp - 0x9c]
call fcn.0043fda0
lea ecx, [ebp - 0x7c]
call fcn.0043fda0
lea ecx, [ebp - 0x5c]
call fcn.0043fda0
xor eax, eax
mov ecx, dword [ebp - 0x18]
mov dword fs:[0], ecx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret 0xc
mov eax, dword [ebp - 0x28]
dec eax
cmp eax, 2
mov dword [ebp - 0x30], eax
jb 0x541008
mov dword [ebp - 0x20], esp
push eax
sub esp, 0x40
mov esi, esp
lea ecx, [esi + 0x24]
mov edx, dword [ebp - 0x28]
mov dword [ebp - 0x3c], ecx
call fcn.00540800
mov dword [ebp - 0x24], esi
lea ecx, [esi + 4]
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x38], ecx
mov edx, edi
push dword [ebp + 8]
call fcn.00540770
add esp, 4
lea ecx, [ebp - 0x5c]
call fcn.0043fd32
lea ecx, [ebp - 0x7c]
call fcn.0043fd32
mov dword [ebp - 0x10], 1
lea ecx, [ebp - 0x9c]
push str.Registry_value___s__is_not_text__but_of_type__s_
call fcn.00401278
mov dword [ebp - 0x10], 2
lea eax, [ebp - 0x5c]
push eax
lea eax, [ebp - 0x7c]
push eax
lea eax, [ebp - 0x9c]
push eax
call fcn.00445492
add esp, 0xc
lea ecx, [ebp - 0xb0]
push eax
call fcn.00447d20
mov eax, dword [ebp - 0x24]
lea esi, [ebp - 0xb0]
mov dword [eax], esi
call fcn.0044a26b
add esp, 0x44
mov esp, dword [ebp - 0x20]
mov ecx, esi
call fcn.00440f8a
lea ecx, [ebp - 0x9c]
call fcn.0043fda0
lea ecx, [ebp - 0x7c]
call fcn.0043fda0
lea ecx, [ebp - 0x5c]
call fcn.0043fda0
jmp 0x541145
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp - 0x34]
shr edx, 1
je 0x541134
lea esi, [ebp - 0x5c]
mov ecx, esi
mov dword [ebp - 0x24], edx
push edx
push eax
call fcn.004eb044
mov dword [ebp - 0x10], 3
mov ecx, esi
call fcn.0044a5dc
mov dword [ebp - 0x20], eax
mov ecx, dword [ebp + 8]
call fcn.005405e8
lea ecx, [ebp - 0x34]
push ecx
push dword [ebp - 0x20]
lea ecx, [ebp - 0x28]
push ecx
push 0
push eax
mov esi, dword [ebp - 0x2c]
push dword [esi]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov dword [esi + 0x30], eax
lea ecx, [ebp - 0x5c]
call fcn.0044a5dc
mov ecx, dword [ebp - 0x24]
lea edx, [ecx - 1]
cmp word [eax + ecx*2 - 2], 0
cmovne edx, ecx
lea esi, [ebp - 0x5c]
mov ecx, esi
push edx
call fcn.004eb04a
mov ecx, esi
call fcn.004eb058
cmp dword [ebp - 0x28], 2
mov edi, dword [ebp - 0x2c]
jne 0x54113b
cmp byte [ebp + 0x10], 0
jne 0x54113b
mov dword [ebp - 0x10], 0xffffffff
mov ecx, dword [ebp + 0xc]
call fcn.00443c3a
xor ecx, ecx
push ecx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x54112d
mov ebx, eax
mov ecx, esi
call fcn.0043fd32
mov dword [ebp - 0x10], 4
lea ecx, [ebp - 0x7c]
mov dword [ebp - 0x20], ebx
push ebx
push esi
call fcn.0044a5d6
mov dword [ebp - 0x10], 5
lea ecx, [ebp - 0x7c]
call fcn.0044a5dc
mov dword [ebp - 0x24], eax
mov ecx, dword [ebp + 0xc]
call fcn.00443c3a
mov esi, dword [ebp + 0xc]
push dword [ebp - 0x20]
push dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov dword [ebp - 0x20], eax
lea ecx, [ebp - 0x7c]
call fcn.0044a5e4
mov dword [ebp - 0x10], 4
mov ecx, esi
lea eax, [ebp - 0x5c]
push eax
call fcn.00402866
lea ecx, [ebp - 0x5c]
call fcn.0043fda0
cmp dword [ebp - 0x20], 0
mov edi, dword [ebp - 0x2c]
jne 0x54113b
call fcn.00401cb0
jmp 0x54113b
mov ecx, eax
call fcn.0044f0dc
cmp dword [edi + 0x30], 0
jne 0x540e68
cmp dword [ebp - 0x30], 2
setb al
jmp 0x540f22