Function at 0x406400
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push esi
push edi
push ecx
lea edi, [ebp - 0x30]
mov ecx, 0xc
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
pop ecx
mov dword [ebp - 4], ecx
cmp dword [ebp + 0x10], 0
jg 0x406433
jl 0x40642a
cmp dword [ebp + 0xc], 0
ja 0x406433
xor eax, eax
xor edx, edx
jmp 0x4065a6
mov eax, dword [ebp - 4]
cmp dword [eax + 0x38], 0
je 0x40645f
mov esi, esp
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 - 4]
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__]
cmp esi, esp
call fcn.00410b80
jmp 0x4065a6
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0xc], ecx
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x14], eax
mov esi, esp
mov ecx, dword [ebp - 4]
call dword [sym.imp.MSVCP140.dll_protected:_long_long___int64____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::_Gnavail_void_const]
cmp esi, esp
call fcn.00410b80
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jbe 0x4064ec
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0xc]
push edx
call fcn.004039f0
add esp, 8
mov eax, dword [eax]
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x28]
push ecx
mov esi, esp
mov ecx, dword [ebp - 4]
call dword [sym.imp.MSVCP140.dll_protected:_char____thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::gptr_void_const]
cmp esi, esp
call fcn.00410b80
push eax
mov edx, dword [ebp + 8]
push edx
call fcn.004038b0
add esp, 0xc
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x28]
mov dword [ebp + 8], eax
mov ecx, dword [ebp - 0xc]
sub ecx, dword [ebp - 0x28]
mov dword [ebp - 0xc], ecx
mov esi, esp
mov edx, dword [ebp - 0x28]
push edx
mov ecx, dword [ebp - 4]
call dword [sym.imp.MSVCP140.dll_protected:_void___thiscall_std::basic_streambuf_char__struct_std::char_traits_char__::gbump_int_]
cmp esi, esp
call fcn.00410b80
mov eax, dword [ebp - 4]
cmp dword [eax + 0x4c], 0
je 0x406597
mov ecx, dword [ebp - 4]
call fcn.004073b0
mov dword [ebp - 0x2c], 0xfff
cmp dword [ebp - 0xc], 0xfff
jbe 0x406566
mov esi, esp
mov ecx, dword [ebp - 4]
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
cmp esi, esp
call fcn.00410b80
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp + 8]
add ecx, dword [ebp - 0x30]
mov dword [ebp + 8], ecx
mov edx, dword [ebp - 0xc]
sub edx, dword [ebp - 0x30]
mov dword [ebp - 0xc], edx
cmp dword [ebp - 0x30], 0xfff
je 0x406564
xor eax, eax
mov ecx, dword [ebp - 0x18]
sub ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 0x14]
sbb edx, eax
mov eax, ecx
jmp 0x4065a6
jmp 0x406508
cmp dword [ebp - 0xc], 0
jbe 0x406597
mov esi, esp
mov edx, dword [ebp - 4]
mov eax, dword [edx + 0x4c]
push eax
mov ecx, dword [ebp - 0xc]
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
cmp esi, esp
call fcn.00410b80
mov ecx, dword [ebp - 0xc]
sub ecx, eax
mov dword [ebp - 0xc], ecx
xor edx, edx
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x14]
sbb ecx, edx
mov edx, ecx
push edx
mov ecx, ebp
push eax
lea edx, [0x4065cc]
call fcn.00410b2c
pop eax
pop edx
pop edi
pop esi
add esp, 0x30
cmp ebp, esp
call fcn.00410b80
mov esp, ebp
pop ebp
ret 0xc