Function at 0x408440
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x120
push ebx
push esi
push edi
push ecx
lea edi, [ebp - 0x60]
mov ecx, 0x18
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
pop ecx
mov dword [ebp - 8], ecx
cmp dword [ebp + 0x10], 0
jg 0x408477
jl 0x40846e
cmp dword [ebp + 0xc], 0
ja 0x408477
xor eax, eax
xor edx, edx
jmp 0x408600
mov eax, dword [ebp - 8]
cmp dword [eax + 0x38], 0
je 0x4084a3
mov esi, esp
mov eax, dword [ebp + 0x10]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
mov ecx, dword [ebp - 8]
call dword [sym.imp.MSVCP140D.dll_protected_virtual:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::xsgetn_char___long_long___int64__]
cmp esi, esp
call fcn.00415080
jmp 0x408600
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], ecx
mov esi, esp
mov ecx, dword [ebp - 8]
call dword [sym.imp.MSVCP140D.dll_protected:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::_Gnavail_void_const]
cmp esi, esp
call fcn.00415080
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
jbe 0x408530
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x14]
push ecx
call fcn.004030c0
add esp, 8
mov edx, dword [eax]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x3c]
push eax
mov esi, esp
mov ecx, dword [ebp - 8]
call dword [sym.imp.MSVCP140D.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::gptr_void_const]
cmp esi, esp
call fcn.00415080
push eax
mov ecx, dword [ebp + 8]
push ecx
call fcn.004069b0
add esp, 0xc
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x3c]
mov dword [ebp + 8], eax
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 0x3c]
mov dword [ebp - 0x14], eax
mov esi, esp
mov eax, dword [ebp - 0x3c]
push eax
mov ecx, dword [ebp - 8]
call dword [sym.imp.MSVCP140D.dll_protected:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::gbump_int_]
cmp esi, esp
call fcn.00415080
mov eax, dword [ebp - 8]
cmp dword [eax + 0x4c], 0
je 0x4085f1
mov ecx, dword [ebp - 8]
call fcn.00405f00
mov dword [ebp - 0x48], 0xfff
cmp dword [ebp - 0x14], 0xfff
jbe 0x4085aa
mov esi, esp
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x4c]
push ecx
push 0xfff
push 1
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.ucrtbased.dll_fread]
add esp, 0x10
cmp esi, esp
call fcn.00415080
mov dword [ebp - 0x54], eax
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x54]
mov dword [ebp + 8], eax
mov eax, dword [ebp - 0x14]
sub eax, dword [ebp - 0x54]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x54], 0xfff
je 0x4085a8
xor eax, eax
mov ecx, dword [ebp - 0x24]
sub ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x20]
sbb edx, eax
mov eax, ecx
jmp 0x408600
jmp 0x40854c
cmp dword [ebp - 0x14], 0
jbe 0x4085f1
mov esi, esp
mov eax, dword [ebp - 8]
mov ecx, dword [eax + 0x4c]
push ecx
mov edx, dword [ebp - 0x14]
push edx
push 1
mov eax, dword [ebp + 8]
push eax
call dword [sym.imp.ucrtbased.dll_fread]
add esp, 0x10
cmp esi, esp
call fcn.00415080
mov dword [ebp - 0x11c], eax
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x120], ecx
mov edx, dword [ebp - 0x120]
sub edx, dword [ebp - 0x11c]
mov dword [ebp - 0x14], edx
xor eax, eax
mov ecx, dword [ebp - 0x24]
sub ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x20]
sbb edx, eax
mov eax, ecx
push edx
mov ecx, ebp
push eax
lea edx, [0x408628]
call fcn.00415020
pop eax
pop edx
pop edi
pop esi
pop ebx
add esp, 0x120
cmp ebp, esp
call fcn.00415080
mov esp, ebp
pop ebp
ret 0xc