Function at 0x40e9c0
Capabilities:
Read file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff8
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
lea esi, [ebp - 0x1c]
push ebx
push ecx
sub esp, 0x38
mov eax, dword [ecx + 4]
mov edi, dword [ecx + 8]
mov ebx, dword [ecx]
mov dword [esp + 0x10], 0
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], edi
mov dword [esp + 0xc], esi
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], edi
call dword [sym.imp.kernel32.dll_ReadConsoleW]
sub esp, 0x14
test eax, eax
je 0x40ea58
mov esi, dword [ebp - 0x1c]
xor eax, eax
test esi, esi
je 0x40ea47
lea esi, [esi]
movzx edx, word [ebx + eax*2]
cmp dx, 0xa
je 0x40ebc0
cmp dx, 0xd
je 0x40ebc0
inc eax
cmp esi, eax
jne 0x40ea18
xor eax, eax
cmp esi, dword [ebp - 0x20]
sete al
sub esi, eax
xor eax, eax
mov word [ebx + esi*2], ax
mov eax, ebx
lea esp, [ebp - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [ebp - 0x30], eax
call dword [sym.imp.kernel32.dll_GetOEMCP]
mov edi, dword [ebp - 0x20]
mov dword [ebp - 0x28], eax
mov dword [esp], edi
call sym._xalloc
mov ecx, dword [ebp - 0x24]
mov edx, dword [sym.imp.kernel32.dll_SetFilePointerEx]
mov dword [ebp - 0x18], 0
mov edi, eax
lea eax, [ebp - 0x18]
mov dword [ebp - 0x14], 0
mov dword [esp], ecx
mov dword [ebp - 0x2c], edx
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp + 8], 0
call edx
mov ecx, dword [ebp - 0x24]
sub esp, 0x14
mov dword [esp + 0xc], esi
mov esi, dword [ebp - 0x20]
mov dword [esp + 0x10], 0
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], ecx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x40ebe0
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x40ebe0
lea edx, [edi + eax]
movzx esi, word [ebp - 0x28]
mov ecx, dword [ebp - 0x30]
mov eax, edi
cmp edi, edx
jae 0x40ebf0
nop
movzx ecx, byte [eax]
cmp cl, 0xd
sete dl
cmp cl, 0xa
je 0x40ebd0
test dl, dl
jne 0x40ebd0
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.user32.dll_CharNextExA]
mov edx, dword [ebp - 0x1c]
sub esp, 0xc
add edx, edi
cmp eax, edx
jb 0x40eb00
mov ecx, eax
sub ecx, edi
cmp byte [eax], 0xd
sete dl
lea eax, [ecx + 1]
movzx edx, dl
mov dword [ebp - 0x30], ecx
add eax, edx
mov dword [esp + 0x10], 0
cdq
add dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
adc dword [ebp - 0x14], edx
mov edx, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x24]
mov dword [esp + 8], edx
mov dword [esp], eax
mov eax, dword [ebp - 0x2c]
mov dword [esp + 0xc], 0
call eax
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x30]
sub esp, 0x14
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x28]
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], ecx
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_MultiByteToWideChar]
sub esp, 0x18
mov esi, eax
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_free]
jmp 0x40ea35
mov esi, eax
jmp 0x40ea35
sub eax, edi
mov ecx, eax
lea eax, [eax + 1]
jmp 0x40eb48
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_free]
xor eax, eax
jmp 0x40ea47
cmp byte [edi], 0xd
mov eax, 1
sete dl
jmp 0x40eb48