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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff7d0
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x830], ebx
mov dword [ebp - 0x82c], ebx
mov dword [ebp - 0x81c], ebx
mov dword [ebp - 8], ecx
mov dword [ebp - 4], edx
mov esi, eax
mov ebx, dword [ebp + 8]
mov eax, dword [ebp - 4]
call fcn.00406244
mov eax, dword [ebp - 8]
call fcn.00406244
xor eax, eax
push ebp
push 0x50de4a
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
xor edx, edx
call fcn.0040625c
call fcn.0050b8a4
mov dword [ebp - 0x14], eax
xor edx, edx
push ebp
push 0x50de0d
push dword fs:[edx]
mov dword fs:[edx], esp
mov edx, esi
mov eax, dword [ebp - 0x14]
call fcn.004317c8
xor ecx, ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x14]
call fcn.0043182c
test al, al
je 0x50ddf7
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
call fcn.00431e98
test al, al
je 0x50ddf7
lea eax, [ebp - 0xc]
push eax
push 0
lea eax, [ebp - 0x10]
push eax
push 0
mov eax, dword [ebp - 8]
call fcn.004062e8
push eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 4]
push eax
call sub.advapi32.dll_RegQueryValueExW_1
mov eax, dword [ebp - 0x10]
dec eax
je 0x50dbe0
dec eax
je 0x50dbf2
add eax, 0xfffffffe
sub eax, 2
jb 0x50dc4c
dec eax
je 0x50dc63
jmp 0x50dc9d
mov ecx, ebx
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
call fcn.00431cf8
jmp 0x50ddef
mov ecx, ebx
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
call fcn.00431cf8
mov eax, dword [ebp - 0xc]
push eax
push 0
mov eax, dword [ebx]
call fcn.004062e8
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jle 0x50ddef
mov eax, dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x816]
push eax
mov eax, dword [ebx]
call fcn.004062e8
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsW
mov dword [ebp - 0xc], eax
mov eax, ebx
lea edx, [ebp - 0x816]
call fcn.00406408
jmp 0x50ddef
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
call fcn.00431d78
mov edx, ebx
call fcn.0040cd20
jmp 0x50ddef
mov eax, ebx
xor edx, edx
call fcn.0040625c
cmp dword [ebp - 0xc], 0xffffffff
jle 0x50ddef
mov eax, dword [ebp - 0xc]
push eax
lea ecx, [ebp - 0x816]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
call fcn.00431dc0
mov eax, ebx
lea edx, [ebp - 0x816]
call fcn.00406408
jmp 0x50ddef
mov eax, ebx
xor edx, edx
call fcn.0040625c
cmp dword [ebp - 0xc], 0xffffffff
jle 0x50ddef
mov eax, dword [ebp - 0xc]
push eax
lea ecx, [ebp - 0x816]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
call fcn.00431dc0
cmp byte [ebp + 0xc], 0
je 0x50dd83
xor esi, esi
movzx edi, word [ebp + esi*2 - 0x816]
test di, di
je 0x50dd14
lea eax, [ebp - 0x81c]
push eax
mov word [ebp - 0x824], di
mov byte [ebp - 0x820], 9
lea edx, [ebp - 0x824]
xor ecx, ecx
mov eax, 0x50de68
call fcn.0040e2d4
mov edx, dword [ebp - 0x81c]
mov eax, ebx
call fcn.00406670
jmp 0x50dd5e
mov eax, dword [ebx]
mov dword [ebp - 0x828], eax
mov esi, dword [ebp - 0x828]
invalid
test esi, esi
je 0x50dd2b
sub esi, 4
mov esi, dword [esi]
lea eax, [ebp - 0x82c]
mov edi, dword [ebp - 0xc]
dec edi
test edi, edi
jl 0x50ddce
inc edi
lea esi, [ebp - 0x816]
lea eax, [ebp - 0x830]
push eax
movzx eax, word [esi]
mov dword [ebp - 0x824], eax
mov byte [ebp - 0x820], 0
lea edx, [ebp - 0x824]
xor ecx, ecx
mov eax, 0x50dea4
call fcn.0040e2d4
mov edx, dword [ebp - 0x830]
mov eax, ebx
call fcn.00406670
add esi, 2
dec edi
jne 0x50dd92
mov eax, dword [ebx]
mov dword [ebp - 0x828], eax
mov eax, dword [ebp - 0x828]
test eax, eax
je 0x50dde5
sub eax, 4
mov eax, dword [eax]
mov edx, eax
dec edx
mov eax, ebx
call fcn.004065d8