Function at 0x4ec1d0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x641a90]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
push 0x628c60
push eax
mov ebx, ecx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], 0
xor edi, edi
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x1c], 0
call fcn.005931b4
mov esi, eax
add esp, 8
mov dword [ebp - 0x14], esi
test esi, esi
jne 0x4ec245
push dword [ebp - 0x20]
call fcn.005992cf
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret 4
push esi
call fcn.00597fff
add esp, 4
cmp eax, 0x50
jne 0x4ec51d
push esi
call fcn.00597fff
add esp, 4
cmp eax, 0x35
jne 0x4ec51d
jmp 0x4ec270
mov esi, dword [ebp - 0x14]
mov edi, edi
cmp edi, 3
jge 0x4ec311
push esi
call fcn.00597fff
mov esi, eax
add esp, 4
cmp esi, 0xffffffff
je 0x4ec308
cmp esi, 0x23
jne 0x4ec297
mov dword [ebp - 0x18], 1
jmp 0x4ec26b
cmp esi, 0xa
jne 0x4ec2a5
mov dword [ebp - 0x18], 0
jmp 0x4ec2ab
cmp dword [ebp - 0x18], 0
jne 0x4ec26b
push esi
call fcn.005977e5
add esp, 4
test eax, eax
je 0x4ec2c1
mov dword [ebp - 0x1c], 1
jmp 0x4ec2c7
cmp dword [ebp - 0x1c], 0
je 0x4ec26b
push esi
call fcn.005977e5
add esp, 4
test eax, eax
je 0x4ec2e7
mov eax, dword [ebp + edi*4 - 0x10]
lea eax, [eax + eax*4]
lea eax, [eax - 0x18]
lea eax, [esi + eax*2]
mov dword [ebp + edi*4 - 0x10], eax
jmp 0x4ec26b
push esi
call fcn.0059786a
mov esi, dword [ebp - 0x14]
add esp, 4
test eax, eax
je 0x4ec51d
mov dword [ebp - 0x1c], 0
inc edi
jmp 0x4ec270
cmp edi, 3
jl 0x4ec51a
movzx ecx, word [ebx + 0x44aa]
cmp dword [ebp - 0x10], ecx
jne 0x4ec4ff
movzx eax, word [ebx + 0x44a8]
cmp dword [ebp - 0xc], eax
jne 0x4ec4ff
cmp dword [ebp - 8], 0xffff
jne 0x4ec4ff
push 2
push ecx
call fcn.00592c0b
add esp, 8
mov edi, eax
mov ecx, ebx
mov dword [ebp - 0x20], edi
push str.subtract__
push edi
call fcn.004dc800
xor esi, esi
xor eax, eax
mov dword [ebp - 0x18], esi
cmp ax, word [ebx + 0x44a8]
jae 0x4ec4be
nop
push dword [ebp - 0x14]
movzx eax, word [ebx + 0x44aa]
push eax
push 2
push edi
call fcn.00595b79
xor edx, edx
xor eax, eax
add esp, 0x10
mov dword [ebp - 0x24], edx
cmp ax, word [ebx + 0x44aa]
jae 0x4ec4ab
mov eax, esi
and eax, 7
add eax, eax
mov dword [ebp - 0x30], eax
mov eax, esi
and eax, 7
add eax, eax
mov dword [ebp - 0x38], eax
mov edi, edi
movzx ecx, word [ebx + 0x44b0]
lea eax, [edi + edx*2]
mov dword [ebp - 0x34], eax
mov edi, esi
movzx eax, word [ebx + 0x44b4]
sar edi, cl
imul edi, eax
mov eax, edx
mov esi, dword [ebx + 0x388]
sar eax, cl
add edi, eax
mov eax, edx
and eax, 1
shl edi, 2
mov dword [ebp - 0x2c], eax
add eax, dword [ebp - 0x38]
add eax, eax
mov dword [ebp - 0x28], eax
mov eax, dword [ebx + 0x44c0]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
movzx eax, word [eax + edx*2]
push eax
call fcn.0045c6a0
mov ecx, dword [ebp - 0x28]
add esp, 4
movzx edx, ax
mov eax, esi
shr eax, cl
mov ecx, dword [ebp - 0x1c]
and eax, 3
add eax, edi
movzx eax, word [ecx + eax*2]
sub eax, edx
test eax, eax
jle 0x4ec477
movzx ecx, word [ebx + 0x44b0]
mov edi, dword [ebp - 0x18]
movzx eax, word [ebx + 0x44b4]
mov esi, dword [ebx + 0x388]
sar edi, cl
imul edi, eax
mov eax, dword [ebp - 0x24]
sar eax, cl
add edi, eax
mov eax, dword [ebx + 0x44c0]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x34]
shl edi, 2
movzx eax, word [eax]
push eax
call fcn.0045c6a0
mov ecx, dword [ebp - 0x28]
add esp, 4
movzx edx, ax
mov eax, esi
shr eax, cl
mov ecx, dword [ebp - 0x1c]
and eax, 3
add eax, edi
movzx eax, word [ecx + eax*2]
sub eax, edx
jmp 0x4ec479
xor eax, eax
mov ecx, dword [ebp - 0x2c]
add ecx, dword [ebp - 0x30]
mov edx, dword [ebp - 0x24]
add ecx, ecx
shr esi, cl
inc edx
mov ecx, dword [ebp - 0x1c]
and esi, 3
add esi, edi
mov dword [ebp - 0x24], edx
mov edi, dword [ebp - 0x20]
mov word [ecx + esi*2], ax
movzx eax, word [ebx + 0x44aa]
mov esi, dword [ebp - 0x18]
cmp edx, eax
jl 0x4ec3b0
movzx eax, word [ebx + 0x44a8]
inc esi
mov dword [ebp - 0x18], esi
cmp esi, eax
jl 0x4ec370
push edi
call fcn.00592c4b
push dword [ebp - 0x14]
call fcn.00593079
push 0x4018
lea eax, [ebx + 0x3dc]
push 0
push eax
call fcn.00595760
add esp, 0x14
mov dword [ebx + 0x3d8], 0
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.005920c1
mov esp, ebp
pop ebp
ret 4
push dword [ebp - 0x20]
push str._s_has_the_wrong_dimensions__n
call fcn.00592f31
add eax, 0x40
push eax
call fcn.0059320e
push dword [ebp - 0x14]
jmp 0x4ec534
mov esi, dword [ebp - 0x14]
push dword [ebp - 0x20]
push str._s_is_not_a_valid_PGM_file__n
call fcn.00592f31
add eax, 0x40
push eax
call fcn.0059320e
push esi
call fcn.00593079
mov ecx, dword [ebp - 4]
add esp, 0x10
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.005920c1
mov esp, ebp
pop ebp
ret 4