Function at 0x57fe20
Capabilities:
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60c
mov dword [0x667e1c], 0
push ebx
push esi
push edi
push 0x580190
xor edi, edi
push 0x16
mov dword [0x667e20], edi
call fcn.005a6336
push 0x580190
push 8
mov dword [0x667de0], eax
call fcn.005a6336
push 0x580190
push 4
mov dword [0x667da8], eax
call fcn.005a6336
push 0x580190
push 2
mov dword [0x667d98], eax
call fcn.005a6336
push 0x580190
push 0xb
mov dword [0x667d90], eax
call fcn.005a6336
push 0x580190
push 0xf
mov dword [0x667db4], eax
call fcn.005a6336
mov ebx, dword [sym.imp.KERNEL32.dll_GetStdHandle]
add esp, 0x30
mov dword [0x667dc4], eax
mov dword [0x667e20], 1
cmp dword [ebp + 0x10], edi
jne 0x57fedd
cmp dword [0x667e18], edi
je 0x57fedd
mov eax, dword [0x667e08]
and eax, 0xfffffffb
push eax
push 0xfffffffffffffff6
mov dword [0x667e0c], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov dword [0x667e20], 2
mov byte [ebp - 0x20c], 0
cmp dword [0x667e18], edi
je 0x580001
push 0
push 0
push str.OPENSSL_WIN32_UTF8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push 0
test eax, eax
lea eax, [ebp - 4]
push eax
push 0x1ff
je 0x57ffb5
lea eax, [ebp - 0x60c]
push eax
push 0xfffffffffffffff6
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
je 0x5800b6
mov eax, dword [ebp - 4]
cmp eax, 2
jb 0x57ff65
cmp word [ebp + eax*2 - 0x610], 0xd
jne 0x57ff65
cmp word [ebp + eax*2 - 0x60e], 0xa
jne 0x57ff65
mov ecx, 0xa
mov word [ebp + eax*2 - 0x610], cx
dec eax
mov dword [ebp - 4], eax
xor ecx, ecx
push ecx
push ecx
push 0x200
mov word [ebp + eax*2 - 0x60c], cx
lea eax, [ebp - 0x20c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x60c]
push eax
push ecx
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
test eax, eax
lea esi, [ebp - 0x20c]
mov eax, edi
cmovle esi, eax
lea eax, [ebp - 0x60c]
push 0x400
push eax
call fcn.004ad110
add esp, 8
jmp 0x58001d
lea eax, [ebp - 0x20c]
push eax
push 0xfffffffffffffff6
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleA]
test eax, eax
je 0x5800b6
mov eax, dword [ebp - 4]
cmp eax, 2
jb 0x57fff7
cmp byte [ebp + eax - 0x20e], 0xd
jne 0x57fff7
cmp byte [ebp + eax - 0x20d], 0xa
jne 0x57fff7
mov byte [ebp + eax - 0x20e], 0xa
dec eax
mov dword [ebp - 4], eax
mov byte [ebp + eax - 0x20c], 0
jmp 0x580025
push dword [0x667e10]
lea eax, [ebp - 0x20c]
push 0x1ff
push eax
call fcn.005a5408
add esp, 0xc
mov esi, eax
test esi, esi
je 0x5800b6
push dword [0x667e10]
call fcn.0059e381
add esp, 4
test eax, eax
jne 0x5800b6
push dword [0x667e10]
call fcn.0059e3ac
add esp, 4
test eax, eax
jne 0x5800b6
lea eax, [ebp - 0x20c]
push 0xa
push eax
call fcn.00594b30
add esp, 8
test eax, eax
je 0x58006c
cmp dword [ebp + 0x14], edi
je 0x580097
mov byte [eax], 0
jmp 0x580097
mov esi, dword [0x667e10]
push esi
lea eax, [ebp - 0xc]
push 4
push eax
call fcn.005a5408
add esp, 0xc
test eax, eax
je 0x5800b6
lea eax, [ebp - 0xc]
push 0xa
push eax
call fcn.00594b30
add esp, 8
test eax, eax
je 0x580072
lea eax, [ebp - 0x20c]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00557600
add esp, 0xc
mov ecx, 1
test eax, eax
cmovns edi, ecx
mov eax, dword [0x667e1c]
or ecx, 0xffffffff
mov esi, dword [ebp + 0x10]
cmp eax, 2
cmove edi, ecx
test esi, esi
jne 0x5800de
push 0x5d46b0
push dword [0x667e14]
call fcn.0041a860
add esp, 8
mov eax, dword [0x667e20]
cmp eax, 2
jl 0x58010f
test esi, esi
jne 0x58010f
cmp dword [0x667e18], esi
je 0x58010f
mov eax, dword [0x667e08]
push eax
push 0xfffffffffffffff6
mov dword [0x667e0c], eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov eax, dword [0x667e20]
cmp eax, 1
jl 0x580165
push dword [0x667de0]
push 0x16
call fcn.005a6336
push dword [0x667da8]
push 8
call fcn.005a6336
push dword [0x667d98]
push 4
call fcn.005a6336
push dword [0x667d90]
push 2
call fcn.005a6336
push dword [0x667db4]
push 0xb
call fcn.005a6336
push dword [0x667dc4]
push 0xf
call fcn.005a6336
add esp, 0x30
lea eax, [ebp - 0x20c]
push 0x200
push eax
call fcn.004ad110
add esp, 8
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret