Function at 0x410530
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x18
push ebx
mov ebx, dword [esp + 0x20]
push ebp
push esi
push edi
xor edi, edi
push 0x45ac5c
push ebx
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x18], edi
xor ebp, ebp
call fcn.00435275
mov esi, eax
add esp, 8
mov dword [esp + 0x18], esi
test esi, esi
jne 0x410578
push ebx
call fcn.00433d7c
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret
push esi
call fcn.004361ad
add esp, 4
cmp eax, 0x50
jne 0x4107cc
push esi
call fcn.004361ad
add esp, 4
cmp eax, 0x35
jne 0x4107cc
lea esp, [esp]
cmp ebp, 3
jge 0x410636
push esi
call fcn.004361ad
mov ebx, eax
add esp, 4
cmp ebx, 0xffffffff
je 0x41062d
cmp ebx, 0x23
jne 0x4105c8
mov dword [esp + 0x10], 1
jmp 0x4105a0
cmp ebx, 0xa
jne 0x4105d7
mov dword [esp + 0x10], 0
jmp 0x4105de
cmp dword [esp + 0x10], 0
jne 0x4105a0
push ebx
call fcn.004346ec
add esp, 4
test eax, eax
je 0x4105f2
mov edi, 1
jmp 0x4105f6
test edi, edi
je 0x4105a0
push ebx
call fcn.004346ec
add esp, 4
test eax, eax
je 0x410614
mov eax, dword [esp + ebp*4 + 0x1c]
lea eax, [eax + eax*4]
lea ecx, [ebx + eax*2 - 0x30]
mov dword [esp + ebp*4 + 0x1c], ecx
jmp 0x4105a0
push ebx
call fcn.004347f1
add esp, 4
test eax, eax
je 0x4107cc
xor edi, edi
inc ebp
jmp 0x4105a0
cmp ebp, 3
jl 0x4107cc
movzx eax, word [0x466040]
cmp dword [esp + 0x1c], eax
jne 0x4107c0
movzx edx, word [0x4ac486]
cmp dword [esp + 0x20], edx
jne 0x4107c0
cmp dword [esp + 0x24], 0xffff
jne 0x4107c0
push 2
push eax
call fcn.004348ad
mov ebp, eax
push ebp
mov eax, str.subtract__
call fcn.004010b0
xor ebx, ebx
xor eax, eax
add esp, 0xc
mov dword [esp + 0x10], ebx
cmp ax, word [0x4ac486]
jae 0x4107a5
mov ax, word [0x466040]
lea esp, [esp]
movzx ecx, ax
push esi
push ecx
push 2
push ebp
call fcn.00435763
mov ax, word [0x466040]
xor edx, edx
add esp, 0x10
xor edi, edi
cmp dx, ax
jae 0x410791
mov eax, ebx
and eax, 7
add eax, eax
mov dword [esp + 0x14], eax
jmp 0x4106d4
mov eax, dword [esp + 0x14]
movzx ecx, word [0x4ac426]
sar ebx, cl
mov esi, edi
and esi, 1
add esi, eax
movzx eax, word [0x466104]
imul ebx, eax
mov eax, dword [0x466120]
mov edx, edi
sar edx, cl
add esi, esi
mov ecx, esi
shr eax, cl
add ebx, edx
mov edx, dword [0x4ac418]
and eax, 3
lea ecx, [eax + ebx*4]
movzx eax, word [ebp + edi*2]
push eax
lea ebx, [edx + ecx*2]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx edx, word [ebx]
movzx ecx, ax
sub edx, ecx
test edx, edx
jle 0x410772
movzx ecx, word [0x4ac426]
mov eax, dword [esp + 0x10]
movzx edx, word [0x466104]
sar eax, cl
imul eax, edx
mov edx, edi
sar edx, cl
mov ecx, esi
add eax, edx
mov edx, dword [0x466120]
shr edx, cl
mov ecx, dword [0x4ac418]
and edx, 3
lea eax, [edx + eax*4]
movzx edx, word [ebp + edi*2]
push edx
lea ebx, [ecx + eax*2]
call dword [sym.imp.WS2_32.dll_ntohs]
movzx ecx, ax
movzx eax, word [ebx]
sub eax, ecx
jmp 0x410774
xor eax, eax
mov word [ebx], ax
mov ax, word [0x466040]
mov ebx, dword [esp + 0x10]
movzx edx, ax
inc edi
cmp edi, edx
jl 0x4106d0
mov esi, dword [esp + 0x18]
movzx ecx, word [0x4ac486]
inc ebx
cmp ebx, ecx
mov dword [esp + 0x10], ebx
jl 0x4106a0
push ebp
call fcn.0043481f
add esp, 4
pop edi
pop esi
pop ebp
mov dword [0x4862f4], 0
pop ebx
add esp, 0x18
ret
mov edx, dword [esp + 0x2c]
push edx
push str._s_has_the_wrong_dimensions__n
jmp 0x4107d6
mov eax, dword [esp + 0x2c]
push eax
push str._s_is_not_a_valid_PGM_file__n
call fcn.00434a96
add eax, 0x40
push eax
call fcn.00435780
push esi
call fcn.00436131
add esp, 0x10
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret