Function at 0x425150
Capabilities:
Read file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x15c
mov eax, dword [esp + 0x170]
mov dword [esp + 4], 0x48a441
mov dword [esp], eax
mov dword [esp + 0x2c], ecx
call sub.msvcrt.dll_fopen
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov edi, eax
lea eax, [esp + 0x42]
mov dword [esp + 4], 1
mov dword [esp], eax
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
call sub.msvcrt.dll_fread
cmp eax, 2
jne 0x4251bb
cmp byte [esp + 0x42], 0x50
je 0x4251f0
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov eax, dword [0x4b61c0]
mov dword [esp + 8], str.Malformed_ppm_file
mov dword [esp + 4], str.raw_image::read_ppm
mov dword [esp], eax
call fcn.004256d0
xor eax, eax
add esp, 0x15c
pop ebx
pop esi
pop edi
pop ebp
ret 4
cmp byte [esp + 0x43], 0x36
jne 0x4251bb
xor eax, eax
xor esi, esi
mov ebx, 0x48a440
lea ebp, [esp + 0x51]
lea esi, [esi]
test al, al
jne 0x425218
jmp 0x425250
mov al, byte [ebx + 1]
inc ebx
test al, al
je 0x425250
cmp al, 0x20
jle 0x425210
test al, al
je 0x425250
mov dword [esp], ebx
call sub.msvcrt.dll_atoi
lea edx, [esi + 1]
mov dword [esp + esi*4 + 0x44], eax
mov al, byte [ebx]
sub eax, 0x30
cmp al, 9
ja 0x425243
mov al, byte [ebx + 1]
inc ebx
sub eax, 0x30
cmp al, 9
jbe 0x425238
cmp edx, 3
je 0x42529a
mov esi, edx
mov al, byte [ebx]
jmp 0x425208
mov dword [esp + 8], edi
mov dword [esp + 4], 0xff
mov dword [esp], ebp
call fcn.0041c7d0
test eax, eax
je 0x425270
mov ebx, ebp
mov al, byte [ebx]
jmp 0x425208
mov eax, dword [0x4b61c0]
mov dword [esp + 8], str.Malformed_ppm_file
mov dword [esp + 4], str.raw_image::read_ppm
mov dword [esp], eax
call fcn.004256d0
mov dword [esp], edi
call sub.msvcrt.dll_fclose
jmp 0x4251e0
mov eax, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
mov ebx, dword [esp + 0x44]
mov esi, dword [esp + 0x48]
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], edx
test eax, eax
jle 0x4253c6
test edx, edx
jle 0x4253c6
mov eax, dword [esp + 0x4c]
cmp eax, 0xff
je 0x4252ee
mov dword [esp + 0xc], eax
mov eax, dword [0x4b61c0]
mov dword [esp + 8], str.Heightfield_has_wrong_color_depth__was__d__must_be_255_
mov dword [esp + 4], str.raw_image_t::read_ppm
mov dword [esp], eax
call fcn.00425600
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x30]
imul eax, edx
shl eax, 2
mov ecx, dword [esp + 0x2c]
mov dword [ecx + 8], esi
mov dword [ecx + 4], ebx
mov word [ecx + 0xc], 0x2001
mov dword [esp + 4], eax
mov eax, dword [ecx]
mov esi, ecx
mov dword [esp], eax
call fcn.0041c8c0
xor edx, edx
mov dword [esi], eax
mov cl, byte [esi + 0xd]
mov ebx, dword [esi + 4]
shr cl, 3
xor ebp, ebp
and ecx, 0xff
mov word [esp + 0x3a], dx
imul ecx, ebx
movsx ebx, dx
imul ecx, ebx
mov dword [esp + 0x3c], esi
lea ebx, [eax + ecx]
jmp 0x425372
cmp ecx, 0xffffffff
je 0x4253a4
mov al, byte [esp + 0x2c]
mov byte [ebx + 2], cl
mov byte [ebx], al
mov eax, esi
mov byte [ebx + 1], al
inc ebp
movsx eax, bp
mov edx, dword [esp + 0x30]
add ebx, 4
cmp eax, edx
mov byte [ebx - 1], 0xff
jge 0x425400
mov dword [esp], edi
call sub.msvcrt.dll_fgetc
mov dword [esp], edi
mov dword [esp + 0x2c], eax
call sub.msvcrt.dll_fgetc
mov dword [esp], edi
mov esi, eax
call sub.msvcrt.dll_fgetc
cmp dword [esp + 0x2c], 0xffffffff
mov ecx, eax
sete dl
cmp esi, 0xffffffff
sete al
or al, dl
je 0x425348
mov eax, dword [0x4b61c0]
mov dword [esp + 8], str.Malformed_ppm_file
mov dword [esp + 4], str.raw_image_t::read_ppm
mov dword [esp], eax
call fcn.004256d0
jmp 0x4251e0
mov eax, dword [esp + 0x34]
mov dword [esp + 8], str.Heightfield_has_invalid_image_size___dx_d_
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 0xc], eax
mov eax, dword [0x4b61c0]
mov dword [esp + 4], str.raw_image_t::read_ppm
mov dword [esp], eax
call fcn.004256d0
mov dword [esp], edi
call sub.msvcrt.dll_fclose
jmp 0x4251e0
mov dx, word [esp + 0x3a]
mov ecx, dword [esp + 0x34]
inc edx
mov esi, dword [esp + 0x3c]
movsx eax, dx
cmp eax, ecx
jge 0x42541c
mov eax, dword [esi]
jmp 0x425320
mov dword [esp], edi
call sub.msvcrt.dll_fclose
mov al, 1
jmp 0x4251e2