Function at 0x455340
Capabilities:
Read file on windows
Write file on windows

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x4d5a42
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
je 0x45575f
mov eax, dword [ebx + 0x58]
test eax, eax
je 0x45575f
mov eax, dword [ebx + 0x68]
test eax, eax
je 0x45575f
mov esi, dword [esp + 0x80]
push 0
lea ecx, [esp + 0x3c]
mov al, byte [esi]
mov byte [esp + 0x3c], al
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 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]
lea ecx, [esp + 0x38]
push edx
push 0
push 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_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov al, byte [ebx + 0x60]
lea esi, [ebx + 0x60]
push 0
lea ecx, [esp + 0x2c]
mov dword [esp + 0x7c], 0
mov byte [esp + 0x2c], al
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 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]
lea ecx, [esp + 0x28]
push edx
push 0
push 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_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
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 [esp + 0x84]
mov byte [esp + 0x78], 1
mov ecx, dword [eax]
push ecx
push 0
push edx
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__::append_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov edi, str..BMP
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str..BMP
lea ecx, [esp + 0x40]
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__::append_char_const___unsigned_int_]
mov eax, dword [sym.imp.MSVCP60.dll_unsigned_int_const_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::npos]
add ebx, 0x50
mov ecx, dword [eax]
push ecx
push 0
push ebx
lea ecx, [esp + 0x34]
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__::append_class_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char___const___unsigned_int__unsigned_int_]
mov edi, str..BMP
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str..BMP
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__::append_char_const___unsigned_int_]
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x455466
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 esi, eax
add esp, 8
test esi, esi
jne 0x4554a9
push 1
lea ecx, [esp + 0x2c]
mov byte [esp + 0x7c], al
call dword [sym.imp.MSVCP60.dll_private:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::_Tidy_bool_]
push 1
lea ecx, [esp + 0x3c]
mov dword [esp + 0x7c], 0xffffffff
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, 0xfffffffe
jmp 0x455761
mov ebp, dword [sym.imp.MSVCRT.dll_fread]
push esi
push 1
lea edx, [esp + 0x20]
push 0xe
push edx
call ebp
push esi
push 1
lea eax, [esp + 0x60]
push 0x28
push eax
call ebp
mov eax, dword [esp + 0x70]
mov ecx, dword [esp + 0x6c]
mov ebx, dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x20
cmp word [esp + 0x56], 0x18
mov edi, eax
mov dword [esp + 0x84], ecx
mov dword [esp + 0x14], edi
jne 0x4555ce
imul eax, ecx
lea ecx, [eax + eax*2]
push ecx
call sub.MFC42.DLL_operatornew
mov ecx, eax
mov eax, edi
imul eax, dword [esp + 0x88]
push esi
mov dword [esp + 0x88], ecx
lea eax, [eax + eax*2]
push eax
push 1
push ecx
mov dword [esp + 0x24], eax
call ebp
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x54]
add esp, 0x18
test eax, eax
jne 0x455535
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 0x4fde9c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
xor edx, edx
add esp, 8
cmp edi, edx
jne 0x455589
mov ecx, dword [esp + 0x2c]
cmp ecx, edx
je 0x455572
mov al, byte [ecx - 1]
test al, al
je 0x455566
cmp al, 0xff
je 0x455566
dec al
mov byte [ecx - 1], al
jmp 0x455572
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
xor edx, edx
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
cmp ecx, edx
jmp 0x45567d
push edi
push 1
lea edx, [esp + 0x20]
push 0xe
push edx
call ebx
push edi
push 1
lea eax, [esp + 0x60]
push 0x28
push eax
call ebx
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0xa0]
push edi
push ecx
push 1
push edx
call ebx
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0xb4]
push eax
call sub.MFC42.DLL_operatordelete
mov edi, dword [esp + 0x4c]
add esp, 0x38
cmp word [esp + 0x56], 8
jne 0x4556fd
mov ecx, dword [esp + 0x68]
lea edx, [ecx*4]
push edx
call sub.MFC42.DLL_operatornew
mov ecx, dword [esp + 0x6c]
push esi
push ecx
push 4
push eax
mov dword [esp + 0x94], eax
call ebp
imul edi, dword [esp + 0x98]
push edi
call sub.MFC42.DLL_operatornew
push esi
push edi
push 1
push eax
mov dword [esp + 0xac], eax
call ebp
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x68]
xor ebp, ebp
add esp, 0x2c
cmp eax, ebp
jne 0x455632
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 0x4fde9c
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 8
cmp esi, ebp
jne 0x4556a9
mov ecx, dword [esp + 0x2c]
cmp ecx, ebp
je 0x45566b
mov al, byte [ecx - 1]
test al, al
je 0x455661
cmp al, 0xff
je 0x455661
dec al
mov byte [ecx - 1], al
jmp 0x45566b
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x30], ebp
mov dword [esp + 0x34], ebp
cmp ecx, ebp
je 0x4556a1
mov al, byte [ecx - 1]
test al, al
je 0x455697
cmp al, 0xff
je 0x455697
dec al
mov byte [ecx - 1], al
or eax, 0xffffffff
jmp 0x455761
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
or eax, 0xffffffff
jmp 0x455761
push esi
push 1
lea edx, [esp + 0x20]
push 0xe
push edx
call ebx
push esi
push 1
lea eax, [esp + 0x60]
push 0x28
push eax
call ebx
mov ecx, dword [esp + 0x88]
mov ebp, dword [esp + 0xa0]
push esi
push ecx
push 4
push ebp
call ebx
push esi
push edi
mov edi, dword [esp + 0xbc]
push 1
push edi
call ebx
add esp, 0x40
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
push ebp
call sub.MFC42.DLL_operatordelete
push edi
call sub.MFC42.DLL_operatordelete
add esp, 0xc
mov ecx, dword [esp + 0x2c]
xor esi, esi
cmp ecx, esi
je 0x455723
mov al, byte [ecx - 1]
test al, al
je 0x455719
cmp al, 0xff
je 0x455719
dec al
mov byte [ecx - 1], al
jmp 0x455723
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov ecx, dword [esp + 0x3c]
mov dword [esp + 0x2c], esi
cmp ecx, esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], esi
je 0x455758
mov al, byte [ecx - 1]
test al, al
je 0x45574e
cmp al, 0xff
je 0x45574e
dec al
mov byte [ecx - 1], al
mov eax, 2
jmp 0x455761
dec ecx
push ecx
call sub.MFC42.DLL_operatordelete
add esp, 4
mov eax, 2
jmp 0x455761
xor eax, eax
mov ecx, dword [esp + 0x70]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x6c
ret 8