Function at 0x40ca40
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x44
mov eax, dword [0x46d040]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x10], ecx
cmp dword [ebp + 0x10], 0
jg 0x40ca6a
jl 0x40ca61
cmp dword [ebp + 0xc], 0
ja 0x40ca6a
xor eax, eax
xor edx, edx
jmp 0x40cc31
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x38], 0
je 0x40ca8d
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x10]
call dword [sym.imp.MSVCP140.dll_protected_virtual:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::xsgetn_char___long_long___int64__]
jmp 0x40cc31
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 8], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x1c]
cmp dword [edx], 0
je 0x40cab7
mov eax, dword [ebp - 0x10]
mov ecx, dword [eax + 0x2c]
mov edx, dword [ecx]
mov dword [ebp - 0x20], edx
jmp 0x40cabe
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
cdq
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jbe 0x40cb7f
lea edx, [ebp - 0xc]
lea ecx, [ebp - 8]
call fcn.00402490
mov ecx, dword [eax]
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x1c]
mov ecx, dword [eax]
mov dword [ebp - 0x30], ecx
mov edx, dword [ebp - 0x30]
mov dword [ebp - 0x24], edx
call fcn.00401df0
movzx eax, al
test eax, eax
je 0x40cb33
mov dword [ebp - 0x18], 0
jmp 0x40cb17
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
cmp edx, dword [ebp - 0x14]
je 0x40cb31
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x24]
add ecx, dword [ebp - 0x18]
mov dl, byte [ecx]
mov byte [eax], dl
jmp 0x40cb0e
jmp 0x40cb47
mov eax, dword [ebp - 0x14]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
mov edx, dword [ebp + 8]
push edx
call sub.VCRUNTIME140.dll_memcpy
add esp, 0xc
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x14]
mov dword [ebp + 8], eax
mov ecx, dword [ebp - 8]
sub ecx, dword [ebp - 0x14]
mov dword [ebp - 8], ecx
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x2c]
mov ecx, dword [eax]
sub ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x2c]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x1c]
mov eax, dword [edx]
add eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x1c]
mov dword [edx], eax
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x4c], 0
je 0x40cc22
mov ecx, dword [ebp - 0x10]
call fcn.0040f8b0
mov dword [ebp - 0x44], 0xfff
cmp dword [ebp - 8], 0xfff
jbe 0x40cbf0
mov ecx, dword [ebp - 0x10]
mov edx, dword [ecx + 0x4c]
push edx
push 0xfff
push 1
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
mov dword [ebp - 0x1c], eax
mov ecx, dword [ebp + 8]
add ecx, dword [ebp - 0x1c]
mov dword [ebp + 8], ecx
mov edx, dword [ebp - 8]
sub edx, dword [ebp - 0x1c]
mov dword [ebp - 8], edx
cmp dword [ebp - 0x1c], 0xfff
je 0x40cbee
xor eax, eax
mov ecx, dword [ebp - 0x2c]
sub ecx, dword [ebp - 8]
mov edx, dword [ebp - 0x28]
sbb edx, eax
mov eax, ecx
jmp 0x40cc31
jmp 0x40cb9b
cmp dword [ebp - 8], 0
jbe 0x40cc22
mov edx, dword [ebp - 0x10]
mov eax, dword [edx + 0x4c]
push eax
mov ecx, dword [ebp - 8]
push ecx
push 1
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x34], eax
mov ecx, dword [ebp - 0x34]
sub ecx, dword [ebp - 0x38]
mov dword [ebp - 8], ecx
xor edx, edx
mov eax, dword [ebp - 0x2c]
sub eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x28]
sbb ecx, edx
mov edx, ecx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0045caa8
mov esp, ebp
pop ebp
ret 0xc