Function at 0x100a6470
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 0x100f123c
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 0x100a64c0
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 0x100a67d3
push ebp
call edi
add esp, 4
cmp eax, 0x35
jne 0x100a67d3
mov edi, dword [sym.imp.MSVCRT.dll__isctype]
lea ebx, [esp + 0x20]
cmp dword [esp + 0x10], 3
jge 0x100a65f0
push ebp
call dword [sym.imp.MSVCRT.dll_fgetc]
mov esi, eax
add esp, 4
cmp esi, 0xffffffff
je 0x100a65e5
cmp esi, 0x23
jne 0x100a651d
mov dword [esp + 0x14], 1
jmp 0x100a64ee
cmp esi, 0xa
jne 0x100a652c
mov dword [esp + 0x14], 0
jmp 0x100a6534
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x100a64ee
mov eax, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [eax], 1
jle 0x100a6548
push 4
push esi
call edi
add esp, 8
jmp 0x100a6556
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 0x100a6564
mov dword [esp + 0x18], 1
jmp 0x100a656c
mov eax, dword [esp + 0x18]
test eax, eax
je 0x100a64ee
mov eax, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [eax], 1
jle 0x100a6580
push 4
push esi
call edi
add esp, 8
jmp 0x100a658e
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 0x100a65a2
mov eax, dword [ebx]
lea eax, [eax + eax*4]
lea ecx, [esi + eax*2 - 0x30]
mov dword [ebx], ecx
jmp 0x100a64ee
mov edx, dword [sym.imp.MSVCRT.dll___mb_cur_max]
cmp dword [edx], 1
jle 0x100a65b7
push 8
push esi
call edi
add esp, 8
jmp 0x100a65c4
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 0x100a67cf
mov ecx, dword [esp + 0x10]
mov dword [esp + 0x18], 0
inc ecx
add ebx, 4
mov dword [esp + 0x10], ecx
jmp 0x100a64ee
cmp dword [esp + 0x10], 3
jl 0x100a67cf
mov esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x20]
xor eax, eax
mov ax, word [esi + 0x65fe]
cmp ecx, eax
jne 0x100a67ba
mov ecx, dword [esp + 0x24]
xor edx, edx
mov dx, word [esi + 0x65fc]
cmp ecx, edx
jne 0x100a67ba
cmp dword [esp + 0x28], 0xffff
jne 0x100a67ba
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.1009c4b0
xor ebx, ebx
add esp, 0x14
cmp word [esi + 0x65fc], bx
mov dword [esp + 0x30], ebx
jbe 0x100a6797
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 0x100a677d
mov eax, ebx
mov dword [esp + 0x34], edi
and eax, 7
shl eax, 1
mov dword [esp + 0x18], eax
jmp 0x100a669c
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 0x100a6753
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 0x100a6755
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 0x100a6694
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 0x100a665d
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 0x100a67e3
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