Function at 0x4eb8a0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x551aa8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
xor edi, edi
push 0x5463d4
push eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
call sub.MSVCR100.dll_fopen
mov ebx, eax
add esp, 8
mov dword [ebp - 0x24], ebx
cmp ebx, edi
jne 0x4eb904
mov eax, dword [ebp - 0x20]
push eax
call sub.MSVCR100.dll_perror
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0050bf32
mov esp, ebp
pop ebp
ret
push ebx
call sub.MSVCR100.dll_fgetc
add esp, 4
cmp eax, 0x50
jne 0x4ebb8c
push ebx
call sub.MSVCR100.dll_fgetc
add esp, 4
cmp eax, 0x35
jne 0x4ebb8c
jmp 0x4eb930
cmp dword [ebp - 0x14], 3
jge 0x4eb9d9
push ebx
call sub.MSVCR100.dll_fgetc
mov edi, eax
add esp, 4
cmp edi, 0xffffffff
je 0x4eb9cf
cmp edi, 0x23
jne 0x4eb95c
mov dword [ebp - 0x1c], 1
jmp 0x4eb930
cmp edi, 0xa
jne 0x4eb96a
mov dword [ebp - 0x1c], 0
jmp 0x4eb970
cmp dword [ebp - 0x1c], 0
jne 0x4eb930
push edi
call sub.MSVCR100.dll_isdigit
add esp, 4
test eax, eax
je 0x4eb986
mov dword [ebp - 0x18], 1
jmp 0x4eb98c
cmp dword [ebp - 0x18], 0
je 0x4eb930
push edi
call sub.MSVCR100.dll_isdigit
add esp, 4
test eax, eax
je 0x4eb9af
mov ecx, dword [ebp - 0x14]
mov eax, dword [ebp + ecx*4 - 0x10]
lea ecx, [ebp + ecx*4 - 0x10]
lea edx, [eax + eax*4]
lea eax, [edi + edx*2 - 0x30]
mov dword [ecx], eax
jmp 0x4eb930
push edi
call sub.MSVCR100.dll_isspace
add esp, 4
test eax, eax
je 0x4ebb8c
inc dword [ebp - 0x14]
mov dword [ebp - 0x18], 0
jmp 0x4eb930
cmp dword [ebp - 0x14], 3
jl 0x4ebb8c
movzx eax, word [esi + 0x66b6]
cmp dword [ebp - 0x10], eax
jne 0x4ebb81
movzx ecx, word [esi + 0x66b4]
cmp dword [ebp - 0xc], ecx
jne 0x4ebb81
cmp dword [ebp - 8], 0xffff
jne 0x4ebb81
push 2
push eax
call sub.MSVCR100.dll_calloc
mov edi, eax
push str.subtract__
push edi
push esi
mov dword [ebp - 0x1c], edi
call fcn.004e0cb0
xor edx, edx
add esp, 0x14
mov dword [ebp - 0x14], 0
cmp dx, word [esi + 0x66b4]
jae 0x4ebb57
jmp 0x4eba40
movzx eax, word [esi + 0x66b6]
push ebx
push eax
push 2
push edi
call sub.MSVCR100.dll_fread
xor ecx, ecx
add esp, 0x10
xor ebx, ebx
cmp cx, word [esi + 0x66b6]
jae 0x4ebb3e
mov eax, dword [ebp - 0x14]
and eax, 7
add eax, eax
mov dword [ebp - 0x20], eax
jmp 0x4eba75
mov eax, dword [ebp - 0x20]
movzx ecx, word [esi + 0x66bc]
mov edx, dword [ebp - 0x14]
sar edx, cl
mov edi, ebx
and edi, 1
add edi, eax
movzx eax, word [esi + 0x66c0]
imul edx, eax
mov eax, ebx
sar eax, cl
add edi, edi
mov ecx, edi
add edx, eax
mov eax, dword [esi + 0x65b0]
shr eax, cl
and eax, 3
lea ecx, [eax + edx*4]
mov edx, dword [esi + 0x66e0]
lea eax, [edx + ecx*2]
mov ecx, dword [ebp - 0x1c]
movzx edx, word [ecx + ebx*2]
push edx
mov dword [ebp - 0x18], eax
call dword [sym.imp.WS2_32.dll_ntohs]
mov ecx, dword [ebp - 0x18]
movzx edx, word [ecx]
movzx eax, ax
sub edx, eax
test edx, edx
jle 0x4ebb23
movzx ecx, word [esi + 0x66bc]
mov eax, dword [ebp - 0x14]
movzx edx, word [esi + 0x66c0]
sar eax, cl
imul eax, edx
mov edx, ebx
sar edx, cl
mov ecx, edi
add eax, edx
mov edx, dword [esi + 0x65b0]
shr edx, cl
mov ecx, dword [esi + 0x66e0]
and edx, 3
lea eax, [edx + eax*4]
mov edx, dword [ebp - 0x1c]
lea edi, [ecx + eax*2]
movzx eax, word [edx + ebx*2]
push eax
mov dword [ebp - 0x18], edi
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, ax
movzx eax, word [edi]
sub eax, ecx
jmp 0x4ebb25
xor eax, eax
mov edx, dword [ebp - 0x18]
mov word [edx], ax
movzx eax, word [esi + 0x66b6]
inc ebx
cmp ebx, eax
jl 0x4eba72
mov edi, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x14]
movzx ecx, word [esi + 0x66b4]
mov ebx, dword [ebp - 0x24]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, ecx
jl 0x4eba40
push ebx
call sub.MSVCR100.dll_fclose
push edi
call sub.MSVCR100.dll_free
add esp, 8
pop edi
mov dword [esi + 0x65f8], 0
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0050bf32
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x20]
push edx
push str._s_has_the_wrong_dimensions__n
jmp 0x4ebb95
mov eax, dword [ebp - 0x20]
push eax
push str._s_is_not_a_valid_PGM_file__n
call sub.MSVCR100.dll___iob_func
add eax, 0x40
push eax
call sub.MSVCR100.dll_fprintf
push ebx
call sub.MSVCR100.dll_fclose
mov ecx, dword [ebp - 4]
add esp, 0x10
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0050bf32
mov esp, ebp
pop ebp
ret