Function at 0x401050
Capabilities:
Read file on windows
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x52f110
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x78
push ebx
push ebp
push esi
push edi
mov esi, ecx
mov eax, dword [esp + 0x9c]
mov ecx, dword [esp + 0xa0]
xor ebx, ebx
push 0x56a130
mov dword [eax], ebx
mov dword [ecx], ebx
mov ecx, esi
mov dword [esp + 0x94], ebx
call sub.MFC42u.DLL_CString::operator_2
mov edx, dword [esp + 0x98]
push 0x56a1d4
push edx
mov dword [esi + 4], ebx
call dword [sym.imp.MSVCRT.dll__wfopen]
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x401156
lea ecx, [esp + 0x28]
call sub.MFC42u.DLL_CString::CString_3
push str.Cant_open_file_for_reading_:_n
lea ecx, [esp + 0x3c]
mov byte [esp + 0x94], 1
call sub.MFC42u.DLL_CString::CString_2
lea eax, [esp + 0x98]
lea ecx, [esp + 0x38]
push eax
lea edx, [esp + 0x48]
push ecx
push edx
mov byte [esp + 0x9c], 2
call sub.MFC42u.DLL_operator
push eax
lea ecx, [esp + 0x2c]
mov byte [esp + 0x94], 3
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x44]
mov byte [esp + 0x90], 2
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x38]
mov byte [esp + 0x90], 1
call sub.MFC42u.DLL_CString::CString
lea eax, [esp + 0x28]
mov ecx, esi
push eax
call sub.MFC42u.DLL_CString::operator_1
lea ecx, [esp + 0x28]
mov byte [esp + 0x90], bl
call sub.MFC42u.DLL_CString::CString
mov dword [esp + 0x90], 0xffffffff
jmp 0x40195b
mov ebp, dword [sym.imp.MSVCRT.dll_fread]
push edi
push 1
lea ecx, [esp + 0x19]
push 1
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
or ebx, 0xffffffff
inc edx
cmp eax, ebx
mov dword [esi + 4], edx
jne 0x401183
push str.Read_Error_
jmp 0x401943
push edi
push 1
lea edx, [esp + 0x1a]
push 1
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, ebx
mov dword [esi + 4], edx
jne 0x4011a9
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
cmp byte [esp + 0x11], 0x42
jne 0x40193e
cmp byte [esp + 0x12], 0x4d
jne 0x40193e
push edi
mov ebx, 4
push 1
lea eax, [esp + 0x60]
push ebx
push eax
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x4011f0
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea ecx, [esp + 0x20]
push 2
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, 2
cmp eax, 1
mov dword [esi + 4], edx
je 0x40121e
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea edx, [esp + 0x22]
push 2
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, 2
cmp eax, 1
mov dword [esi + 4], edx
je 0x40124c
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea eax, [esp + 0x2c]
push ebx
push eax
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x401278
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea ecx, [esp + 0x64]
push ebx
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x4012a4
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea edx, [esp + 0x7c]
push ebx
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x4012d0
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea eax, [esp + 0x80]
push ebx
push eax
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x4012ff
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea ecx, [esp + 0x88]
push 2
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, 2
cmp eax, 1
mov dword [esi + 4], edx
je 0x401330
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea edx, [esp + 0x8a]
push 2
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, 2
cmp eax, 1
mov dword [esi + 4], edx
je 0x401361
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea eax, [esp + 0x50]
push ebx
push eax
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x40138d
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea ecx, [esp + 0x68]
push ebx
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x4013b9
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea edx, [esp + 0x6c]
push ebx
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x4013e5
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea eax, [esp + 0x70]
push ebx
push eax
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x401411
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea ecx, [esp + 0x34]
push ebx
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x40143d
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
push edi
push 1
lea edx, [esp + 0x74]
push ebx
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
add edx, ebx
cmp eax, 1
mov dword [esi + 4], edx
je 0x401469
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
mov eax, dword [esp + 0x48]
test eax, eax
je 0x401482
push str.This_is_a_compressed_file.
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
jmp 0x401927
mov edx, dword [esp + 0x2c]
mov eax, dword [esp + 0x82]
test edx, edx
jne 0x40149e
mov edx, 1
mov cl, al
shl edx, cl
mov dword [esp + 0x2c], edx
and eax, 0xffff
xor ebx, ebx
dec eax
mov dword [esp + 0x20], ebx
je 0x4014ba
sub eax, 3
je 0x4014ba
sub eax, 4
jne 0x4015bb
lea eax, [edx*4]
push eax
call sub.MFC42u.DLL_operatornew
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [esp + 0x20], ebx
jne 0x4014fa
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov ecx, esi
push str.Out_of_memory
call sub.MFC42u.DLL_CString::operator_2
mov dword [esp + 0x90], 0xffffffff
jmp 0x40195b
mov eax, dword [esp + 0x2c]
mov dword [esp + 0x38], 0
test eax, eax
jle 0x4015bb
lea ecx, [ebx + 1]
mov dword [esp + 0x34], ecx
push edi
push 1
lea edx, [esp + 0x1d]
push 1
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x4015fa
push edi
push eax
push eax
lea eax, [esp + 0x20]
push eax
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x4015fa
push edi
push eax
lea ecx, [esp + 0x1b]
push eax
push ecx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x4015fa
push edi
push eax
lea edx, [esp + 0x1e]
push eax
push edx
call ebp
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x4015fa
mov eax, dword [esp + 0x34]
mov cl, byte [esp + 0x13]
mov dl, byte [esp + 0x14]
mov byte [eax + 1], cl
mov cl, byte [esp + 0x15]
mov byte [eax], dl
mov byte [eax - 1], cl
mov ecx, dword [esp + 0x38]
add eax, 4
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x2c]
inc ecx
cmp ecx, eax
mov dword [esp + 0x38], ecx
jl 0x401515
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x24]
cmp eax, ecx
jle 0x40160c
mov ebp, dword [sym.imp.MSVCRT.dll_fclose]
push edi
call ebp
add esp, 4
mov ecx, esi
push str.Corrupt_palette
call sub.MFC42u.DLL_CString::operator_2
push ebx
call sub.MFC42u.DLL_operatordelete
push edi
call ebp
add esp, 8
mov dword [esp + 0x90], 0xffffffff
jmp 0x40195b
push str.Read_Error_
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
push ebx
jmp 0x4018a7
jge 0x40162e
push edi
push 1
lea edx, [esp + 0x1e]
push 1
push edx
call ebp
mov edx, dword [esi + 4]
mov ecx, dword [esp + 0x34]
add esp, 0x10
inc edx
mov eax, edx
mov dword [esi + 4], edx
cmp eax, ecx
jl 0x40160e
mov ecx, dword [esp + 0x9c]
mov eax, dword [esp + 0x74]
mov edx, dword [esp + 0xa0]
mov dword [esp + 0x30], eax
mov dword [ecx], eax
mov ecx, dword [esp + 0x78]
mov dword [edx], ecx
imul ecx, eax
lea ebp, [eax + eax*2]
lea eax, [ecx + ecx*2]
push eax
mov dword [esp + 0x50], ebp
mov dword [esp + 0x58], ebp
call sub.MFC42u.DLL_operatornew
mov ebx, eax
add esp, 4
test ebx, ebx
mov dword [esp + 0x28], ebx
jne 0x4016b7
push str.Memory_alloc_Failed
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
mov eax, dword [esp + 0x20]
test eax, eax
je 0x40168f
mov edx, eax
push edx
call sub.MFC42u.DLL_operatordelete
add esp, 4
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
lea ecx, [esp + 0x98]
mov dword [esp + 0x90], 0xffffffff
call sub.MFC42u.DLL_CString::CString
mov eax, ebx
jmp 0x401969
mov eax, dword [esp + 0x78]
dec eax
test eax, eax
mov dword [esp + 0x44], eax
jl 0x40167c
imul eax, ebp
neg ebp
lea ecx, [eax + ebx + 1]
mov dword [esp + 0x34], eax
mov dword [esp + 0x54], ebp
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x82]
cmp cx, 0x18
jne 0x401788
mov eax, dword [esp + 0x30]
test eax, eax
jle 0x401735
xor ebx, ebx
mov ebp, eax
push edi
push 3
lea edx, [esp + 0x24]
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 3
jne 0x40172f
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
mov dl, byte [esp + 0x1e]
add eax, ecx
mov cl, byte [esp + 0x1d]
mov byte [eax + ebx], dl
mov dl, byte [esp + 0x1c]
mov byte [eax + ebx + 1], cl
mov byte [eax + ebx + 2], dl
add ebx, 3
dec ebp
jne 0x4016f6
mov eax, dword [esp + 0x4c]
mov ebx, dword [esi + 4]
mov edx, dword [esp + 0x24]
add ebx, eax
mov ecx, ebx
mov dword [esi + 4], ebx
sub ecx, edx
test cl, 3
je 0x401864
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push edi
push 1
lea edx, [esp + 0x1e]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, 1
jne 0x401896
mov ebp, dword [esi + 4]
mov edx, dword [esp + 0x24]
inc ebp
mov eax, ebp
mov dword [esi + 4], ebp
sub eax, edx
test al, 3
jne 0x401758
jmp 0x401864
mov eax, 1
xor ebx, ebx
shl eax, cl
mov byte [esp + 0x3c], bl
mov dword [esp + 0x40], ebx
dec eax
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x30]
cmp eax, ebx
jle 0x401825
mov ebp, dword [esp + 0x38]
mov edx, dword [esp + 0x20]
test ebx, ebx
jg 0x4017de
push edi
push 1
lea ecx, [esp + 0x44]
push 1
push ecx
mov ebx, 8
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
jne 0x4018c6
mov eax, dword [esi + 4]
mov edx, dword [esp + 0x20]
inc eax
mov dword [esi + 4], eax
mov eax, dword [esp + 0x82]
add ebp, 3
and eax, 0xffff
sub ebx, eax
mov eax, dword [esp + 0x3c]
and eax, 0xff
mov cl, bl
shr eax, cl
and eax, dword [esp + 0x50]
mov cl, byte [edx + eax*4]
mov byte [ebp - 2], cl
mov cl, byte [edx + eax*4 + 1]
mov byte [ebp - 3], cl
mov al, byte [edx + eax*4 + 2]
mov ecx, dword [esp + 0x30]
mov byte [ebp - 4], al
mov eax, dword [esp + 0x40]
inc eax
cmp eax, ecx
mov dword [esp + 0x40], eax
jl 0x4017ae
mov ecx, dword [esi + 4]
mov edx, dword [esp + 0x24]
sub ecx, edx
test cl, 3
je 0x401864
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push edi
push 1
lea edx, [esp + 0x1f]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, 1
jne 0x4018fd
mov ebp, dword [esi + 4]
mov edx, dword [esp + 0x24]
inc ebp
mov eax, ebp
mov dword [esi + 4], ebp
sub eax, edx
test al, 3
jne 0x401839
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x54]
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x38]
dec eax
add ebx, ecx
add edx, ecx
mov dword [esp + 0x44], eax
test eax, eax
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], edx
jge 0x4016d9
mov ebx, dword [esp + 0x28]
jmp 0x40167c
push str.Read_Error
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
mov ecx, dword [esp + 0x28]
push ecx
call sub.MFC42u.DLL_operatordelete
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
mov dword [esp + 0x90], 0xffffffff
jmp 0x40195b
push str.Read_Error
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
mov edx, dword [esp + 0x28]
push edx
call sub.MFC42u.DLL_operatordelete
mov eax, dword [esp + 0x24]
push eax
call sub.MFC42u.DLL_operatordelete
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0xc
mov dword [esp + 0x90], 0xffffffff
jmp 0x40195b
push str.Read_Error
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
mov ecx, dword [esp + 0x28]
push ecx
call sub.MFC42u.DLL_operatordelete
mov eax, dword [esp + 0x24]
add esp, 4
test eax, eax
je 0x401927
push eax
call sub.MFC42u.DLL_operatordelete
add esp, 4
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [esp + 0x90], 0xffffffff
jmp 0x40195b
push str.Not_a_valid_BMP_File
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_2
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [esp + 0x90], ebx
lea ecx, [esp + 0x98]
call sub.MFC42u.DLL_CString::CString
xor eax, eax
mov ecx, dword [esp + 0x88]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x84
ret 0xc