Function at 0x46b530
Capabilities:
Read file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4d6dd4
push eax
mov dword fs:[0], esp
sub esp, 0x60
push ebx
mov ebx, ecx
push ebp
push esi
mov al, byte [ebx + 0x74]
push edi
test al, al
jne 0x46b55c
xor al, al
jmp 0x46b941
mov cl, byte [ebx + 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, [ebx + 0x60]
xor edi, edi
mov byte [esp + 0x38], cl
mov dword [esp + 0x3c], edi
mov dword [esp + 0x40], edi
mov dword [esp + 0x44], edi
mov ecx, dword [edx]
push ecx
push edi
push eax
lea ecx, [esp + 0x44]
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 [ebx + 0x58]
mov dword [esp + 0x78], edi
mov eax, dword [edx]
mov esi, eax
cmp ecx, esi
jae 0x46b5a0
mov esi, ecx
sub eax, dword [esp + 0x40]
cmp eax, esi
ja 0x46b5ae
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
cmp esi, edi
jbe 0x46b5fe
mov eax, dword [esp + 0x40]
push edi
lea ecx, [esp + 0x3c]
lea ebp, [eax + 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 0x46b5fe
mov eax, dword [ebx + 0x54]
cmp eax, edi
jne 0x46b5d5
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 ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x40]
lea edi, [edx + ecx]
mov ecx, esi
mov esi, 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 + 0x3c]
mov dword [esp + 0x40], ebp
mov byte [ecx + ebp], 0
mov edi, str..BMP
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
repne scasb al, byte es:[edi]
mov eax, dword [edx]
mov edx, dword [esp + 0x40]
not ecx
dec ecx
sub eax, edx
mov esi, ecx
cmp eax, esi
ja 0x46b627
call dword [sym.imp.MSVCP60.dll_void___cdecl_std::_Xlen_void_]
test esi, esi
jbe 0x46b66f
mov ecx, dword [esp + 0x40]
push 0
lea ebp, [ecx + esi]
lea ecx, [esp + 0x3c]
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 0x46b66f
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x40]
mov ecx, esi
mov esi, str..BMP
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]
mov eax, dword [esp + 0x3c]
mov dword [esp + 0x40], ebp
mov byte [eax + ebp], 0
mov eax, dword [esp + 0x3c]
test eax, eax
jne 0x46b67c
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
test ebp, ebp
jne 0x46b6cd
push eax
push eax
push 0x4fdf6c
call sub.MFC42.DLL_AfxMessageBox
mov ecx, dword [esp + 0x3c]
test ecx, ecx
je 0x46b6c6
mov al, byte [ecx - 1]
test al, al
je 0x46b6bc
cmp al, 0xff
je 0x46b6bc
dec al
mov byte [ecx - 1], al
xor al, al
jmp 0x46b941
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
xor al, al
jmp 0x46b941
movsx esi, word [ebx + 0x86]
movsx ecx, word [ebx + 0x84]
imul esi, ecx
lea edx, [esi + esi*2 + 4]
push edx
call sub.MFC42.DLL_operatornew
add esp, 4
mov dword [esp + 0x24], eax
test eax, eax
mov byte [esp + 0x78], 1
je 0x46b716
push fcn.004011f0
push 0x471b50
lea edi, [eax + 4]
push esi
push 3
push edi
mov dword [eax], esi
call fcn.004ce784
mov dword [esp + 0x1c], edi
jmp 0x46b71e
mov dword [esp + 0x1c], 0
mov esi, dword [sym.imp.MSVCRT.dll_fread]
push ebp
push 1
lea eax, [esp + 0x30]
push 0xe
push eax
mov byte [esp + 0x88], 0
call esi
push ebp
push 1
lea ecx, [esp + 0x60]
push 0x28
push ecx
call esi
movsx esi, word [ebx + 0x86]
movsx edx, word [ebx + 0x84]
imul esi, edx
mov ecx, dword [esp + 0x6c]
mov eax, dword [esp + 0x70]
mov edx, dword [ebx + 0x80]
add esp, 0x20
cmp word [esp + 0x56], 0x18
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], esi
mov dword [esp + 0x14], edx
jne 0x46b82e
imul eax, ecx
lea eax, [eax + eax*2]
push eax
call sub.MFC42.DLL_operatornew
mov edi, eax
mov eax, dword [esp + 0x1c]
imul eax, dword [esp + 0x14]
push ebp
lea ecx, [eax + eax*2]
push ecx
push 1
push edi
call dword [sym.imp.MSVCRT.dll_fread]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x18
test esi, esi
jle 0x46b825
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x20], esi
fild dword [esp + 0x18]
fild dword [esp + 0x10]
lea ebx, [edx + 1]
mov eax, dword [esp + 0x14]
fld st(1)
fmul dword [eax + 0x14]
call sub.MSVCRT.dll__ftol
mov ecx, dword [esp + 0x14]
mov esi, eax
imul esi, dword [esp + 0x10]
fld st(0)
fmul dword [ecx + 0x10]
call sub.MSVCRT.dll__ftol
add esi, eax
add ebx, 3
lea esi, [esi + esi*2]
mov dl, byte [esi + edi]
mov byte [ebx - 2], dl
mov al, byte [edi + esi + 1]
mov edx, dword [esp + 0x14]
mov byte [ebx - 3], al
mov cl, byte [edi + esi + 2]
mov eax, dword [esp + 0x20]
mov byte [ebx - 4], cl
add edx, 0x18
dec eax
mov dword [esp + 0x14], edx
mov dword [esp + 0x20], eax
jne 0x46b7c8
mov esi, dword [esp + 0x24]
fstp st(0)
fstp st(0)
push edi
call sub.MFC42.DLL_operatordelete
add esp, 4
cmp word [esp + 0x56], 8
jne 0x46b90e
mov edx, dword [esp + 0x68]
lea eax, [edx*4]
push eax
call sub.MFC42.DLL_operatornew
mov ecx, dword [esp + 0x6c]
push ebp
mov ebx, eax
push ecx
push 4
push ebx
call dword [sym.imp.MSVCRT.dll_fread]
mov edi, dword [esp + 0x2c]
imul edi, dword [esp + 0x24]
push edi
call sub.MFC42.DLL_operatornew
push ebp
push edi
push 1
push eax
mov dword [esp + 0x4c], eax
call dword [sym.imp.MSVCRT.dll_fread]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x2c
test esi, esi
jle 0x46b8fb
mov edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x14]
fild dword [esp + 0x18]
fild dword [esp + 0x10]
lea edi, [edx + 1]
lea ebp, [eax + 0x10]
mov dword [esp + 0x20], esi
fld st(1)
fmul dword [ebp + 4]
call sub.MSVCRT.dll__ftol
fld st(0)
fmul dword [ebp]
mov esi, eax
imul esi, dword [esp + 0x10]
call sub.MSVCRT.dll__ftol
add esi, eax
mov eax, dword [esp + 0x24]
xor ecx, ecx
add ebp, 0x18
mov cl, byte [eax + esi]
add edi, 3
mov dl, byte [ebx + ecx*4]
xor ecx, ecx
mov byte [edi - 2], dl
mov cl, byte [eax + esi]
mov dl, byte [ebx + ecx*4 + 1]
xor ecx, ecx
mov byte [edi - 3], dl
mov cl, byte [eax + esi]
mov eax, dword [esp + 0x20]
mov dl, byte [ebx + ecx*4 + 2]
dec eax
mov byte [edi - 4], dl
mov dword [esp + 0x20], eax
jne 0x46b8a2
fstp st(0)
fstp st(0)
push ebx
call sub.MFC42.DLL_operatordelete
mov eax, dword [esp + 0x28]
push eax
call sub.MFC42.DLL_operatordelete
add esp, 8
mov ecx, dword [esp + 0x80]
mov edx, dword [esp + 0x1c]
mov dword [ecx], edx
mov ecx, dword [esp + 0x3c]
test ecx, ecx
je 0x46b93f
mov al, byte [ecx - 1]
test al, al
je 0x46b935
cmp al, 0xff
je 0x46b935
dec al
mov byte [ecx - 1], al
jmp 0x46b93f
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov al, 1
mov ecx, dword [esp + 0x70]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x6c
ret 4