Function at 0x40ad50
Capabilities:
Read file on windows

Disassembly:
mov eax, 0x2024
call fcn.0041ff00
mov eax, dword [esp + 0x2028]
push ebx
push ebp
push esi
test eax, eax
push edi
je 0x40addc
push 0x8000
push eax
call dword [sym.imp.MSVCRT.dll__open]
mov edi, eax
add esp, 8
cmp edi, 0xffffffff
mov dword [esp + 0x10], edi
jne 0x40ad9e
push str.open
call dword [sym.imp.MSVCRT.dll_perror]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2024
ret
push 0x44
call sub.MFC42.DLL_operatornew
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x40adb5
push str.malloc
jmp 0x40adcc
push 0x40
push ebx
push edi
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, 0x40
je 0x40ade9
push str.read
call dword [sym.imp.MSVCRT.dll_perror]
push edi
call dword [sym.imp.MSVCRT.dll__close]
add esp, 8
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x2024
ret
mov eax, dword [ebx + 0x1c]
push 0
push eax
push edi
call dword [sym.imp.MSVCRT.dll__lseek]
mov ebp, dword [ebx + 0x28]
mov dword [esp + 0x28], 0
push ebp
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
add esp, 0x10
test esi, esi
mov dword [esp + 0x18], esi
mov dword [ebx + 0x40], esi
jne 0x40ae41
push str.malloc
call dword [sym.imp.MSVCRT.dll_perror]
push edi
call dword [sym.imp.MSVCRT.dll__close]
push ebx
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2024
ret
mov eax, dword [ebx + 0x2c]
mov dword [esp + 0x28], 0
test eax, eax
jle 0x40b033
jmp 0x40ae5a
mov esi, dword [esp + 0x18]
lea ecx, [esp + 0x20]
push 8
push ecx
push edi
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, 8
jne 0x40af57
mov eax, dword [esp + 0x20]
cmp ax, 0x2008
jbe 0x40aead
push str.Too_big___creating_temp_buffer__n
call dword [sym.imp.MSVCRT.dll_printf]
mov edx, dword [esp + 0x24]
and edx, 0xffff
push edx
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
add esp, 8
test esi, esi
je 0x40af94
mov eax, dword [esp + 0x20]
jmp 0x40aeb1
lea esi, [esp + 0x2c]
mov edi, eax
and eax, 0xffff
push eax
mov eax, dword [esp + 0x14]
push esi
push eax
and edi, 0xffff
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, edi
jne 0x40afd8
mov eax, dword [esp + 0x22]
and eax, 0xffff
cmp ebp, eax
mov dword [esp + 0x14], eax
jae 0x40aeeb
mov dword [esp + 0x14], ebp
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
push edi
lea ecx, [esp + 0x18]
push esi
add edx, eax
push ecx
push edx
call fcn.00408500
lea ecx, [esp + 0x3c]
add esp, 0x10
cmp esi, ecx
je 0x40af17
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
mov eax, dword [esp + 0x22]
and eax, 0xffff
cmp ebp, eax
mov dword [esp + 0x14], eax
jae 0x40af2e
mov eax, ebp
mov dword [esp + 0x14], eax
mov esi, dword [esp + 0x1c]
mov ecx, dword [ebx + 0x2c]
mov edi, dword [esp + 0x10]
sub ebp, eax
add esi, eax
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x1c], esi
cmp eax, ecx
mov dword [esp + 0x28], eax
jl 0x40ae56
jmp 0x40b033
mov eax, dword [esp + 0x203c]
test eax, eax
jne 0x40b033
push str.read
call dword [sym.imp.MSVCRT.dll_perror]
push edi
call dword [sym.imp.MSVCRT.dll__close]
mov edi, dword [sym.imp.MSVCRT.dll_free]
push ebx
call edi
push esi
call edi
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2024
ret
push str.malloc
call dword [sym.imp.MSVCRT.dll_perror]
mov eax, dword [esp + 0x2040]
add esp, 4
test eax, eax
jne 0x40b033
push edi
call dword [sym.imp.MSVCRT.dll__close]
mov esi, dword [sym.imp.MSVCRT.dll_free]
push ebx
call esi
mov edx, dword [esp + 0x20]
push edx
call esi
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2024
ret
lea eax, [esp + 0x2c]
cmp esi, eax
je 0x40afee
push esi
mov esi, dword [sym.imp.MSVCRT.dll_free]
call esi
add esp, 4
jmp 0x40aff4
mov esi, dword [sym.imp.MSVCRT.dll_free]
mov eax, dword [esp + 0x203c]
test eax, eax
jne 0x40b02f
push str.read_buf
call dword [sym.imp.MSVCRT.dll_perror]
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.MSVCRT.dll__close]
push ebx
call esi
mov edx, dword [esp + 0x24]
push edx
call esi
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2024
ret
mov edi, dword [esp + 0x10]
push edi
call dword [sym.imp.MSVCRT.dll__close]
add esp, 4
mov eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2024
ret