Function at 0x4f9cf0
Capabilities:
Query environment variable

Disassembly:
push ebp
push edi
push esi
mov esi, edx
push ebx
mov ebx, ecx
sub esp, 0x64c
mov dword [0x74c6e4], 0
mov dword [esp + 4], 0x4f9b20
mov dword [esp], 0x16
mov dword [esp + 0x28], eax
mov dword [0x74c6e0], 0
call sub.msvcrt.dll_signal
mov dword [esp + 4], 0x4f9b20
mov dword [esp], 8
mov dword [0x74c758], eax
call sub.msvcrt.dll_signal
mov dword [esp + 4], 0x4f9b20
mov dword [esp], 4
mov dword [0x74c720], eax
call sub.msvcrt.dll_signal
mov dword [esp + 4], 0x4f9b20
mov dword [esp], 2
mov dword [0x74c710], eax
call sub.msvcrt.dll_signal
mov dword [esp + 4], 0x4f9b20
mov dword [esp], 0xb
mov dword [0x74c708], eax
call sub.msvcrt.dll_signal
mov dword [esp + 4], 0x4f9b20
mov dword [esp], 0xf
mov dword [0x74c72c], eax
call sub.msvcrt.dll_signal
mov dword [0x74c6e0], 1
mov dword [0x74c73c], eax
test ebx, ebx
je 0x4f9f28
mov eax, dword [0x74c6e8]
mov byte [esp + 0x40], 0
mov dword [0x74c6e0], 2
test eax, eax
je 0x4f9f45
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], str.OPENSSL_WIN32_UTF8
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
sub esp, 0xc
mov dword [esp], 0xfffffff6
test eax, eax
je 0x4f9ed0
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
sub esp, 4
lea edx, [esp + 0x3c]
lea ebp, [esp + 0x240]
mov dword [esp], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1ff
mov dword [esp + 4], ebp
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
sub esp, 0x14
test eax, eax
je 0x4fa020
mov eax, dword [esp + 0x3c]
cmp eax, 1
jbe 0x4f9e64
cmp word [esp + eax*2 + 0x23c], 0xd
lea edx, [eax - 2]
je 0x4fa1b8
xor ecx, ecx
lea edi, [esp + 0x40]
mov word [esp + eax*2 + 0x240], cx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x200
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 8], ebp
mov dword [esp + 4], 0
mov dword [esp], 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
sub esp, 0x20
mov dword [esp + 4], 0x400
mov dword [esp], ebp
test eax, eax
jle 0x4fa150
call fcn.004ded70
jmp 0x4f9f66
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
sub esp, 4
lea edx, [esp + 0x3c]
lea edi, [esp + 0x40]
mov dword [esp], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x1ff
mov dword [esp + 4], edi
call dword [sym.imp.KERNEL32.dll_ReadConsoleA]
sub esp, 0x14
test eax, eax
je 0x4f9f77
mov eax, dword [esp + 0x3c]
cmp eax, 1
jbe 0x4f9f1d
cmp byte [esp + eax + 0x3e], 0xd
je 0x4fa1e8
mov byte [esp + eax + 0x40], 0
jmp 0x4f9f66
mov ebp, dword [0x74c6e8]
test ebp, ebp
jne 0x4fa118
mov dword [0x74c6e0], 2
mov byte [esp + 0x40], 0
mov eax, dword [0x74c6f0]
lea edi, [esp + 0x40]
mov dword [esp + 4], 0x1ff
mov dword [esp], edi
mov dword [esp + 8], eax
call sub.msvcrt.dll_fgets
test eax, eax
je 0x4f9f77
mov eax, dword [0x74c6f0]
mov dword [esp], eax
call sub.msvcrt.dll_feof
test eax, eax
je 0x4f9fc0
xor esi, esi
mov eax, dword [0x74c6e4]
cmp eax, 2
mov eax, 0xffffffff
cmove esi, eax
test ebx, ebx
je 0x4fa0b8
mov eax, dword [0x74c6e0]
test eax, eax
jg 0x4fa030
mov dword [esp], edi
mov dword [esp + 4], 0x200
call fcn.004ded70
add esp, 0x64c
mov eax, esi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [0x74c6f0]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x4f9f77
mov dword [esp + 4], 0xa
mov dword [esp], edi
call sub.msvcrt.dll_strchr
test eax, eax
je 0x4fa160
mov edx, dword [esp + 0x660]
test edx, edx
je 0x4f9ff7
mov byte [eax], 0
mov eax, dword [esp + 0x28]
mov dword [esp + 4], esi
mov dword [esp + 8], edi
mov dword [esp], eax
call fcn.004f9ad0
not eax
mov esi, eax
shr esi, 0x1f
jmp 0x4f9f79
lea edi, [esp + 0x40]
jmp 0x4f9f77
mov eax, dword [0x74c758]
mov dword [esp], 0x16
mov dword [esp + 4], eax
call sub.msvcrt.dll_signal
mov eax, dword [0x74c720]
mov dword [esp], 8
mov dword [esp + 4], eax
call sub.msvcrt.dll_signal
mov eax, dword [0x74c710]
mov dword [esp], 4
mov dword [esp + 4], eax
call sub.msvcrt.dll_signal
mov eax, dword [0x74c708]
mov dword [esp], 2
mov dword [esp + 4], eax
call sub.msvcrt.dll_signal
mov eax, dword [0x74c72c]
mov dword [esp], 0xb
mov dword [esp + 4], eax
call sub.msvcrt.dll_signal
mov eax, dword [0x74c73c]
mov dword [esp], 0xf
mov dword [esp + 4], eax
call sub.msvcrt.dll_signal
jmp 0x4f9f9e
mov eax, dword [0x74c6ec]
mov dword [esp + 4], 0x68d11a
mov dword [esp], eax
call fcn.004f9b90
mov eax, dword [0x74c6e0]
cmp eax, 1
jle 0x4f9f96
mov eax, dword [0x74c6e8]
test eax, eax
je 0x4fa030
mov ebx, dword [0x74c6f4]
mov dword [esp], 0xfffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
sub esp, 4
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
sub esp, 8
jmp 0x4f9f91
mov edi, dword [0x74c6f4]
mov dword [esp], 0xfffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
sub esp, 4
and edi, 0xfffffffb
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
sub esp, 8
jmp 0x4f9dbe
call fcn.004ded70
jmp 0x4f9f77
mov eax, dword [0x74c6f0]
lea ebp, [esp + 0x240]
mov dword [esp + 0x2c], eax
jmp 0x4fa190
mov dword [esp + 4], 0xa
mov dword [esp], ebp
call sub.msvcrt.dll_strchr
test eax, eax
jne 0x4f9ff7
mov eax, dword [esp + 0x2c]
mov dword [esp + 4], 4
mov dword [esp], ebp
mov dword [esp + 8], eax
call sub.msvcrt.dll_fgets
test eax, eax
jne 0x4fa178
jmp 0x4f9f77
cmp word [esp + eax*2 + 0x23e], 0xa
lea ecx, [eax - 1]
jne 0x4f9e64
mov edi, 0xa
mov dword [esp + 0x3c], ecx
mov eax, ecx
mov word [esp + edx*2 + 0x240], di
jmp 0x4f9e64
cmp byte [esp + eax + 0x3f], 0xa
lea ecx, [eax - 1]
jne 0x4f9f1d
mov byte [esp + eax + 0x3e], 0xa
mov eax, ecx
jmp 0x4f9f1d