Function at 0x5fd9e0
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 0x5fd9e9
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 0x5fdcd8
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
call fcn.0040b8b4
mov eax, 0x80000002
call fcn.005fd8d8
mov dword [ebp - 0x14], eax
xor edx, edx
push ebp
push 0x5fdcab
push dword fs:[edx]
mov dword fs:[edx], esp
mov edx, edi
mov eax, dword [ebp - 0x14]
call fcn.004f6d90
xor ecx, ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
call fcn.004f6eec
test al, al
je 0x5fdc93
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f7a7c
test al, al
je 0x5fdc93
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 0x5fdab0
dec eax
je 0x5fdac1
add eax, 0xfffffffe
sub eax, 2
jb 0x5fdb04
dec eax
je 0x5fdb1a
jmp 0x5fdb86
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f7858
jmp 0x5fdc8b
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f7858
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 0x5fdc8b
mov eax, ebx
lea edx, [ebp - 0x2016]
call fcn.0040c884
jmp 0x5fdc8b
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004f78d4
mov edx, ebx
call fcn.0042fd94
jmp 0x5fdc8b
mov eax, ebx
call fcn.0040b8b4
cmp dword [ebp - 0xc], 0xffffffff
jle 0x5fdc8b
mov eax, dword [ebp - 0xc]
call fcn.0040712c
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x5fdb7f
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 0x5fdc8b
mov eax, dword [ebp - 8]
call fcn.0040717c
pop eax
jmp eax
mov eax, ebx
call fcn.0040b8b4
cmp dword [ebp - 0xc], 0xffffffff
jle 0x5fdc8b
mov eax, dword [ebp - 0xc]
call fcn.0040712c
mov dword [ebp - 8], eax
xor edx, edx
push ebp
push 0x5fdc84
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.004f7920
cmp byte [ebp + 0xc], 0
je 0x5fdc25
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x5fdc10
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, 0x5fdcf4
call fcn.004313e8
mov edx, dword [ebp - 0x201c]
mov eax, ebx
call fcn.0040ca34
inc edi
dec esi
jne 0x5fdbd2
mov eax, dword [ebx]
test eax, eax
je 0x5fdc19
mov eax, dword [eax - 4]
mov edx, eax
dec edx
mov eax, ebx
call fcn.0040c9b0
jmp 0x5fdc6c
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x5fdc6c
inc esi
xor edi, edi
mov eax, dword [ebp - 8]
movzx eax, byte [eax + edi]
sub al, 0x20
jae 0x5fdc49
mov eax, ebx
mov edx, 0x5fdd10
call fcn.0040ca34
jmp 0x5fdc68
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 0x5fdc30
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5fdc8b
mov eax, dword [ebp - 8]
call fcn.0040717c
pop eax
jmp eax
mov eax, dword [ebp - 0x14]
call fcn.004f6d60
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5fdcb2
mov eax, dword [ebp - 0x14]
call fcn.004099cc
pop eax
jmp eax