Function at 0x409560
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x43c030]
xor eax, ebp
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0xc]
push eax
call fcn.00419ca7
add esp, 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0x50
je 0x40959e
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00419c57
add esp, 4
test eax, eax
je 0x40959c
xor eax, eax
jmp 0x4097c8
jmp 0x409570
mov edx, dword [ebp + 0xc]
push edx
call fcn.00419ca7
add esp, 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0x34
je 0x4095d0
push str.not_a_binary_pbm_file._n
call fcn.0041501a
add eax, 0x40
push eax
call fcn.00414e84
add esp, 8
xor eax, eax
jmp 0x4097c8
mov dword [ebp - 0x34], 0
mov dword [ebp - 4], 0
cmp dword [ebp - 0x34], 2
jge 0x409729
mov eax, dword [ebp + 0xc]
push eax
call fcn.00419ca7
add esp, 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0x20
je 0x40960f
cmp dword [ebp - 0x38], 9
je 0x40960f
cmp dword [ebp - 0x38], 0xd
je 0x40960f
cmp dword [ebp - 0x38], 0xa
jne 0x409611
jmp 0x4095de
cmp dword [ebp - 0x38], 0x23
jne 0x409630
mov ecx, dword [ebp + 0xc]
push ecx
call fcn.00419ca7
add esp, 4
mov dword [ebp - 0x38], eax
cmp dword [ebp - 0x38], 0xa
je 0x40962e
jmp 0x409617
jmp 0x4095de
cmp dword [ebp - 0x38], 0xffffffff
jne 0x409653
push str.end_of_file_parsing_pbm_header_n
call fcn.0041501a
add eax, 0x40
push eax
call fcn.00414e84
add esp, 8
xor eax, eax
jmp 0x4097c8
mov edx, dword [ebp - 0x38]
push edx
call fcn.004197ef
add esp, 4
test eax, eax
je 0x409724
mov eax, dword [ebp - 4]
mov cl, byte [ebp - 0x38]
mov byte [ebp + eax - 0x30], cl
mov edx, dword [ebp - 4]
add edx, 1
mov dword [ebp - 4], edx
mov eax, dword [ebp + 0xc]
push eax
call fcn.00419ca7
add esp, 4
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x38]
push ecx
call fcn.004197ef
add esp, 4
test eax, eax
je 0x4096d1
cmp dword [ebp - 4], 0x20
jl 0x4096bc
push str.pbm_parsing_error_n
call fcn.0041501a
add eax, 0x40
push eax
call fcn.00414e84
add esp, 8
xor eax, eax
jmp 0x4097c8
mov edx, dword [ebp - 4]
mov al, byte [ebp - 0x38]
mov byte [ebp + edx - 0x30], al
mov ecx, dword [ebp - 4]
add ecx, 1
mov dword [ebp - 4], ecx
jmp 0x40967a
mov edx, dword [ebp - 4]
mov byte [ebp + edx - 0x30], 0
mov eax, dword [ebp - 0x34]
lea ecx, [ebp + eax*4 - 0xc]
push ecx
push 0x439c3c
lea edx, [ebp - 0x30]
push edx
call fcn.004194f8
add esp, 0xc
cmp eax, 1
je 0x409714
push str.couldnt_read_pbm_image_dimensions_n
call fcn.0041501a
add eax, 0x40
push eax
call fcn.00414e84
add esp, 8
xor eax, eax
jmp 0x4097c8
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x34]
add eax, 1
mov dword [ebp - 0x34], eax
jmp 0x4095de
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp + 8]
push eax
call fcn.004010cd
add esp, 0xc
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jne 0x409768
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0xc]
push edx
push str.could_not_allocate__dx_d_image_for_pbm_file_n
call fcn.0041501a
add eax, 0x40
push eax
call fcn.00414e84
add esp, 0x10
xor eax, eax
jmp 0x4097c8
mov eax, dword [ebp + 0xc]
push eax
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x3c]
mov eax, dword [ecx + 4]
imul eax, dword [edx + 8]
push eax
push 1
mov ecx, dword [ebp - 0x3c]
mov edx, dword [ecx + 0xc]
push edx
call fcn.0041946d
add esp, 0x10
mov eax, dword [ebp + 0xc]
push eax
call fcn.00419c57
add esp, 4
test eax, eax
je 0x4097c5
push str.unexpected_end_of_pbm_file._n
call fcn.0041501a
add eax, 0x40
push eax
call fcn.00414e84
add esp, 8
mov ecx, dword [ebp - 0x3c]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.00401172
add esp, 8
xor eax, eax
jmp 0x4097c8
mov eax, dword [ebp - 0x3c]
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00415a74
mov esp, ebp
pop ebp
ret