Function at 0x40e800
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x24
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
push ebx
push ebp
mov ebx, dword [eax]
push esi
mov esi, dword [esp + 0x34]
push edi
mov ebp, dword [esi + 4]
test ebp, ebp
je 0x40e844
mov al, byte [ebp - 1]
test al, al
je 0x40e844
cmp al, 0xff
je 0x40e844
push 1
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push ebp
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov eax, dword [esi + 8]
cmp eax, ebx
jae 0x40e84d
mov ebx, eax
test ebx, ebx
jbe 0x40e883
mov ecx, dword [esi + 4]
sub eax, ebx
push eax
lea edx, [ecx + ebx]
push edx
push ecx
call dword [sym.imp.MSVCRT.dll_memmove]
mov edi, dword [esi + 8]
add esp, 0xc
sub edi, ebx
mov ecx, esi
push 0
push edi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x40e883
mov eax, dword [esi + 4]
mov dword [esi + 8], edi
mov byte [eax + edi], 0
mov ebx, dword [esp + 0x3c]
test ebx, ebx
jne 0x40e896
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x24
ret
mov ecx, 9
xor eax, eax
lea edi, [esp + 0x10]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x10]
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll__wstat]
add esp, 8
cmp eax, 0xffffffff
jne 0x40e8c1
pop edi
pop esi
pop ebp
or eax, eax
pop ebx
add esp, 0x24
ret
mov ebp, dword [esp + 0x24]
test ebp, ebp
jne 0x40e8d3
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
push 0x430340
push ebx
call dword [sym.imp.MSVCRT.dll__wfopen]
mov ebx, eax
add esp, 8
test ebx, ebx
mov dword [esp + 0x38], ebx
jne 0x40e8f7
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x24
ret
mov eax, dword [esi + 8]
cmp ebp, eax
ja 0x40e912
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ecx, esi
mov eax, dword [edx]
push eax
push ebp
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::erase_unsigned_int__unsigned_int_]
jmp 0x40e969
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov edi, ebp
sub edi, eax
mov edx, dword [ecx]
sub edx, eax
cmp edx, edi
ja 0x40e92a
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test edi, edi
jbe 0x40e969
mov ebx, dword [esi + 8]
push 0
add ebx, edi
mov ecx, esi
push ebx
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x40e965
mov edx, dword [esi + 4]
mov ecx, edi
mov edi, dword [esi + 8]
xor eax, eax
add edi, edx
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push ebx
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
mov ebx, dword [esp + 0x38]
mov eax, dword [esi + 8]
test eax, eax
je 0x40e98b
ja 0x40e978
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xran_void_]
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Freeze_void_]
mov eax, dword [esi + 4]
test eax, eax
jne 0x40ea1b
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov ebp, dword [esi + 4]
test ebp, ebp
mov ebx, dword [eax]
je 0x40e9c4
mov al, byte [ebp - 1]
test al, al
je 0x40e9c4
cmp al, 0xff
je 0x40e9c4
push 1
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
mov edi, ebp
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push ebp
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::assign_char_const___unsigned_int_]
mov eax, dword [esi + 8]
cmp eax, ebx
jae 0x40e9cd
mov ebx, eax
test ebx, ebx
jbe 0x40ea02
mov ecx, dword [esi + 4]
sub eax, ebx
push eax
lea edx, [ecx + ebx]
push edx
push ecx
call dword [sym.imp.MSVCRT.dll_memmove]
mov edi, dword [esi + 8]
add esp, 0xc
sub edi, ebx
mov ecx, esi
push 0
push edi
call dword [sym.imp.MSVCP60.dll_private:_bool___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Grow_unsigned_int__bool_]
test al, al
je 0x40ea02
push edi
mov ecx, esi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Eos_unsigned_int_]
mov eax, dword [esp + 0x38]
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
push ebx
push ebp
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, ebp
je 0x40ea55
mov ecx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
mov edx, dword [ecx]
mov ecx, esi
push edx
push 0
call dword [sym.imp.MSVCP60.dll_public:_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char______thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::erase_unsigned_int__unsigned_int_]
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
push ebx
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret