Function at 0x52b310
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x610
mov eax, dword [0x6b900c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor esi, esi
mov dword [ebp - 0x60c], edi
mov dword [ebp - 0x610], eax
mov dword [0x6c5e14], 0
mov dword [0x6c5e18], esi
call fcn.0052b2a0
mov ebx, dword [ebp + 0x10]
mov dword [0x6c5e18], 1
test ebx, ebx
jne 0x52b371
push edi
call fcn.0052b210
add esp, 4
test eax, eax
je 0x52b55f
mov dword [0x6c5e18], 2
mov byte [ebp - 0x204], 0
cmp dword [0x6c5e10], esi
je 0x52b4c4
push 0
push 0
push str.OPENSSL_WIN32_UTF8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push 0
test eax, eax
lea eax, [ebp - 0x608]
push eax
push 0x1ff
je 0x52b463
lea eax, [ebp - 0x604]
push eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
je 0x52b55f
mov eax, dword [ebp - 0x608]
cmp eax, 2
jb 0x52b406
cmp word [ebp + eax*2 - 0x608], 0xd
jne 0x52b406
cmp word [ebp + eax*2 - 0x606], 0xa
jne 0x52b406
mov ecx, 0xa
mov word [ebp + eax*2 - 0x608], cx
dec eax
mov dword [ebp - 0x608], eax
add eax, eax
cmp eax, 0x400
jae 0x52b5dc
xor ecx, ecx
push ecx
push ecx
push 0x200
mov word [ebp + eax - 0x604], cx
lea eax, [ebp - 0x204]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x604]
push eax
push ecx
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
lea edi, [ebp - 0x204]
mov eax, esi
cmovle edi, eax
lea eax, [ebp - 0x604]
push 0x400
push eax
call fcn.00537190
add esp, 8
jmp 0x52b4e0
lea eax, [ebp - 0x204]
push eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleA]
test eax, eax
je 0x52b55f
mov eax, dword [ebp - 0x608]
cmp eax, 2
jb 0x52b4af
cmp byte [ebp + eax - 0x206], 0xd
jne 0x52b4af
cmp byte [ebp + eax - 0x205], 0xa
jne 0x52b4af
mov byte [ebp + eax - 0x206], 0xa
dec eax
mov dword [ebp - 0x608], eax
cmp eax, 0x200
jae 0x52b5dc
mov byte [ebp + eax - 0x204], 0
jmp 0x52b4ea
push dword [0x6c5e08]
lea eax, [ebp - 0x204]
push 0x1ff
push eax
call fcn.005fb87d
add esp, 0xc
mov edi, eax
test edi, edi
je 0x52b55f
mov edi, dword [ebp - 0x60c]
push dword [0x6c5e08]
call fcn.005e4801
add esp, 4
test eax, eax
jne 0x52b55f
push dword [0x6c5e08]
call fcn.005e482c
add esp, 4
test eax, eax
jne 0x52b55f
lea eax, [ebp - 0x204]
push 0xa
push eax
call fcn.005e0fa0
add esp, 8
test eax, eax
je 0x52b52d
cmp dword [ebp + 0x14], esi
je 0x52b53f
mov byte [eax], 0
jmp 0x52b53f
push dword [0x6c5e08]
call fcn.0052b5f0
add esp, 4
test eax, eax
je 0x52b55f
lea eax, [ebp - 0x204]
push eax
push dword [ebp - 0x610]
push edi
call fcn.0052ab10
add esp, 0xc
mov ecx, 1
test eax, eax
cmovns esi, ecx
mov eax, dword [0x6c5e14]
or ecx, 0xffffffff
cmp eax, 2
cmove esi, ecx
test ebx, ebx
jne 0x52b584
push 0x6925d8
push dword [0x6c5e0c]
call fcn.00401776
add esp, 8
mov eax, dword [0x6c5e18]
cmp eax, 2
jl 0x52b5ab
test ebx, ebx
jne 0x52b5ab
push dword [ebp - 0x60c]
call fcn.0052b1e0
add esp, 4
neg eax
sbb eax, eax
and esi, eax
mov eax, dword [0x6c5e18]
cmp eax, 1
jl 0x52b5b5
call fcn.0052b240
lea eax, [ebp - 0x204]
push 0x200
push eax
call fcn.00537190
mov ecx, dword [ebp - 4]
add esp, 8
mov eax, esi
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0049a127
mov esp, ebp
pop ebp
ret
call fcn.0049a25b
int3