Function at 0x4b0740
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x1c
push ebx
push ebp
push esi
mov esi, dword [esp + 0x30]
push edi
xor edi, edi
push 0x584334
push esi
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], edi
mov dword [esp + 0x18], edi
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
cmp ebp, edi
mov dword [esp + 0x1c], ebp
jne 0x4b0790
push esi
call dword [sym.imp.MSVCRT.dll_perror]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret
mov edi, dword [sym.imp.MSVCRT.dll_fgetc]
push ebp
call edi
add esp, 4
cmp eax, 0x50
jne 0x4b0aa3
push ebp
call edi
add esp, 4
cmp eax, 0x35
jne 0x4b0aa3
mov edi, dword [sym.imp.MSVCRT.dll__isctype]
lea ebx, [esp + 0x20]
cmp dword [esp + 0x10], 3
jge 0x4b08c0
push ebp
call dword [sym.imp.MSVCRT.dll_fgetc]
mov esi, eax
add esp, 4
cmp esi, 0xffffffff
je 0x4b08b5
cmp esi, 0x23
jne 0x4b07ed
mov dword [esp + 0x14], 1
jmp 0x4b07be
cmp esi, 0xa
jne 0x4b07fc
mov dword [esp + 0x14], 0
jmp 0x4b0804
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x4b07be
mov eax, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [eax], 1
jle 0x4b0818
push 4
push esi
call edi
add esp, 8
jmp 0x4b0826
mov ecx, dword [sym.imp.MSVCRT.dll__pctype]
mov edx, dword [ecx]
mov al, byte [edx + esi*2]
and eax, 4
test eax, eax
je 0x4b0834
mov dword [esp + 0x18], 1
jmp 0x4b083c
mov eax, dword [esp + 0x18]
test eax, eax
je 0x4b07be
mov eax, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [eax], 1
jle 0x4b0850
push 4
push esi
call edi
add esp, 8
jmp 0x4b085e
mov ecx, dword [sym.imp.MSVCRT.dll__pctype]
mov edx, dword [ecx]
mov al, byte [edx + esi*2]
and eax, 4
test eax, eax
je 0x4b0872
mov eax, dword [ebx]
lea eax, [eax + eax*4]
lea ecx, [esi + eax*2 - 0x30]
mov dword [ebx], ecx
jmp 0x4b07be
mov edx, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [edx], 1
jle 0x4b0887
push 8
push esi
call edi
add esp, 8
jmp 0x4b0894
mov eax, dword [sym.imp.MSVCRT.dll__pctype]
mov ecx, dword [eax]
mov al, byte [ecx + esi*2]
and eax, 8
test eax, eax
je 0x4b0a9f
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], 0
inc ecx
add ebx, 4
mov dword [esp + 0x10], ecx
jmp 0x4b07be
cmp dword [esp + 0x10], 3
jl 0x4b0a9f
mov esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
xor eax, eax
mov ax, word [esi + 0x65fe]
cmp ecx, eax
jne 0x4b0a8a
mov ecx, dword [esp + 0x24]
xor edx, edx
mov dx, word [esi + 0x65fc]
cmp ecx, edx
jne 0x4b0a8a
cmp dword [esp + 0x28], 0xffff
jne 0x4b0a8a
push 2
push eax
call dword [sym.imp.MSVCRT.dll_calloc]
mov edi, eax
push str.subtract__
push edi
push esi
mov dword [esp + 0x28], edi
call fcn.004a6780
xor ebx, ebx
add esp, 0x14
cmp word [esi + 0x65fc], bx
mov dword [esp + 0x30], ebx
jbe 0x4b0a67
xor eax, eax
push ebp
mov ax, word [esi + 0x65fe]
push eax
push 2
push edi
call dword [sym.imp.MSVCRT.dll_fread]
xor ebp, ebp
add esp, 0x10
cmp word [esi + 0x65fe], bp
jbe 0x4b0a4d
mov eax, ebx
mov dword [esp + 0x34], edi
and eax, 7
shl eax, 1
mov dword [esp + 0x18], eax
jmp 0x4b096c
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x30]
xor ecx, ecx
mov edi, ebp
mov cx, word [esi + 0x6604]
xor edx, edx
mov dx, word [esi + 0x6608]
and edi, 1
sar ebx, cl
add edi, eax
mov eax, ebp
shl edi, 1
sar eax, cl
imul ebx, edx
mov edx, dword [esi + 0x657c]
mov ecx, edi
shr edx, cl
mov ecx, dword [esi + 0x6628]
add ebx, eax
and edx, 3
lea eax, [edx + ebx*4]
mov edx, dword [esp + 0x34]
lea ebx, [ecx + eax*2]
mov ax, word [edx]
push eax
call dword [sym.imp.WS2_32.dll_ntohs]
xor ecx, ecx
and eax, 0xffff
mov cx, word [ebx]
sub ecx, eax
test ecx, ecx
jle 0x4b0a23
mov edx, dword [esp + 0x30]
xor ecx, ecx
mov cx, word [esi + 0x6604]
xor eax, eax
mov ax, word [esi + 0x6608]
sar edx, cl
imul edx, eax
mov eax, ebp
sar eax, cl
mov ecx, edi
add edx, eax
mov eax, dword [esi + 0x657c]
shr eax, cl
and eax, 3
lea ecx, [eax + edx*4]
mov edx, dword [esi + 0x6628]
mov eax, dword [esp + 0x34]
lea ebx, [edx + ecx*2]
mov cx, word [eax]
push ecx
call dword [sym.imp.WS2_32.dll_ntohs]
mov dx, ax
xor eax, eax
mov ax, word [ebx]
and edx, 0xffff
sub eax, edx
jmp 0x4b0a25
xor eax, eax
mov edx, dword [esp + 0x34]
mov word [ebx], ax
xor eax, eax
inc ebp
mov ax, word [esi + 0x65fe]
add edx, 2
cmp ebp, eax
mov dword [esp + 0x34], edx
jl 0x4b0964
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x30]
mov ebp, dword [esp + 0x1c]
xor ecx, ecx
mov cx, word [esi + 0x65fc]
inc ebx
cmp ebx, ecx
mov dword [esp + 0x30], ebx
jl 0x4b092d
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
push edi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 8
mov dword [esi + 0x65c4], 0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret
mov edx, dword [esp + 0x34]
mov eax, dword [sym.imp.MSVCRT.dll__iob]
push edx
add eax, 0x40
push str._s_has_the_wrong_dimensions__n
push eax
jmp 0x4b0ab3
mov esi, dword [esp + 0x34]
mov ecx, dword [sym.imp.MSVCRT.dll__iob]
push esi
add ecx, 0x40
push str._s_is_not_a_valid_PGM_file__n
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x1c
ret