Function at 0x4049f0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
mov esi, dword [ebp + 0x10]
test esi, esi
je 0x404a1d
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 2
je 0x404a24
xor eax, eax
jmp 0x404ceb
mov eax, dword [ebp + 0xc]
mov edi, eax
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
mov dword [ebp - 0xc], 0
test byte [eax + 4], 0x48
je 0x404a91
mov dword [ebp - 0xc], 0
cmp byte [eax + 5], 0xa
je 0x404a91
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
mov al, byte [eax + 5]
mov byte [edi], al
inc edi
dec esi
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
mov byte [eax + 5], 0xa
mov dword [ebp - 0xc], 1
push ebx
call fcn.004052f0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
push esi
push edi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x404ae6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp eax, 5
jne 0x404acb
call fcn.00403500
mov dword [eax], 9
or eax, 0xffffffff
jmp 0x404ceb
cmp esi, 0x6d
jne 0x404ad7
xor eax, eax
jmp 0x404ceb
push esi
call fcn.00403350
pop ecx
or eax, 0xffffffff
jmp 0x404ceb
mov eax, dword [ebp - 0xc]
add eax, dword [ebp - 4]
mov dword [ebp - 0xc], eax
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x80
je 0x404ce8
cmp dword [ebp - 4], 0
je 0x404b37
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0xa
jne 0x404b37
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
add eax, 4
or byte [eax], 4
jmp 0x404b51
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
add eax, 4
and byte [eax], 0xfb
mov eax, dword [ebp + 0xc]
mov esi, eax
mov eax, dword [ebp + 0xc]
mov edi, eax
jmp 0x404c75
cmp byte [edi], 0x1a
jne 0x404ba2
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x40
jne 0x404c83
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
add eax, 4
or byte [eax], 2
jmp 0x404c83
cmp byte [edi], 0xd
je 0x404bb2
mov al, byte [edi]
mov byte [esi], al
inc edi
inc esi
jmp 0x404c75
mov eax, dword [ebp - 0xc]
add eax, dword [ebp + 0xc]
dec eax
cmp edi, eax
jae 0x404bda
cmp byte [edi + 1], 0xa
jne 0x404bcf
add edi, 2
mov byte [esi], 0xa
inc esi
jmp 0x404c75
mov al, byte [edi]
mov byte [esi], al
inc edi
inc esi
jmp 0x404c75
inc edi
push ebx
call fcn.004052f0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
push 1
lea edx, [ebp - 5]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404bff
cmp dword [ebp - 4], 0
jne 0x404c05
mov byte [esi], 0xd
inc esi
jmp 0x404c75
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x48
je 0x404c4d
cmp byte [ebp - 5], 0xa
jne 0x404c2b
mov byte [esi], 0xa
inc esi
jmp 0x404c75
mov byte [esi], 0xd
inc esi
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
mov edx, dword [edx*4 + 0x413750]
add edx, eax
mov al, byte [ebp - 5]
mov byte [edx + 5], al
jmp 0x404c75
cmp esi, dword [ebp + 0xc]
jne 0x404c5e
cmp byte [ebp - 5], 0xa
jne 0x404c5e
mov byte [esi], 0xa
inc esi
jmp 0x404c75
push 1
push 0xffffffffffffffff
push ebx
call fcn.00407170
add esp, 0xc
cmp byte [ebp - 5], 0xa
je 0x404c75
mov byte [esi], 0xd
inc esi
mov eax, dword [ebp - 0xc]
add eax, dword [ebp + 0xc]
cmp edi, eax
jb 0x404b60
mov eax, dword [ebp + 0xc]
neg eax
add eax, esi
mov dword [ebp - 0xc], eax
mov eax, ebx
and eax, 0x1f
shl eax, 5
mov edx, ebx
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x40
je 0x404ce8
push ebx
call fcn.004052f0
pop ecx
lea edx, [ebp - 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x404ce8
call fcn.004040a0
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov edx, dword [ebp - 0xc]
push edx
mov edx, dword [ebp + 0xc]
push edx
push eax
mov eax, dword [ebx + 0x8c]
mov eax, dword [eax + 0x8c]
push eax
call fcn.00407260
add esp, 0x10
mov eax, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret