Function at 0x4016d0
Capabilities:
Access peb ldr_data
Get process heap flags
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x24]
push ebx
sub esp, 0x4c
mov eax, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 0xc], edi
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_ReadConsoleW]
sub esp, 0x14
test eax, eax
je 0x401770
mov edi, dword [ebp - 0x24]
test edi, edi
je 0x401920
movzx eax, word [ebx]
cmp ax, 0xa
je 0x40196b
cmp ax, 0xd
je 0x40196b
xor eax, eax
jmp 0x401748
movzx edx, word [ebx + eax*2]
cmp dx, 0xa
je 0x401910
cmp dx, 0xd
je 0x401910
add eax, 1
cmp edi, eax
jne 0x401730
xor eax, eax
cmp edi, dword [ebp + 0xc]
sete al
sub edi, eax
xor eax, eax
mov word [ebx + edi*2], ax
mov eax, ebx
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [ebp - 0x34], eax
call dword [sym.imp.kernel32.dll_GetConsoleCP]
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x2c], eax
mov dword [esp], esi
call dbg.heap_xalloc
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x20], 0
mov esi, eax
lea eax, [ebp - 0x20]
mov dword [ebp - 0x1c], 0
mov dword [esp], ecx
mov ecx, dword [sym.imp.kernel32.dll_SetFilePointerEx]
mov dword [esp + 0x10], 1
mov dword [ebp - 0x30], ecx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp + 8], 0
call ecx
mov ecx, dword [ebp + 0xc]
sub esp, 0x14
mov dword [esp + 8], ecx
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 4], esi
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x401940
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x401940
movzx edi, byte [esi]
mov ecx, edi
cmp cl, 0xd
mov ecx, dword [ebp - 0x34]
sete dl
add eax, esi
cmp esi, eax
jae 0x401972
mov eax, edi
cmp al, 0xa
je 0x401972
test dl, dl
jne 0x401972
movzx edi, word [ebp - 0x2c]
mov eax, esi
jmp 0x40184f
movzx ecx, byte [eax]
cmp cl, 0xd
sete dl
cmp cl, 0xa
je 0x401930
test dl, dl
jne 0x401930
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], edi
call sym._CharNextExA_12
mov edx, dword [ebp - 0x24]
sub esp, 0xc
add edx, esi
cmp eax, edx
jb 0x401835
mov ecx, eax
sub ecx, esi
cmp byte [eax], 0xd
lea edi, [ecx + 1]
sete dl
movzx eax, dl
mov dword [ebp - 0x34], ecx
add eax, edi
mov dword [esp + 0x10], 0
cdq
add dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
adc dword [ebp - 0x1c], edx
mov edx, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], 0
call eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0x34]
sub esp, 0x14
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], ebx
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
sub esp, 0x18
mov edi, eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x40174f
mov edi, eax
jmp 0x40174f
lea esp, [ebp - 0xc]
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
sub eax, esi
mov ecx, eax
lea edi, [eax + 1]
jmp 0x40187c
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
xor eax, eax
sub esp, 0xc
jmp 0x401761
xor edi, edi
jmp 0x40174f
mov edi, 1
jmp 0x40187c