Function at 0x40cde0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x402c
call fcn.00435e30
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x4028], eax
push ebx
push esi
mov esi, ecx
mov bh, dl
push edi
mov edi, dword [ebp + 8]
mov byte [esp + 0x13], bh
cmp byte [esi + 0xa], 0
mov dword [esp + 0x14], edi
je 0x40ce40
lea eax, [esp + 0x1c]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
mov ecx, dword [esp + 0x1c]
or ecx, 3
mov eax, ecx
and ecx, 0xfffffffb
or eax, 4
test bh, bh
cmovne ecx, eax
push ecx
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
xor bl, bl
mov byte [esp + 0x12], bl
mov eax, dword [edi + 8]
mov edx, dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [edi + 4]
cmp eax, 1
jb 0x40ce62
cmp byte [eax + ecx - 1], 0xa
je 0x40d010
cmp byte [esi + 0xc], 0
push 0
je 0x40cfac
cmp byte [esi + 0xa], 0
mov eax, dword [esi]
je 0x40cea1
lea ecx, [esp + 0x24]
push ecx
push 0x1000
lea ecx, [esp + 0x203c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadConsoleW]
test eax, eax
je 0x40d014
mov ebx, dword [esp + 0x20]
mov dword [esp + 0x18], ebx
jmp 0x40cf09
lea ecx, [esp + 0x28]
push ecx
push 0x1000
lea ecx, [esp + 0x3c]
push ecx
push eax
call edx
test eax, eax
je 0x40d014
push 0x1000
lea eax, [esp + 0x2034]
push eax
push dword [esp + 0x2c]
lea eax, [esp + 0x3c]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ebx, eax
lea eax, [esp + 0x30]
push 0x1000
push 0
push eax
mov dword [esp + 0x24], ebx
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x30]
push 0x1000
push eax
mov eax, dword [fcn.0040ae20]
call eax
add esp, 8
mov eax, dword [edi + 8]
lea edx, [edi - 4]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x28], eax
movzx eax, byte [edi + 0x18]
push eax
mov eax, dword [edi + 8]
mov ecx, dword [ecx]
inc eax
shl ebx, 2
push ebx
push eax
push 1
call fcn.00410670
mov ecx, dword [edi + 8]
mov edx, eax
mov eax, dword [esp + 0x24]
push 0
mov dword [edi + 4], edx
push ebx
mov dword [eax], edx
lea eax, [ecx + ebx]
mov dword [edi + 8], eax
mov byte [eax + edx], 0
lea eax, [ecx + edx]
push eax
push dword [esp + 0x34]
lea eax, [esp + 0x2050]
mov ecx, 0xfde9
push eax
call fcn.0040f4d0
mov edi, dword [esp + 0x38]
add esp, 0x24
mov ecx, dword [esp + 0x28]
add ecx, eax
mov eax, dword [edi]
mov dword [edi + 8], ecx
push 0x2000
push 0
mov byte [ecx + eax], 0
lea eax, [esp + 0x2038]
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x2030]
push 0x2000
push eax
mov eax, dword [fcn.0040ae20]
call eax
add esp, 8
jmp 0x40ce46
lea eax, [esp + 0x30]
push eax
push 0x1000
lea eax, [esp + 0x103c]
push eax
push dword [esi]
call edx
test eax, eax
je 0x40d014
push dword [esp + 0x2c]
lea ecx, [esp + 0x1034]
lea eax, [edi + 0xc]
push ecx
push eax
mov eax, dword [eax]
call eax
add esp, 0xc
lea eax, [esp + 0x1030]
push 0x1000
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
lea eax, [esp + 0x1030]
push 0x1000
push eax
mov eax, dword [fcn.0040ae20]
call eax
add esp, 8
jmp 0x40ce46
mov bl, 1
jmp 0x40d018
mov bl, byte [esp + 0x12]
cmp byte [esp + 0x13], 0
jne 0x40d031
push 2
lea eax, [esi + 0x10]
push 0x4434c8
push eax
mov eax, dword [eax]
call eax
add esp, 0xc
cmp byte [esi + 0xa], 0
je 0x40d043
push dword [esp + 0x1c]
push dword [esi]
call dword [sym.imp.KERNEL32.dll_SetConsoleMode]
mov ecx, dword [esp + 0x4034]
mov al, bl
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0043505d
mov esp, ebp
pop ebp
ret