Function at 0x4a0650
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov eax, dword [0x79a200]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
xor ebx, ebx
push edi
push 0x776078
push eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
call fcn.006a0187
mov edi, eax
add esp, 8
mov dword [ebp - 0x14], edi
test edi, edi
jne 0x4a06c4
push dword [ebp - 0x20]
call fcn.006ac20b
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0068d76f
mov esp, ebp
pop ebp
ret
push edi
call fcn.006a7d39
add esp, 4
cmp eax, 0x50
jne 0x4a09a5
push edi
call fcn.006a7d39
add esp, 4
cmp eax, 0x35
jne 0x4a09a5
jmp 0x4a06f0
mov edi, dword [ebp - 0x14]
nop dword [eax]
cmp ebx, 3
jge 0x4a078f
push edi
call fcn.006a7d39
mov edi, eax
add esp, 4
cmp edi, 0xffffffff
je 0x4a09a2
cmp edi, 0x23
jne 0x4a071b
mov dword [ebp - 0x1c], 1
jmp 0x4a06ea
cmp edi, 0xa
jne 0x4a0729
mov dword [ebp - 0x1c], 0
jmp 0x4a072f
cmp dword [ebp - 0x1c], 0
jne 0x4a06ea
push edi
call fcn.006ab3a0
add esp, 4
test eax, eax
je 0x4a0745
mov dword [ebp - 0x18], 1
jmp 0x4a074b
cmp dword [ebp - 0x18], 0
je 0x4a06ea
push edi
call fcn.006ab3a0
add esp, 4
test eax, eax
je 0x4a076e
mov eax, dword [ebp + ebx*4 - 0x10]
lea eax, [eax + eax*4]
lea eax, [eax - 0x18]
lea eax, [edi + eax*2]
mov dword [ebp + ebx*4 - 0x10], eax
jmp 0x4a06ea
push edi
call fcn.006ab550
mov edi, dword [ebp - 0x14]
add esp, 4
test eax, eax
je 0x4a09a5
mov dword [ebp - 0x18], 0
inc ebx
jmp 0x4a06f0
movzx ecx, word [esi + 0x66b6]
cmp dword [ebp - 0x10], ecx
jne 0x4a0998
movzx eax, word [esi + 0x66b4]
cmp dword [ebp - 0xc], eax
jne 0x4a0998
cmp dword [ebp - 8], 0xffff
jne 0x4a0998
push 2
push ecx
call fcn.0069babe
mov ebx, eax
push str.subtract__
push ebx
push esi
mov dword [ebp - 0x20], ebx
call fcn.004925a0
xor edi, edi
xor eax, eax
add esp, 0x14
mov dword [ebp - 0x1c], edi
cmp ax, word [esi + 0x66b4]
jae 0x4a096c
nop dword [eax]
push dword [ebp - 0x14]
movzx eax, word [esi + 0x66b6]
push eax
push 2
push ebx
call fcn.006a7c38
xor ebx, ebx
xor eax, eax
add esp, 0x10
mov dword [ebp - 0x24], ebx
cmp ax, word [esi + 0x66b6]
jae 0x4a0956
mov eax, edi
and eax, 7
add eax, eax
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x20]
lea eax, [eax + ebx*2]
mov dword [ebp - 0x2c], eax
movzx eax, word [eax]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, word [esi + 0x66bc]
mov edx, dword [ebp - 0x1c]
movzx edi, ax
mov eax, ebx
mov ebx, dword [esi + 0x65b0]
and eax, 1
add eax, dword [ebp - 0x34]
add eax, eax
sar edx, cl
mov dword [ebp - 0x30], eax
mov eax, dword [esi + 0x66e0]
mov dword [ebp - 0x18], eax
movzx eax, word [esi + 0x66c0]
imul edx, eax
mov eax, dword [ebp - 0x24]
sar eax, cl
mov ecx, dword [ebp - 0x30]
add edx, eax
mov eax, ebx
shr eax, cl
mov ecx, dword [ebp - 0x18]
and eax, 3
lea eax, [eax + edx*4]
movzx eax, word [ecx + eax*2]
sub eax, edi
test eax, eax
jle 0x4a08f9
mov eax, dword [ebp - 0x2c]
movzx eax, word [eax]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, word [esi + 0x66bc]
movzx edx, word [esi + 0x66c0]
mov ebx, ecx
mov edi, dword [ebp - 0x1c]
mov ebx, dword [esi + 0x65b0]
mov word [ebp - 0x26], ax
mov eax, dword [esi + 0x66e0]
mov dword [ebp - 0x18], eax
mov eax, ecx
mov dword [ebp - 0x38], eax
mov eax, edx
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x24]
sar edi, cl
sar eax, cl
mov ecx, dword [ebp - 0x30]
imul edi, edx
add edi, eax
mov eax, ebx
shr eax, cl
mov ecx, dword [ebp - 0x18]
and eax, 3
lea eax, [eax + edi*4]
mov ax, word [ecx + eax*2]
sub ax, word [ebp - 0x26]
movzx eax, ax
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x38]
jmp 0x4a0911
movzx ecx, word [esi + 0x66c0]
movzx eax, word [esi + 0x66bc]
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], 0
mov edi, dword [ebp - 0x1c]
mov edx, edi
movzx ecx, ax
mov eax, dword [ebp - 0x2c]
sar edx, cl
movzx eax, ax
imul edx, eax
mov eax, dword [ebp - 0x24]
sar eax, cl
mov ecx, dword [ebp - 0x30]
shr ebx, cl
mov ecx, dword [ebp - 0x28]
add edx, eax
and ebx, 3
lea eax, [ebx + edx*4]
mov edx, dword [ebp - 0x18]
mov ebx, dword [ebp - 0x24]
inc ebx
mov dword [ebp - 0x24], ebx
mov word [edx + eax*2], cx
movzx eax, word [esi + 0x66b6]
cmp ebx, eax
jl 0x4a0824
movzx eax, word [esi + 0x66b4]
inc edi
mov ebx, dword [ebp - 0x20]
mov dword [ebp - 0x1c], edi
cmp edi, eax
jl 0x4a07f0
push dword [ebp - 0x14]
call fcn.006a065f
push ebx
call fcn.0069ba2b
add esp, 8
mov dword [esi + 0x65f8], 0
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0068d76f
mov esp, ebp
pop ebp
ret
push dword [ebp - 0x20]
push str._s_has_the_wrong_dimensions__n
jmp 0x4a09ad
mov edi, dword [ebp - 0x14]
push dword [ebp - 0x20]
push str._s_is_not_a_valid_PGM_file__n
push 2
call fcn.006a8221
add esp, 4
push eax
call fcn.0040dea0
push edi
call fcn.006a065f
mov ecx, dword [ebp - 4]
add esp, 0x10
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0068d76f
mov esp, ebp
pop ebp
ret