Function at 0x456830
Capabilities:
Read file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4d5c29
push eax
mov dword fs:[0], esp
sub esp, 0x4c
push ebx
push ebp
push esi
mov esi, ecx
xor ebx, ebx
push edi
cmp dword [esi + 0x58], ebx
je 0x4569a9
cmp dword [esi + 0x68], ebx
je 0x4569a9
mov cl, byte [esi + 0x60]
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
lea eax, [esi + 0x60]
mov byte [esp + 0x24], cl
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov ecx, dword [edx]
push ecx
push ebx
push eax
lea ecx, [esp + 0x30]
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_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
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, dword [esi + 0x58]
mov dword [esp + 0x64], ebx
mov eax, dword [edx]
mov edi, eax
cmp ecx, edi
jae 0x4568a4
mov edi, ecx
sub eax, dword [esp + 0x2c]
cmp eax, edi
ja 0x4568b2
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
cmp edi, ebx
jbe 0x456900
mov eax, dword [esp + 0x2c]
push ebx
lea ecx, [esp + 0x28]
lea ebp, [eax + edi]
push ebp
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 0x456900
mov esi, dword [esi + 0x54]
cmp esi, ebx
jne 0x4568da
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 edx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
mov ecx, edi
push ebp
lea edi, [eax + edx]
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
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 edi, str..BMP
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [esp + 0x2c]
repne scasb al, byte es:[edi]
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
not ecx
dec ecx
mov esi, ecx
mov ecx, dword [eax]
sub ecx, edx
cmp ecx, esi
ja 0x456928
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
cmp esi, ebx
jbe 0x45696f
mov edx, dword [esp + 0x2c]
push ebx
lea ecx, [esp + 0x28]
lea ebp, [edx + esi]
push ebp
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 0x45696f
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
mov ecx, esi
mov esi, str..BMP
lea edi, [edx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x28]
mov dword [esp + 0x2c], ebp
mov byte [ecx + ebp], 0
mov eax, dword [esp + 0x28]
cmp eax, ebx
jne 0x45697c
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 0x4fde98
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
cmp ebp, ebx
jne 0x4569cc
mov ecx, dword [esp + 0x28]
cmp ecx, ebx
je 0x4569a9
mov al, byte [ecx - 1]
test al, al
je 0x4569c0
cmp al, 0xff
je 0x4569c0
dec al
mov byte [ecx - 1], al
xor eax, eax
mov ecx, dword [esp + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x58
ret 8
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
jmp 0x4569a9
mov edi, dword [sym.imp.MSVCRT.dll_fread]
push ebp
push 1
lea edx, [esp + 0x1c]
push 0xe
push edx
call edi
push ebp
push 1
lea eax, [esp + 0x4c]
push 0x28
push eax
call edi
mov esi, dword [esp + 0x8c]
mov ecx, dword [esp + 0x58]
mov ebx, dword [esp + 0x90]
mov dword [esi], ecx
mov ecx, dword [esp + 0x5c]
mov dword [ebx], ecx
mov eax, dword [esi]
imul eax, ecx
lea edx, [eax + eax*2]
push edx
call sub.MFC42.DLL_operatornew
add esp, 0x24
cmp word [esp + 0x42], 0x18
mov ecx, eax
mov dword [esp + 0x70], ecx
jne 0x456a7c
mov eax, dword [esi]
push ebp
imul eax, dword [ebx]
lea eax, [eax + eax*2]
push eax
push 1
push ecx
call edi
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov ecx, dword [ebx]
mov eax, dword [esp + 0x84]
add esp, 0x14
mov dword [esp + 0x6c], 0
test ecx, ecx
jle 0x456a7c
mov ecx, dword [esi]
xor edi, edi
test ecx, ecx
jle 0x456a6d
mov cl, byte [eax]
mov dl, byte [eax + 2]
mov byte [eax], dl
mov byte [eax + 2], cl
mov ecx, dword [esi]
inc edi
add eax, 3
cmp edi, ecx
jl 0x456a59
mov ecx, dword [esp + 0x6c]
mov edx, dword [ebx]
inc ecx
cmp ecx, edx
mov dword [esp + 0x6c], ecx
jl 0x456a51
cmp word [esp + 0x42], 8
jne 0x456b41
mov eax, dword [esp + 0x54]
lea ecx, [eax*4]
push ecx
call sub.MFC42.DLL_operatornew
mov edx, dword [esp + 0x58]
push ebp
mov edi, eax
push edx
push 4
push edi
call dword [sym.imp.MSVCRT.dll_fread]
mov eax, dword [esi]
imul eax, dword [ebx]
push eax
call sub.MFC42.DLL_operatornew
mov ecx, dword [esi]
push ebp
imul ecx, dword [ebx]
push ecx
push 1
push eax
mov dword [esp + 0x38], eax
call dword [sym.imp.MSVCRT.dll_fread]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov edx, dword [ebx]
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x9c]
add esp, 0x2c
test edx, edx
mov dword [esp + 0x6c], 0
jle 0x456b2e
mov edx, dword [esi]
xor ebp, ebp
test edx, edx
jle 0x456b1f
xor edx, edx
add ecx, 3
mov dl, byte [eax]
mov dl, byte [edi + edx*4 + 2]
mov byte [ecx - 3], dl
xor edx, edx
mov dl, byte [eax]
mov dl, byte [edi + edx*4 + 1]
mov byte [ecx - 2], dl
xor edx, edx
mov dl, byte [eax]
inc ebp
inc eax
mov dl, byte [edi + edx*4]
mov byte [ecx - 1], dl
mov edx, dword [esi]
cmp ebp, edx
jl 0x456af4
mov edx, dword [esp + 0x6c]
mov ebp, dword [ebx]
inc edx
cmp edx, ebp
mov dword [esp + 0x6c], edx
jl 0x456aec
push edi
call sub.MFC42.DLL_operatordelete
mov eax, dword [esp + 0x14]
push eax
call sub.MFC42.DLL_operatordelete
add esp, 8
mov ecx, dword [esp + 0x28]
test ecx, ecx
je 0x456b6c
mov al, byte [ecx - 1]
test al, al
je 0x456b62
cmp al, 0xff
je 0x456b62
dec al
mov byte [ecx - 1], al
mov eax, dword [esp + 0x70]
jmp 0x4569ab
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov eax, dword [esp + 0x70]
jmp 0x4569ab