Function at 0x401370
Capabilities:
Read file on windows

Disassembly:
mov eax, dword [0x40c990]
push ebp
xor ebp, ebp
cmp eax, ebp
jne 0x401392
mov eax, dword [0x40c948]
cmp dword [eax + 0x5c], ebp
jne 0x40138b
lea eax, [ebp + 8]
jmp 0x40138e
mov eax, dword [eax + 0x34]
cmp eax, ebp
je 0x401396
xor al, al
pop ebp
ret
mov eax, dword [0x40c954]
push esi
push edi
mov edi, dword [sym.imp.MSVCR90.dll_fread]
push eax
push 1
push 0xe
push 0x40c994
mov dword [0x40c94c], ebp
call edi
add esp, 0x10
cmp eax, 1
je 0x4013e2
mov esi, dword [0x40c948]
push 0xe
push str.Error_incomplete_reading_of__u_BMP_header_bytes._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0xa
xor al, al
pop ebp
ret
mov ax, word [0x40c994]
mov ecx, 0x4d42
cmp ax, cx
je 0x40141a
mov esi, dword [0x40c948]
movzx edx, ax
push ecx
push edx
push str.Invalid_BMP_header_filetype_0x_04x__expecting_0x_04x._n
call fcn.004074a0
add esp, 0xc
pop edi
pop esi
mov dword [0x40c990], 0xb
xor al, al
pop ebp
ret
mov eax, dword [0x40c954]
push eax
call dword [sym.imp.MSVCR90.dll__fileno]
push eax
call dword [sym.imp.MSVCR90.dll__filelength]
add esp, 8
cmp eax, 0xffffffff
jne 0x401458
mov esi, dword [0x40c948]
push str.Could_not_get_BMP_input_file_size._n
call fcn.004074a0
add esp, 4
pop edi
pop esi
mov dword [0x40c990], 0xc
xor al, al
pop ebp
ret
mov ecx, dword [0x40c996]
cmp eax, ecx
je 0x401487
mov esi, dword [0x40c948]
push eax
push ecx
push str.BMP_file_size_of__d_bytes_should_be__d._n
call fcn.004074a0
add esp, 0xc
pop edi
pop esi
mov dword [0x40c990], 0xd
xor al, al
pop ebp
ret
mov ax, word [0x40c99a]
cmp ax, bp
je 0x4014b9
mov esi, dword [0x40c948]
movzx ecx, ax
push ecx
push str.Invalid_BMP_reserved_field_1_value__d__expecting_0._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0xe
xor al, al
pop ebp
ret
mov ax, word [0x40c99c]
cmp ax, bp
je 0x4014eb
mov esi, dword [0x40c948]
movzx edx, ax
push edx
push str.Invalid_BMP_reserved_field_2_value__d__expecting_0._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0xf
xor al, al
pop ebp
ret
mov eax, dword [0x40c954]
push eax
push 1
push 0x28
push 0x40c95c
call edi
add esp, 0x10
cmp eax, 1
je 0x401529
mov esi, dword [0x40c948]
push 0x28
push str.Error_incomplete_reading__u_BMP_information_header_bytes._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0x10
xor al, al
pop ebp
ret
mov eax, dword [0x40c95c]
cmp eax, 0x28
je 0x401559
mov esi, dword [0x40c948]
push 0x28
push eax
push str.Invalid_BMP_information_size_value__d__expecting__u._n
call fcn.004074a0
add esp, 0xc
pop edi
pop esi
mov dword [0x40c990], 0x11
xor al, al
pop ebp
ret
mov esi, dword [0x40c960]
cmp esi, 1
jge 0x401588
push esi
mov esi, dword [0x40c948]
push str.Invalid_BMP_image_width_of__d__expecting_a_value___1._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0x13
xor al, al
pop ebp
ret
mov ecx, dword [0x40c964]
cmp ecx, ebp
jne 0x4015b5
mov esi, dword [0x40c948]
push str.Invalid_BMP_image_height_of_0_expecting_a_non_zero_value._n
call fcn.004074a0
add esp, 4
pop edi
pop esi
mov dword [0x40c990], 0x14
xor al, al
pop ebp
ret
mov ax, word [0x40c968]
cmp ax, 1
je 0x4015e8
mov esi, dword [0x40c948]
movzx ecx, ax
push ecx
push str.Invalid_BMP_number_of_planes_value__d__expecting_1._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0x15
xor al, al
pop ebp
ret
mov ax, word [0x40c96a]
cmp ax, 0x18
je 0x401621
cmp ax, 4
je 0x401621
mov esi, dword [0x40c948]
movzx edx, ax
push edx
push str.Unhandled_BMP_bits_per_pixel_value__d__expecting_24._n
call fcn.004074a0
add esp, 8
pop edi
pop esi
mov dword [0x40c990], 0x16
xor al, al
pop ebp
ret
push ebx
mov ebx, dword [0x40c96c]
cmp ebx, ebp
je 0x401657
cmp ebx, 2
je 0x401657
mov esi, dword [0x40c948]
push ebp
push ebx
push str.Unhandled_BMP_compression_method_value__d__expecting__d._n
call fcn.004074a0
add esp, 0xc
pop ebx
pop edi
pop esi
mov dword [0x40c990], 0x17
xor al, al
pop ebp
ret
mov eax, esi
neg eax
neg eax
and eax, 3
mov dword [0x40c950], eax
cmp ebx, ebp
jne 0x40168c
mov edi, dword [0x40c970]
cmp edi, ebp
jne 0x4016bf
cmp ecx, ebp
jge 0x401679
neg ecx
lea eax, [eax + esi*2]
add eax, esi
imul eax, ecx
mov dword [0x40c970], eax
mov edi, dword [sym.imp.MSVCR90.dll_fread]
mov eax, dword [0x40c97c]
cmp eax, ebp
je 0x401704
cmp eax, 0x10
jbe 0x401704
mov esi, dword [0x40c948]
push eax
push str.Invalid_BMP_number_of_colors_value__d__expecting_0._n
call fcn.004074a0
add esp, 8
pop ebx
pop edi
pop esi
mov dword [0x40c990], 0x19
xor al, al
pop ebp
ret
cmp ecx, ebp
mov edx, ecx
jge 0x4016c7
neg edx
lea eax, [eax + esi*2]
add eax, esi
mov esi, eax
imul esi, edx
cmp edi, esi
je 0x401686
cmp ecx, ebp
jge 0x4016db
neg ecx
mov esi, dword [0x40c948]
imul eax, ecx
push eax
push edi
push str.Invalid_BMP_size_of_bitmap_value__d_should_be__d__height_x__width_x_3__pad_._n
call fcn.004074a0
add esp, 0xc
pop ebx
pop edi
pop esi
mov dword [0x40c990], 0x18
xor al, al
pop ebp
ret
mov eax, dword [0x40c980]
cmp eax, ebp
je 0x401737
cmp eax, 0x10
jbe 0x401737
mov esi, dword [0x40c948]
push eax
push str.Invalid_BMP_palette_colors_value__d__expecting_0._n
call fcn.004074a0
add esp, 8
pop ebx
pop edi
pop esi
mov dword [0x40c990], 0x1a
xor al, al
pop ebp
ret
mov esi, dword [0x40c99e]
add esi, 0xffffffca
cmp ebx, 2
jne 0x40178a
mov ecx, dword [0x40c954]
mov edx, dword [0x40c98c]
push ecx
push 1
push 0x40
push edx
call edi
add esp, 0x10
cmp eax, 1
je 0x401787
mov esi, dword [0x40c948]
push 0x40
push str.Error_reading__u_BMP_color_table_bytes._n
call fcn.004074a0
add esp, 8
pop ebx
pop edi
pop esi
mov dword [0x40c990], 0x1b
xor al, al
pop ebp
ret
sub esi, 0x40
mov eax, dword [0x40c988]
cmp eax, ebp
je 0x40179b
cmp esi, dword [0x40c984]
ja 0x40179f
cmp esi, ebp
jne 0x4017b5
push eax
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 4
xor eax, eax
mov dword [0x40c988], eax
mov dword [0x40c984], ebp
cmp dword [0x40c99e], 0x36
je 0x401865
mov dword [0x40c984], esi
cmp eax, ebp
jne 0x401808
push esi
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
add esp, 4
mov dword [0x40c988], eax
cmp eax, ebp
jne 0x401808
mov eax, dword [0x40c984]
mov esi, dword [0x40c948]
push eax
push str.Extra_BMP_header_buffer_allocation_of__d_bytes_failed._n
call fcn.004074a0
add esp, 8
pop ebx
pop edi
pop esi
mov dword [0x40c990], 0x1c
xor al, al
pop ebp
ret
mov ecx, dword [0x40c954]
mov edx, dword [0x40c984]
push ecx
push 1
push edx
push eax
call edi
add esp, 0x10
cmp eax, 1
je 0x401865
mov eax, dword [0x40c984]
mov esi, dword [0x40c948]
push eax
push str.Error_reading__u_BMP_extra_header_bytes._n
call fcn.004074a0
mov ecx, dword [0x40c988]
push ecx
mov dword [0x40c984], ebp
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 0xc
pop ebx
pop edi
pop esi
mov dword [0x40c988], ebp
mov dword [0x40c990], 0x1d
xor al, al
pop ebp
ret
pop ebx
pop edi
pop esi
mov al, 1
pop ebp
ret