Function at 0x403040
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x42a950
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xd8
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x1c], edi
mov eax, dword [edi + 0x10]
test eax, eax
je 0x403075
call fcn.00403470
mov eax, dword [ebp + 8]
mov dword [ebp - 4], 0
mov eax, dword [eax + 4]
test eax, eax
jne 0x40308b
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
push 0
push 0x80
push 3
push 0
push 1
push closesocket
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x24], esi
jne 0x4030c3
lea ecx, [ebp - 0x44]
push 0x42f348
push ecx
mov dword [ebp - 0x44], str.open_file_error_n
call sub.MSVCRT.dll__CxxThrowException
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
lea edx, [ebp - 0x14]
push 0
push edx
lea eax, [ebp - 0x54]
push 4
push eax
push esi
call ebx
test eax, eax
jne 0x4030f1
lea ecx, [ebp - 0x50]
push 0x42f348
push ecx
mov dword [ebp - 0x50], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 4
jae 0x40310c
lea edx, [ebp - 0x34]
push 0x42f348
push edx
mov dword [ebp - 0x34], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x14]
push 0
push eax
add edi, 0x14
push 4
push edi
push esi
call ebx
test eax, eax
jne 0x403134
lea ecx, [ebp - 0x48]
push 0x42f348
push ecx
mov dword [ebp - 0x48], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 4
jae 0x40314f
lea edx, [ebp - 0x3c]
push 0x42f348
push edx
mov dword [ebp - 0x3c], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x14]
push 0
push eax
lea ecx, [ebp - 0x74]
push 0x10
push ecx
push esi
call ebx
test eax, eax
jne 0x403177
lea edx, [ebp - 0x4c]
push 0x42f348
push edx
mov dword [ebp - 0x4c], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 0x10
jae 0x403192
lea eax, [ebp - 0x28]
push 0x42f348
push eax
mov dword [ebp - 0x28], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
lea ecx, [ebp - 0xe4]
call fcn.00413a80
mov dword [ebp - 0x20], 0
mov ecx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x54]
cmp ecx, eax
jae 0x403287
lea edx, [ebp - 0x14]
push 0
push edx
lea eax, [ebp - 0x18]
push 4
push eax
push esi
call ebx
test eax, eax
jne 0x4031da
lea ecx, [ebp - 0x58]
push 0x42f348
push ecx
mov dword [ebp - 0x58], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 4
jae 0x4031f5
lea edx, [ebp - 0x2c]
push 0x42f348
push edx
mov dword [ebp - 0x2c], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
lea eax, [ebp - 0x18]
push 4
push eax
lea ecx, [ebp - 0xe4]
call fcn.00413ab0
push 0x18
call sub.MFC42.DLL_operatornew
add esp, 4
lea ecx, [ebp - 0x14]
mov edi, eax
push 0
push ecx
push 0x15
push edi
push esi
call ebx
test eax, eax
jne 0x403237
lea edx, [ebp - 0x30]
push 0x42f348
push edx
mov dword [ebp - 0x30], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
cmp dword [ebp - 0x14], 0x15
jae 0x403252
lea eax, [ebp - 0x38]
push 0x42f348
push eax
mov dword [ebp - 0x38], str.read_error_n
call sub.MSVCRT.dll__CxxThrowException
push 0x15
push edi
lea ecx, [ebp - 0xe4]
call fcn.00413ab0
mov ecx, dword [ebp - 0x18]
lea edx, [ebp - 0x60]
mov dword [ebp - 0x60], ecx
mov ecx, dword [ebp - 0x1c]
lea eax, [ebp - 0x8c]
push edx
push eax
add ecx, 4
mov dword [ebp - 0x5c], edi
call fcn.004048b0
inc dword [ebp - 0x20]
jmp 0x4031a4
lea edx, [ebp - 0x84]
lea ecx, [ebp - 0xe4]
push edx
call fcn.00413b60
mov ecx, 4
lea edi, [ebp - 0x74]
lea esi, [ebp - 0x84]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
je 0x4032ca
mov ecx, dword [ebp - 0x1c]
call fcn.00403470
lea ecx, [ebp - 0x40]
push 0x42f348
push ecx
mov dword [ebp - 0x40], str.file_Md5_error_n
call sub.MSVCRT.dll__CxxThrowException
mov ecx, dword [ebp + 8]
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 edx, dword [ebp - 0x1c]
mov ecx, dword [ecx + 8]
mov eax, dword [eax]
mov ebx, ecx
lea edi, [edx + 0x18]
cmp eax, ebx
mov dword [ebp - 0x18], edi
jae 0x4032e8
mov ebx, eax
mov esi, dword [ebp + 8]
cmp edi, esi
jne 0x403379
mov esi, eax
mov eax, dword [edi + 8]
cmp eax, ebx
jae 0x403302
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xran_void_]
mov ecx, edi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Split_void_]
mov eax, dword [edi + 8]
mov ecx, eax
sub ecx, ebx
cmp ecx, esi
jae 0x403317
mov esi, ecx
test esi, esi
jbe 0x403352
mov edx, dword [edi + 4]
sub eax, ebx
sub eax, esi
lea ecx, [edx + ebx]
add ebx, edx
add ecx, esi
push eax
push ecx
push ebx
call dword [sym.imp.MSVCRT.dll_memmove]
mov ebx, dword [edi + 8]
add esp, 0xc
sub ebx, esi
mov ecx, edi
push 0
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 0x403352
push ebx
mov ecx, edi
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 ecx, edi
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Split_void_]
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
test ebx, ebx
jbe 0x4033df
cmp ebx, ecx
jne 0x4033df
mov eax, dword [esi + 4]
test eax, eax
jne 0x40338d
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
cmp byte [eax - 1], 0xfe
jae 0x4033df
push 1
mov ecx, edi
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 eax, dword [esi + 4]
test eax, eax
jne 0x4033a9
mov eax, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov dword [edi + 4], eax
mov edx, dword [esi + 8]
mov dword [edi + 8], edx
mov ecx, dword [esi + 0xc]
mov dword [edi + 0xc], ecx
mov cl, byte [eax - 1]
inc cl
mov byte [eax - 1], cl
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 1
push ebx
mov ecx, 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 0x40341b
mov esi, dword [esi + 4]
test esi, esi
jne 0x4033fb
mov esi, dword [sym.imp.MSVCP60.dll_char_const__private:_static_char_const____cdecl_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Nullstr_void_::_2::_C]
mov edi, dword [edi + 4]
mov ecx, ebx
mov edx, ecx
mov eax, dword [ebp - 0x18]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [eax + 8], ebx
mov eax, dword [eax + 4]
mov byte [eax + ebx], 0
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4