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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffbd0
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x430], ebx
mov dword [ebp - 0x42c], ebx
mov dword [ebp - 0x420], 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.00405868
mov eax, dword [ebp - 8]
call fcn.00405868
xor eax, eax
push ebp
push 0x51b540
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, ebx
call fcn.0040539c
call fcn.0051b0c0
mov dword [ebp - 0x18], eax
xor eax, eax
push ebp
push 0x51b503
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, esi
mov eax, dword [ebp - 0x18]
call fcn.0046e504
xor ecx, ecx
mov edx, dword [ebp - 4]
mov eax, dword [ebp - 0x18]
call fcn.0046e648
test al, al
je 0x51b4ed
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
call fcn.0046ec14
test al, al
je 0x51b4ed
lea eax, [ebp - 0xc]
push eax
push 0
lea eax, [ebp - 0x10]
push eax
push 0
mov eax, dword [ebp - 8]
call fcn.00405878
push eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 4]
push eax
call sub.advapi32.dll_RegQueryValueExA_1
mov eax, dword [ebp - 0x10]
dec eax
je 0x51b286
dec eax
je 0x51b298
add eax, 0xfffffffe
sub eax, 2
jb 0x51b316
dec eax
je 0x51b32d
jmp 0x51b399
mov ecx, ebx
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
call fcn.0046ea2c
jmp 0x51b4e5
mov ecx, ebx
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
call fcn.0046ea2c
mov eax, dword [ebp - 0xc]
test eax, eax
jns 0x51b2b1
call fcn.00404388
push eax
push 0
mov eax, dword [ebx]
call fcn.00405878
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
test eax, eax
jns 0x51b2ca
call fcn.00404388
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jle 0x51b4e5
mov eax, dword [ebp - 0xc]
test eax, eax
jns 0x51b2e3
call fcn.00404388
push eax
lea eax, [ebp - 0x419]
push eax
mov eax, dword [ebx]
call fcn.00405878
push eax
call sub.kernel32.dll_ExpandEnvironmentStringsA
test eax, eax
jns 0x51b301
call fcn.00404388
mov dword [ebp - 0xc], eax
mov eax, ebx
lea edx, [ebp - 0x419]
call fcn.00405594
jmp 0x51b4e5
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
call fcn.0046eaa4
mov edx, ebx
call fcn.0040c878
jmp 0x51b4e5
mov eax, ebx
call fcn.0040539c
cmp dword [ebp - 0xc], 0xffffffff
jle 0x51b4e5
mov eax, dword [ebp - 0xc]
push eax
lea ecx, [ebp - 0x419]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
call fcn.0046ead4
mov dl, 1
mov eax, dword [0x41d3ac]
call fcn.0040441c
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0xc]
test ecx, ecx
jns 0x51b372
call fcn.00404388
lea eax, [ebp - 0x419]
mov edx, 0x400
call fcn.0051b614
mov edx, ebx
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
call dword [ecx + 0x1c]
mov eax, dword [ebp - 0x14]
call fcn.0040444c
jmp 0x51b4e5
mov eax, ebx
call fcn.0040539c
cmp dword [ebp - 0xc], 0xffffffff
jle 0x51b4e5
mov eax, dword [ebp - 0xc]
push eax
lea ecx, [ebp - 0x419]
mov edx, dword [ebp - 8]
mov eax, dword [ebp - 0x18]
call fcn.0046ead4
cmp byte [ebp + 0xc], 0
je 0x51b47c
xor esi, esi
cmp esi, 0x400
jbe 0x51b3d8
call fcn.00404388
cmp byte [ebp + esi - 0x419], 0
je 0x51b42d
lea eax, [ebp - 0x420]
push eax
cmp esi, 0x400
jbe 0x51b3f6
call fcn.00404388
xor eax, eax
mov al, byte [ebp + esi - 0x419]
mov dword [ebp - 0x428], eax
mov byte [ebp - 0x424], 0
lea edx, [ebp - 0x428]
xor ecx, ecx
mov eax, 0x51b558
call fcn.0040e1f0
mov edx, dword [ebp - 0x420]
mov eax, ebx
call fcn.00405680
jmp 0x51b467
lea eax, [ebp - 0x42c]
push eax
mov eax, dword [ebx]
call fcn.00405678
mov edx, eax
mov eax, dword [ebx]
mov ecx, 1
call fcn.004058d8
mov eax, dword [ebp - 0x42c]
mov edx, 0x51b568
call fcn.004057c4
je 0x51b467
mov eax, ebx
mov edx, 0x51b574
call fcn.00405680
mov eax, dword [ebx]
call fcn.00405678
mov edx, eax
sub edx, 2
mov eax, ebx
call fcn.00405a04
jmp 0x51b4e5
mov edi, dword [ebp - 0xc]
dec edi
test edi, edi
jl 0x51b4d4
inc edi
xor esi, esi
lea eax, [ebp - 0x430]
push eax
cmp esi, 0x400
jbe 0x51b49b
call fcn.00404388
xor eax, eax
mov al, byte [ebp + esi - 0x419]
mov dword [ebp - 0x428], eax
mov byte [ebp - 0x424], 0
lea edx, [ebp - 0x428]
xor ecx, ecx
mov eax, 0x51b580
call fcn.0040e1f0
mov edx, dword [ebp - 0x430]
mov eax, ebx
call fcn.00405680
inc esi
dec edi
jne 0x51b487
mov eax, dword [ebx]
call fcn.00405678
mov edx, eax
dec edx
mov eax, ebx
call fcn.00405a04
mov eax, dword [ebp - 0x18]
call fcn.0046e4d4
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x51b50a
mov eax, dword [ebp - 0x18]
call fcn.0040444c
ret