Function at 0x61da70
Capabilities:
Query environment variable

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x60c
mov dword [esp + 8], edx
mov edi, ecx
mov esi, dword [esp + 0x620]
mov dword [0xa96ef8], 0
mov dword [0xa96ef4], 0
push 0x61de60
push 0x16
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
mov dword [0xa96f10], eax
push 0x61de60
push 8
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
mov dword [0xa96f04], eax
push 0x61de60
push 4
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
mov dword [0xa96f00], eax
push 0x61de60
push 2
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
mov dword [0xa96efc], eax
push 0x61de60
push 0xb
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
mov dword [0xa96f08], eax
push 0x61de60
push 0xf
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
mov dword [0xa96f0c], eax
mov dword [0xa96ef4], 1
test esi, esi
jne 0x61db50
cmp byte [0xa96ee4], 0
je 0x61dbed
mov eax, dword [0xa96eec]
and eax, 0xfffffffb
mov dword [0xa96f14], eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push dword [0xa96f14]
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
movzx eax, byte [0xa96ee4]
mov dword [0xa96ef4], 2
mov byte [esp + 0xc], 0
cmp al, 1
jne 0x61dbfc
push 0
push 0
push str.OPENSSL_WIN32_UTF8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x61dc25
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, esp
lea ebx, [esp + 0x20c]
push 0
push ecx
push 0x1ff
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
je 0x61dc77
mov eax, dword [esp]
cmp eax, 2
jb 0x61dc84
cmp word [esp + eax*2 + 0x208], 0xd
jne 0x61dc84
cmp word [esp + eax*2 + 0x20a], 0xa
jne 0x61dc84
mov esi, edi
mov word [esp + eax*2 + 0x208], 0xa
dec eax
mov dword [esp], eax
jmp 0x61dc86
mov dword [0xa96ef4], 2
mov byte [esp + 0xc], 0
lea eax, [esp + 0xc]
push dword [0xa96ef0]
push 0x1ff
push eax
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fgets
add esp, 0xc
mov ebp, eax
xor ebx, ebx
test ebp, ebp
jne 0x61dcd6
jmp 0x61dd6c
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, esp
lea ebp, [esp + 0xc]
push 0
push ecx
push 0x1ff
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleA]
test eax, eax
je 0x61dc77
mov eax, dword [esp]
cmp eax, 2
jb 0x61dc67
lea ecx, [esp + 0xc]
cmp byte [eax + ecx - 2], 0xd
jne 0x61dc67
cmp byte [esp + eax + 0xb], 0xa
jne 0x61dc67
mov byte [esp + eax + 0xa], 0xa
dec eax
mov byte [esp + eax + 0xc], 0
xor ebx, ebx
test ebp, ebp
jne 0x61dcd6
jmp 0x61dd6c
xor ebp, ebp
xor ebx, ebx
test ebp, ebp
jne 0x61dcd6
jmp 0x61dd6c
mov esi, edi
mov word [esp + eax*2 + 0x20c], 0
lea edi, [esp + 0xc]
push 0
push 0
push 0x200
push edi
push 0xffffffffffffffff
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
xor ebp, ebp
test eax, eax
cmovg ebp, edi
push 0x400
push ebx
call fcn.005e8480
add esp, 8
mov edi, esi
mov esi, dword [esp + 0x620]
xor ebx, ebx
test ebp, ebp
je 0x61dd6c
push dword [0xa96ef0]
call sub.api_ms_win_crt_stdio_l1_1_0.dll_feof
add esp, 4
test eax, eax
jne 0x61dd6c
mov ebp, dword [0xa96ef0]
push ebp
call sub.api_ms_win_crt_stdio_l1_1_0.dll_ferror
add esp, 4
test eax, eax
jne 0x61dd6c
lea eax, [esp + 0xc]
push 0xa
push eax
call sub.api_ms_win_crt_private_l1_1_0.dll_strchr
add esp, 8
test eax, eax
je 0x61dd21
cmp dword [esp + 0x624], 0
je 0x61dd53
mov byte [eax], 0
jmp 0x61dd53
mov dword [esp + 4], edi
lea edi, [esp + 0x20c]
nop dword [eax]
push ebp
push 4
push edi
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fgets
add esp, 0xc
test eax, eax
je 0x61dd6c
push 0xa
push edi
call sub.api_ms_win_crt_private_l1_1_0.dll_strchr
add esp, 8
test eax, eax
je 0x61dd30
mov edi, dword [esp + 4]
lea eax, [esp + 0xc]
push eax
push dword [esp + 0xc]
push edi
call fcn.0061d500
add esp, 0xc
mov ebx, eax
not ebx
shr ebx, 0x1f
mov edi, dword [0xa96ef8]
test esi, esi
je 0x61dd7d
mov eax, dword [0xa96ef4]
jmp 0x61dd9b
push dword [0xa96ee8]
push 0xa
call sub.api_ms_win_crt_stdio_l1_1_0.dll_fputc
add esp, 8
mov eax, dword [0xa96ef4]
cmp eax, 2
jge 0x61de29
test eax, eax
jle 0x61ddff
push dword [0xa96f10]
push 0x16
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
push dword [0xa96f04]
push 8
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
push dword [0xa96f00]
push 4
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
push dword [0xa96efc]
push 2
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
push dword [0xa96f08]
push 0xb
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
push dword [0xa96f0c]
push 0xf
call sub.api_ms_win_crt_runtime_l1_1_0.dll_signal
add esp, 8
cmp edi, 2
mov eax, 0xffffffff
cmove ebx, eax
lea eax, [esp + 0xc]
push 0x200
push eax
call fcn.005e8480
add esp, 8
mov eax, ebx
add esp, 0x60c
pop esi
pop edi
pop ebx
pop ebp
ret
cmp byte [0xa96ee4], 1
jne 0x61dd9f
mov eax, dword [0xa96eec]
mov dword [0xa96f14], eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push dword [0xa96f14]
push eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
jmp 0x61dd76