Function at 0x4010f0
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x41103b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x7c
push ebx
push esi
push edi
mov esi, ecx
mov eax, dword [esp + 0x9c]
mov ecx, dword [esp + 0xa0]
xor ebx, ebx
mov dword [eax], ebx
mov dword [ecx], ebx
push 0x4124ac
mov ecx, esi
mov dword [esp + 0x94], ebx
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
push 0x412550
lea ecx, [esp + 0x9c]
mov dword [esi + 4], ebx
call dword [sym.imp.MFC71.DLL_ATL::CSimpleStringT::operator_char_const_]
push eax
call dword [sym.imp.MSVCR71.dll_fopen]
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x4011d6
lea ecx, [esp + 0x18]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT_3]
lea edx, [esp + 0x98]
push edx
lea eax, [esp + 0x30]
push str.Cant_open_file_for_reading_:_n
push eax
mov byte [esp + 0x9c], 1
call fcn.00401050
add esp, 0xc
push eax
lea ecx, [esp + 0x1c]
mov byte [esp + 0x94], 2
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator]
lea ecx, [esp + 0x2c]
mov byte [esp + 0x90], 1
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x18]
push ecx
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator]
lea ecx, [esp + 0x18]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
lea ecx, [esp + 0x98]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
xor eax, eax
jmp 0x401287
mov ebx, dword [sym.imp.MSVCR71.dll_fread]
push edi
push 1
lea edx, [esp + 0x25]
push 1
push edx
call ebx
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 0xffffffff
mov dword [esi + 4], edx
jne 0x401201
push str.Read_Error_
jmp 0x401952
push edi
push 1
lea eax, [esp + 0x26]
push 1
push eax
call ebx
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 0xffffffff
mov dword [esi + 4], edx
jne 0x401229
push str.Read_Error_
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
cmp byte [esp + 0x1d], 0x42
jne 0x40194d
cmp byte [esp + 0x1e], 0x4d
jne 0x40194d
push ebp
push edi
push 1
mov ebp, 4
lea ecx, [esp + 0x7c]
push ebp
push ecx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
je 0x4012a1
push str.Read_Error_
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 4
lea ecx, [esp + 0x9c]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x88]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x88
ret 0xc
push edi
push 1
lea edx, [esp + 0x60]
push 2
push edx
call ebx
mov edx, dword [esi + 4]
add edx, 2
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea eax, [esp + 0x5c]
push 2
push eax
call ebx
mov edx, dword [esi + 4]
add edx, 2
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea ecx, [esp + 0x2c]
push ebp
push ecx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea edx, [esp + 0x90]
push ebp
push edx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea eax, [esp + 0x68]
push ebp
push eax
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea ecx, [esp + 0x6c]
push ebp
push ecx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea edx, [esp + 0x74]
push 2
push edx
call ebx
mov edx, dword [esi + 4]
add edx, 2
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea eax, [esp + 0x76]
push 2
push eax
call ebx
mov edx, dword [esi + 4]
add edx, 2
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea ecx, [esp + 0x58]
push ebp
push ecx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea edx, [esp + 0x84]
push ebp
push edx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea eax, [esp + 0x8c]
push ebp
push eax
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea ecx, [esp + 0x80]
push ebp
push ecx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea edx, [esp + 0x3c]
push ebp
push edx
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
push edi
push eax
lea eax, [esp + 0x88]
push ebp
push eax
call ebx
mov edx, dword [esi + 4]
add edx, ebp
add esp, 0x10
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401260
mov eax, dword [esp + 0x50]
test eax, eax
je 0x401467
push str.This_is_a_compressed_file.
jmp 0x401265
mov edx, dword [esp + 0x34]
test edx, edx
mov eax, dword [esp + 0x6e]
jne 0x401480
mov edx, 1
mov cl, al
shl edx, cl
mov dword [esp + 0x34], edx
movzx eax, ax
dec eax
mov dword [esp + 0x14], 0
je 0x40149b
sub eax, 3
je 0x40149b
sub eax, ebp
jne 0x40158b
lea ecx, [edx*4]
push ecx
call sub.MFC71.DLL_operator_new_1
add esp, 4
test eax, eax
mov dword [esp + 0x14], eax
jne 0x4014cf
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 4
push str.Out_of_memory
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
jmp 0x401277
mov eax, dword [esp + 0x34]
test eax, eax
mov dword [esp + 0x28], 0
jle 0x40158b
mov ebp, dword [esp + 0x14]
inc ebp
push edi
push 1
lea edx, [esp + 0x22]
push 1
push edx
call ebx
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x4015c8
push edi
push eax
push eax
lea eax, [esp + 0x2f]
push eax
call ebx
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x4015ee
push edi
push eax
push eax
lea ecx, [esp + 0x1f]
push ecx
call ebx
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x401604
push edi
push eax
push eax
lea edx, [esp + 0x27]
push edx
call ebx
mov edx, dword [esi + 4]
add esp, 0x10
inc edx
cmp eax, 1
mov dword [esi + 4], edx
jne 0x40162a
mov al, byte [esp + 0x13]
mov cl, byte [esp + 0x23]
mov dl, byte [esp + 0x1a]
mov byte [ebp + 1], al
mov eax, dword [esp + 0x28]
mov byte [ebp], cl
mov byte [ebp - 1], dl
mov ecx, dword [esp + 0x34]
inc eax
add ebp, 4
cmp eax, ecx
mov dword [esp + 0x28], eax
jl 0x4014e8
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x24]
cmp eax, ecx
jle 0x401650
mov ebx, dword [sym.imp.MSVCR71.dll_fclose]
push edi
call ebx
add esp, 4
push str.Corrupt_palette
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov ecx, dword [esp + 0x14]
push ecx
call sub.MFC71.DLL_operator_delete_1
push edi
call ebx
add esp, 8
jmp 0x401277
push str.Read_Error_
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov eax, dword [esp + 0x14]
push eax
call sub.MFC71.DLL_operator_delete_1
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 8
jmp 0x401277
push str.Read_Error_
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov ecx, dword [esp + 0x14]
jmp 0x4018d4
push str.Read_Error_
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov edx, dword [esp + 0x14]
push edx
call sub.MFC71.DLL_operator_delete_1
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 8
jmp 0x401277
push str.Read_Error_
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov eax, dword [esp + 0x14]
push eax
call sub.MFC71.DLL_operator_delete_1
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 8
jmp 0x401277
jge 0x401672
push edi
push 1
lea edx, [esp + 0x23]
push 1
push edx
call ebx
mov edx, dword [esi + 4]
mov ecx, dword [esp + 0x34]
add esp, 0x10
inc edx
mov eax, edx
cmp eax, ecx
mov dword [esi + 4], edx
jl 0x401652
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0xa0]
mov edx, dword [esp + 0xa4]
mov dword [ecx], eax
mov ecx, dword [esp + 0x64]
mov dword [edx], ecx
imul ecx, eax
lea ebx, [eax + eax*2]
mov dword [esp + 0x3c], eax
lea eax, [ecx + ecx*2]
push eax
mov dword [esp + 0x4c], ebx
mov dword [esp + 0x44], ebx
call sub.MFC71.DLL_operator_new_1
mov ebp, eax
add esp, 4
test ebp, ebp
mov dword [esp + 0x1c], ebp
jne 0x4016f0
push str.Memory_alloc_Failed
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4016d2
push eax
call sub.MFC71.DLL_operator_delete_1
add esp, 4
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 4
lea ecx, [esp + 0x9c]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
mov eax, ebp
jmp 0x401286
mov eax, dword [esp + 0x64]
dec eax
mov dword [esp + 0x30], eax
js 0x4016c1
imul eax, ebx
neg ebx
lea ecx, [eax + ebp + 1]
mov dword [esp + 0x38], eax
mov dword [esp + 0x40], ebx
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x6e]
cmp cx, 0x18
jne 0x4017c2
mov eax, dword [esp + 0x3c]
test eax, eax
jle 0x40176f
xor ebx, ebx
mov ebp, eax
lea ebx, [ebx]
push edi
push 3
lea edx, [esp + 0x34]
push 1
push edx
call dword [sym.imp.MSVCR71.dll_fread]
add esp, 0x10
cmp eax, 3
jne 0x401769
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x38]
mov dl, byte [esp + 0x2e]
add eax, ecx
mov cl, byte [esp + 0x2d]
mov byte [eax + ebx], dl
mov dl, byte [esp + 0x2c]
mov byte [eax + ebx + 1], cl
mov byte [eax + ebx + 2], dl
add ebx, 3
dec ebp
jne 0x401730
mov ebx, dword [esi + 4]
mov eax, dword [esp + 0x48]
mov edx, dword [esp + 0x24]
add ebx, eax
mov ecx, ebx
sub ecx, edx
test cl, 3
mov dword [esi + 4], ebx
je 0x401891
mov ebx, dword [sym.imp.MSVCR71.dll_fread]
push edi
push 1
lea edx, [esp + 0x23]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, 1
jne 0x4018c3
mov ebp, dword [esi + 4]
mov edx, dword [esp + 0x24]
inc ebp
mov eax, ebp
sub eax, edx
test al, 3
mov dword [esi + 4], ebp
jne 0x401792
jmp 0x401891
mov eax, 1
shl eax, cl
xor ebx, ebx
mov byte [esp + 0x13], bl
mov dword [esp + 0x44], ebx
dec eax
mov dword [esp + 0x4c], eax
cmp dword [esp + 0x3c], ebx
jle 0x401854
mov ebp, dword [esp + 0x28]
mov edx, dword [esp + 0x14]
test ebx, ebx
jg 0x401816
push edi
push 1
lea ecx, [esp + 0x1b]
push 1
push ecx
mov ebx, 8
call dword [sym.imp.MSVCR71.dll_fread]
add esp, 0x10
cmp eax, 1
jne 0x4018e9
mov eax, dword [esi + 4]
mov edx, dword [esp + 0x14]
inc eax
mov dword [esi + 4], eax
movzx eax, word [esp + 0x6e]
sub ebx, eax
movzx eax, byte [esp + 0x13]
mov cl, bl
shr eax, cl
mov ecx, dword [esp + 0x4c]
add ebp, 3
and eax, ecx
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 + 0x3c]
mov byte [ebp - 4], al
mov eax, dword [esp + 0x44]
inc eax
cmp eax, ecx
mov dword [esp + 0x44], eax
jl 0x4017e6
mov ecx, dword [esi + 4]
sub ecx, dword [esp + 0x24]
test cl, 3
je 0x401891
mov ebx, dword [sym.imp.MSVCR71.dll_fread]
push edi
push 1
lea edx, [esp + 0x22]
push 1
push edx
call ebx
add esp, 0x10
cmp eax, 1
jne 0x401919
mov ebp, dword [esi + 4]
mov edx, dword [esp + 0x24]
inc ebp
mov eax, ebp
sub eax, edx
test al, 3
mov dword [esi + 4], ebp
jne 0x401866
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x40]
mov ebx, dword [esp + 0x38]
mov edx, dword [esp + 0x28]
dec eax
add ebx, ecx
add edx, ecx
test eax, eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x38], ebx
mov dword [esp + 0x28], edx
jge 0x401710
mov ebp, dword [esp + 0x1c]
jmp 0x4016c1
push str.Read_Error
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov ecx, dword [esp + 0x1c]
push ecx
call sub.MFC71.DLL_operator_delete_1
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 8
jmp 0x401277
push str.Read_Error
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov edx, dword [esp + 0x1c]
push edx
call sub.MFC71.DLL_operator_delete_1
mov eax, dword [esp + 0x18]
push eax
call sub.MFC71.DLL_operator_delete_1
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 0xc
jmp 0x401277
push str.Read_Error
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
mov ecx, dword [esp + 0x1c]
push ecx
call sub.MFC71.DLL_operator_delete_1
mov eax, dword [esp + 0x18]
add esp, 4
test eax, eax
je 0x40126d
push eax
call sub.MFC71.DLL_operator_delete_1
add esp, 4
jmp 0x40126d
push str.Not_a_valid_BMP_File
mov ecx, esi
call dword [sym.imp.MFC71.DLL_ATL::CStringT::operator_1]
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 4
lea ecx, [esp + 0x98]
call dword [sym.imp.MFC71.DLL_ATL::CStringT::CStringT]
xor eax, eax
jmp 0x401287