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

Disassembly:
push ebp
mov ebp, esp
push eax
mov eax, 2
add esp, 0xfffff004
push eax
dec eax
jne 0x5fe1f1
mov eax, dword [ebp - 4]
add esp, 0xffffffdc
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x2028], ebx
mov dword [ebp - 0x201c], ebx
mov esi, ecx
mov dword [ebp - 4], edx
mov edi, eax
mov ebx, dword [ebp + 8]
xor eax, eax
push ebp
push 0x5fe4e0
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
call fcn.0040b8b4
mov eax, 0x80000002
call fcn.005fe0e0
mov dword [ebp - 0x14], eax
xor edx, edx
push ebp
push 0x5fe4b3
push dword fs:[edx]
mov dword fs:[edx], esp
mov edx, edi
mov eax, dword [ebp - 0x14]
call fcn.004f74c0
xor ecx, ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
call fcn.004f761c
test al, al
je 0x5fe49b
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f81ac
test al, al
je 0x5fe49b
lea eax, [ebp - 0xc]
push eax
push 0
lea eax, [ebp - 0x10]
push eax
push 0
mov eax, esi
call fcn.0040c824
mov edi, eax
push edi
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 4]
push eax
call sub.advapi32.dll_RegQueryValueExW
mov eax, dword [ebp - 0x10]
dec eax
je 0x5fe2b8
dec eax
je 0x5fe2c9
add eax, 0xfffffffe
sub eax, 2
jb 0x5fe30c
dec eax
je 0x5fe322
jmp 0x5fe38e
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f7f88
jmp 0x5fe493
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f7f88
mov eax, dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x2016]
push eax
mov eax, dword [ebx]
call fcn.0040c824
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jle 0x5fe493
mov eax, ebx
lea edx, [ebp - 0x2016]
call fcn.0040c884
jmp 0x5fe493
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f8004
mov edx, ebx
call fcn.00430488
jmp 0x5fe493
mov eax, ebx
call fcn.0040b8b4
cmp dword [ebp - 0xc], 0xffffffff
jle 0x5fe493
mov eax, dword [ebp - 0xc]
call fcn.0040712c
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x5fe387
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
push 0
push 0
push edi
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 4]
push eax
call sub.advapi32.dll_RegQueryValueExW
mov eax, ebx
mov edx, dword [ebp - 8]
call fcn.0040c884
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5fe493
mov eax, dword [ebp - 8]
call fcn.0040717c
pop eax
jmp eax
mov eax, ebx
call fcn.0040b8b4
cmp dword [ebp - 0xc], 0xffffffff
jle 0x5fe493
mov eax, dword [ebp - 0xc]
call fcn.0040712c
mov dword [ebp - 8], eax
xor edx, edx
push ebp
push 0x5fe48c
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [ebp - 0xc]
push eax
mov ecx, dword [ebp - 8]
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f8050
cmp byte [ebp + 0xc], 0
je 0x5fe42d
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x5fe418
inc esi
xor edi, edi
lea eax, [ebp - 0x201c]
push eax
mov eax, dword [ebp - 8]
movzx eax, byte [eax + edi]
mov dword [ebp - 0x2024], eax
mov byte [ebp - 0x2020], 0
lea edx, [ebp - 0x2024]
xor ecx, ecx
mov eax, 0x5fe4fc
call fcn.00431adc
mov edx, dword [ebp - 0x201c]
mov eax, ebx
call fcn.0040ca34
inc edi
dec esi
jne 0x5fe3da
mov eax, dword [ebx]
test eax, eax
je 0x5fe421
mov eax, dword [eax - 4]
mov edx, eax
dec edx
mov eax, ebx
call fcn.0040c9b0
jmp 0x5fe474
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x5fe474
inc esi
xor edi, edi
mov eax, dword [ebp - 8]
movzx eax, byte [eax + edi]
sub al, 0x20
jae 0x5fe451
mov eax, ebx
mov edx, 0x5fe518
call fcn.0040ca34
jmp 0x5fe470
lea eax, [ebp - 0x2028]
mov edx, dword [ebp - 8]
movzx edx, byte [edx + edi]
call fcn.0040c834
mov edx, dword [ebp - 0x2028]
mov eax, ebx
call fcn.0040ca34
inc edi
dec esi
jne 0x5fe438
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5fe493
mov eax, dword [ebp - 8]
call fcn.0040717c
pop eax
jmp eax
mov eax, dword [ebp - 0x14]
call fcn.004f7490
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5fe4ba
mov eax, dword [ebp - 0x14]
call fcn.004099cc
pop eax
jmp eax