Function at 0x65e7fc
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 0x65e805
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 0x65eaf6
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
call fcn.0040ab4c
mov eax, 0x80000002
call fcn.0065e7c4
mov dword [ebp - 0x14], eax
xor edx, edx
push ebp
push 0x65eac9
push dword fs:[edx]
mov dword fs:[edx], esp
mov edx, edi
mov eax, dword [ebp - 0x14]
call fcn.0053cfd8
xor ecx, ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
call fcn.0053d134
test al, al
je 0x65eab1
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.0053e094
test al, al
je 0x65eab1
lea eax, [ebp - 0xc]
push eax
push 0
lea eax, [ebp - 0x10]
push eax
push 0
mov eax, esi
call fcn.0040b9ec
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 0x65e8cc
dec eax
je 0x65e8dd
add eax, 0xfffffffe
sub eax, 2
jb 0x65e920
dec eax
je 0x65e936
jmp 0x65e9a2
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.0053dafc
jmp 0x65eaa9
mov ecx, ebx
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.0053dafc
mov eax, dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x2016]
push eax
mov eax, dword [ebx]
call fcn.0040b9ec
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jle 0x65eaa9
mov eax, ebx
lea edx, [ebp - 0x2016]
call fcn.0040ba50
jmp 0x65eaa9
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.0053dd8c
mov edx, ebx
call fcn.00427698
jmp 0x65eaa9
mov eax, ebx
call fcn.0040ab4c
cmp dword [ebp - 0xc], 0xffffffff
jle 0x65eaa9
mov eax, dword [ebp - 0xc]
call fcn.004071ac
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x65e99b
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.0040ba50
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x65eaa9
mov eax, dword [ebp - 8]
call fcn.004071e0
pop eax
jmp eax
mov eax, ebx
call fcn.0040ab4c
cmp dword [ebp - 0xc], 0xffffffff
jle 0x65eaa9
mov eax, dword [ebp - 0xc]
call fcn.004071ac
mov dword [ebp - 8], eax
xor edx, edx
push ebp
push 0x65eaa2
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.0053df1c
cmp byte [ebp + 0xc], 0
je 0x65ea43
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x65ea2c
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, 0x65eb14
call fcn.00428e90
mov edx, dword [ebp - 0x201c]
mov eax, ebx
call fcn.0040bbfc
inc edi
dec esi
jne 0x65e9ee
mov eax, dword [ebx]
test eax, eax
je 0x65ea37
sub eax, 4
mov eax, dword [eax]
mov edx, eax
dec edx
mov eax, ebx
call fcn.0040bb7c
jmp 0x65ea8a
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x65ea8a
inc esi
xor edi, edi
mov eax, dword [ebp - 8]
movzx eax, byte [eax + edi]
sub al, 0x20
jae 0x65ea67
mov eax, ebx
mov edx, 0x65eb30
call fcn.0040bbfc
jmp 0x65ea86
lea eax, [ebp - 0x2028]
mov edx, dword [ebp - 8]
movzx edx, byte [edx + edi]
call fcn.0040ba00
mov edx, dword [ebp - 0x2028]
mov eax, ebx
call fcn.0040bbfc
inc edi
dec esi
jne 0x65ea4e
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x65eaa9
mov eax, dword [ebp - 8]
call fcn.004071e0
pop eax
jmp eax
mov eax, dword [ebp - 0x14]
call fcn.0053cfa8
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x65ead0
mov eax, dword [ebp - 0x14]
call fcn.00408c24
pop eax
jmp eax