Function at 0x4055e0
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x408d3c
mov eax, dword fs:[0]
push eax
sub esp, 0x4d8
mov eax, dword [0x40e018]
xor eax, esp
mov dword [esp + 0x4d0], eax
push ebx
push esi
push edi
mov eax, dword [0x40e018]
xor eax, esp
push eax
lea eax, [esp + 0x4e8]
mov dword fs:[0], eax
mov eax, dword [ebp + 0x10]
mov ebx, ecx
cmp dword [ebx + 0x18], 0x10
mov esi, edx
mov dword [esp + 0x28], eax
lea edi, [ebx + 4]
jb 0x405638
mov eax, dword [edi]
jmp 0x40563a
mov eax, edi
push 1
push 0x40
push 0x20
push eax
lea ecx, [esp + 0x44]
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_ifstream_char__struct_std::char_traits_char__::constructor_char_const___int__int_]
mov dword [esp + 0x4f0], 0
mov ecx, dword [esp + 0x34]
mov edx, dword [ecx + 4]
mov eax, dword [esp + edx + 0x3c]
test eax, eax
jne 0x405a33
cmp byte [ebp + 8], al
je 0x4059d3
cmp byte [ebp + 0xc], al
jne 0x405943
push 2
push eax
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::seekg_long_int__int_]
lea eax, [esp + 0xc4]
push eax
lea ecx, [esp + 0x38]
call dword [sym.imp.MSVCP90.dll_public:_class_std::fpos_int____thiscall_std::basic_istream_char__struct_std::char_traits_char__::tellg_void_]
mov esi, dword [eax + 8]
add esi, dword [eax]
xor ecx, ecx
sub esp, 0x18
mov eax, esp
mov dword [eax], ecx
mov dword [eax + 8], ecx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ecx
lea ecx, [esp + 0x4c]
mov dword [esp + 0x2c], esp
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::seekg_class_std::fpos_int__]
cmp byte [0x40e12c], 0
jne 0x405787
mov ebx, dword [sym.imp.WINMM.dll_timeGetTime]
call ebx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x4056e6
fadd dword [0x40af50]
push esi
fstp dword [esp + 0x1c]
call sub.MSVCR90.dll_void____cdecl_operator_new___unsigned_int_
mov edi, eax
add esp, 4
mov dword [esp + 0x20], edi
call ebx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x40570d
fadd dword [0x40af50]
fsub dword [esp + 0x18]
fstp dword [esp + 0x18]
fld dword [0x40e594]
fadd dword [esp + 0x18]
fstp dword [0x40e594]
call ebx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x405739
fadd dword [0x40af50]
push esi
fstp dword [esp + 0x1c]
push edi
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::read_char___int_]
call ebx
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x40575d
fadd dword [0x40af50]
fsub dword [esp + 0x18]
mov edi, dword [esp + 0x28]
lea ebx, [esp + 0x20]
fstp dword [esp + 0x18]
fld dword [0x40e598]
fadd dword [esp + 0x18]
fstp dword [0x40e598]
call fcn.00406f00
jmp 0x405a3b
cmp byte [0x40e12d], 0
mov dword [esp + 0x18], esi
je 0x4057ca
cmp dword [ebx + 0x18], 0x10
jb 0x40579e
mov eax, dword [edi]
jmp 0x4057a0
mov eax, edi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
push 0
push eax
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], 0
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x4057ea
fadd dword [0x40af50]
cmp dword [esp + 0x18], 0
fstp dword [esp + 0x14]
jle 0x4058f6
call dword [sym.imp.MSVCR90.dll_rand]
mov ecx, eax
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
lea edx, [eax + eax*4]
add edx, edx
sub ecx, edx
mov dword [esp + 0x1c], ecx
fild dword [esp + 0x1c]
fdiv qword [0x40af40]
fmul qword [0x40af38]
fadd qword [0x40af30]
fstp dword [esp + 0x1c]
fild dword [esp + 0x18]
fdiv dword [esp + 0x1c]
call fcn.004088a0
mov esi, eax
cmp esi, 0x400
jge 0x405853
mov esi, 0x400
mov eax, dword [esp + 0x18]
cmp esi, eax
jle 0x40585d
mov esi, eax
sub eax, esi
push esi
mov dword [esp + 0x1c], eax
call sub.MSVCR90.dll_void____cdecl_operator_new___unsigned_int_
add esp, 4
cmp byte [0x40e12d], 0
mov ebx, eax
mov dword [esp + 0x1c], ebx
je 0x405891
mov ecx, dword [esp + 0x20]
push 0
lea eax, [esp + 0x28]
push eax
push esi
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x40589d
push esi
push ebx
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::read_char___int_]
mov edi, dword [esp + 0x28]
mov ecx, dword [edi + 0xc]
test ecx, ecx
jne 0x4058ac
xor eax, eax
jmp 0x4058b4
mov eax, dword [edi + 0x14]
sub eax, ecx
sar eax, 2
mov esi, dword [edi + 0x10]
mov edx, esi
sub edx, ecx
sar edx, 2
cmp edx, eax
jae 0x4058cc
mov dword [esi], ebx
add esi, 4
mov dword [edi + 0x10], esi
jmp 0x4058eb
cmp ecx, esi
jbe 0x4058d6
call dword [sym.imp.MSVCR90.dll__invalid_parameter_noinfo]
mov eax, dword [edi]
push esi
push eax
lea eax, [esp + 0x24]
push eax
lea ecx, [esp + 0x38]
push ecx
mov eax, edi
call fcn.00407230
cmp dword [esp + 0x18], 0
jg 0x4057f9
call dword [sym.imp.WINMM.dll_timeGetTime]
mov dword [esp + 0x1c], eax
fild dword [esp + 0x1c]
test eax, eax
jge 0x40590e
fadd dword [0x40af50]
cmp byte [0x40e12d], 0
fsub dword [esp + 0x14]
fstp dword [esp + 0x14]
fld dword [0x40e598]
fadd dword [esp + 0x14]
fstp dword [0x40e598]
je 0x405a3b
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x405a3b
test al, 1
jne 0x405a3b
mov esi, dword [sym.imp.WINMM.dll_timeGetTime]
push 0x400
lea eax, [esp + 0xe0]
push 0
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
call esi
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x40597c
fadd dword [0x40af50]
push 0x400
fstp dword [esp + 0x18]
lea ecx, [esp + 0xe0]
push ecx
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::read_char___int_]
call esi
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
test eax, eax
jge 0x4059ab
fadd dword [0x40af50]
fsub dword [esp + 0x14]
mov edx, dword [esp + 0x34]
mov eax, dword [edx + 4]
test byte [esp + eax + 0x3c], 1
fstp dword [esp + 0x14]
fld dword [0x40e598]
fadd dword [esp + 0x14]
fstp dword [0x40e598]
je 0x405951
jmp 0x405a3b
mov esi, dword [sym.imp.WINMM.dll_timeGetTime]
call esi
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
test eax, eax
jge 0x4059ed
fadd dword [0x40af50]
push 0xa
fstp dword [esp + 0x18]
lea ecx, [esp + 0xe0]
push ecx
lea ecx, [esp + 0x3c]
call dword [sym.imp.MSVCP90.dll_public:_class_std::basic_istream_char__struct_std::char_traits_char______thiscall_std::basic_istream_char__struct_std::char_traits_char__::read_char___int_]
call esi
mov dword [esp + 0x24], eax
fild dword [esp + 0x24]
test eax, eax
jge 0x405a19
fadd dword [0x40af50]
fsub dword [esp + 0x14]
fstp dword [esp + 0x14]
fld dword [0x40e598]
fadd dword [esp + 0x14]
fstp dword [0x40e598]
jmp 0x405a3b
push ebx
mov ebx, esi
call fcn.00406e50
lea ecx, [esp + 0x34]
mov dword [esp + 0x4f0], 0xffffffff
call dword [sym.imp.MSVCP90.dll_public:_void___thiscall_std::basic_ifstream_char__struct_std::char_traits_char__::vbase_dtor_void_]
mov ecx, dword [esp + 0x4e8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x4d0]
xor ecx, esp
call fcn.00407ec8
mov esp, ebp
pop ebp
ret