Function at 0x4126a0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x28
push ebx
push ebp
push esi
mov esi, dword [esp + 0x38]
push edi
xor ebx, ebx
push 0x4921c8
push esi
mov dword [esp + 0x18], ebx
call dword [sym.imp.MSVCRT.dll_fopen]
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x4126de
push esi
push str.File_open__s_failed
call fcn.00445450
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov esi, dword [sym.imp.MSVCRT.dll_fgetc]
push edi
call esi
push edi
mov byte [esp + 0x2c], al
call esi
push edi
mov byte [esp + 0x31], al
call esi
mov ebp, dword [sym.imp.MSVCRT.dll_fread]
mov byte [esp + 0x32], al
push edi
push 1
lea eax, [esp + 0x3b]
push 2
push eax
call ebp
push edi
push 1
lea ecx, [esp + 0x4d]
push 2
push ecx
call ebp
push edi
call esi
push edi
push 1
lea edx, [esp + 0x64]
push 2
push edx
mov byte [esp + 0x6b], al
call ebp
add esp, 0x40
lea eax, [esp + 0x2e]
push edi
push 1
push 2
push eax
call ebp
push edi
push 1
lea ecx, [esp + 0x48]
push 2
push ecx
call ebp
push edi
push 1
lea edx, [esp + 0x5a]
push 2
push edx
call ebp
push edi
call esi
push edi
mov byte [esp + 0x6c], al
call esi
mov byte [esp + 0x6d], al
mov al, byte [esp + 0x5e]
add esp, 0x38
cmp al, 2
je 0x41278c
cmp al, 0xa
je 0x41278c
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push str.Can_only_handle_image_type_2_and_10
call fcn.00445450
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov al, byte [esp + 0x34]
cmp al, 0x10
je 0x4127ba
cmp al, 0x18
je 0x4127ba
cmp al, 0x20
je 0x4127ba
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push str.Can_only_handle_pixel_depths_of_16__24__and_32
call fcn.00445450
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
mov al, byte [esp + 0x25]
test al, al
je 0x4127e4
cmp al, 1
je 0x4127e4
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push str.Can_only_handle_colour_map_types_of_0_and_1
call fcn.00445450
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
movsx ecx, word [esp + 0x29]
movsx edx, al
movsx eax, byte [esp + 0x24]
imul ecx, edx
add ecx, eax
push 1
push ecx
push edi
call dword [sym.imp.MSVCRT.dll_fseek]
movsx ecx, word [esp + 0x3e]
movsx edx, word [esp + 0x3c]
imul ecx, edx
shl ecx, 1
push ecx
call fcn.004225a0
mov cx, word [esp + 0x42]
add esp, 0x10
movsx esi, word [esp + 0x30]
movsx edx, cx
imul edx, esi
test edx, edx
mov dword [esp + 0x3c], eax
jle 0x41284f
mov byte [eax], 0
mov byte [eax + 1], 0
mov cx, word [esp + 0x32]
inc ebx
movsx esi, word [esp + 0x30]
movsx edx, cx
imul edx, esi
add eax, 2
cmp ebx, edx
jl 0x412830
movsx eax, byte [esp + 0x34]
cdq
and edx, 7
add eax, edx
mov esi, eax
movsx eax, cx
movsx ecx, word [esp + 0x30]
imul eax, ecx
sar esi, 3
test eax, eax
jle 0x4129c9
mov al, byte [esp + 0x26]
cmp al, 2
jne 0x4128b8
push edi
push esi
lea edx, [esp + 0x24]
push 1
push edx
call ebp
add esp, 0x10
cmp eax, esi
jne 0x412ab3
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x1c]
push esi
push eax
lea eax, [ecx + edx*2]
push eax
call fcn.004125a0
mov eax, dword [esp + 0x1c]
add esp, 0xc
inc eax
mov dword [esp + 0x10], eax
jmp 0x4129b2
cmp al, 0xa
jne 0x4129b2
lea ebp, [esi + 1]
push edi
push ebp
lea ecx, [esp + 0x24]
push 1
push ecx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, ebp
jne 0x412ab3
mov dl, byte [esp + 0x1c]
mov ecx, dword [esp + 0x3c]
mov ebx, dword [esp + 0x10]
and edx, 0x7f
mov ebp, edx
lea eax, [esp + 0x1d]
push esi
lea edx, [ecx + ebx*2]
push eax
push edx
call fcn.004125a0
mov al, byte [esp + 0x28]
add esp, 0xc
inc ebx
test al, 0x80
mov dword [esp + 0x10], ebx
je 0x412951
xor ebx, ebx
test ebp, ebp
jle 0x4129ac
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov ebx, ebp
lea edx, [ecx + eax*2]
add eax, ebp
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x1d]
push esi
push eax
push ecx
call fcn.004125a0
mov ecx, dword [esp + 0x20]
add esp, 0xc
add ecx, 2
dec ebp
mov dword [esp + 0x14], ecx
jne 0x41292e
jmp 0x4129ac
xor ebx, ebx
test ebp, ebp
jle 0x4129ac
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
lea ecx, [edx + eax*2]
mov dword [esp + 0x14], ecx
push edi
push esi
lea edx, [esp + 0x24]
push 1
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, esi
jne 0x412ab3
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
push esi
push eax
push ecx
call fcn.004125a0
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
add esp, 0xc
inc eax
add edx, 2
inc ebx
cmp ebx, ebp
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], edx
jl 0x412966
mov ebp, dword [sym.imp.MSVCRT.dll_fread]
movsx edx, word [esp + 0x32]
movsx eax, word [esp + 0x30]
imul edx, eax
cmp dword [esp + 0x10], edx
jl 0x412872
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push 0x10
call fcn.004225a0
mov ebp, eax
mov eax, dword [esp + 0x44]
mov byte [ebp], 2
mov cx, word [esp + 0x38]
mov word [ebp + 2], cx
mov dx, word [esp + 0x3a]
mov word [ebp + 4], dx
mov dword [ebp + 8], eax
movsx edx, dx
movsx eax, cx
dec edx
mov ecx, dword [esp + 0x44]
imul edx, eax
lea ebx, [eax + eax]
mov dword [ebp + 0xc], 0
lea eax, [ecx + edx*2]
push ebx
mov dword [esp + 0x48], ecx
mov dword [esp + 0x1c], eax
call fcn.004225e0
mov cx, word [ebp + 4]
add esp, 0xc
and ecx, 0xfffffffe
mov dword [esp + 0x14], eax
test cx, cx
mov dword [esp + 0x18], 0
jle 0x412aa9
mov esi, dword [esp + 0x3c]
mov edi, dword [esp + 0x14]
mov ecx, ebx
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov edx, dword [esp + 0x10]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x3c]
mov ecx, ebx
mov eax, ecx
mov esi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x14]
mov ecx, ebx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [esp + 0x18]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
movsx ecx, word [ebp + 2]
mov esi, dword [esp + 0x3c]
shl ecx, 1
add esi, ecx
sub edx, ecx
movsx ecx, word [ebp + 4]
inc eax
mov dword [esp + 0x3c], esi
sar ecx, 1
cmp eax, ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], eax
jl 0x412a3a
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x28
ret
push edi
call dword [sym.imp.MSVCRT.dll_fclose]
push ebx
push str.Unexpected_end_of_file_at_pixel__d
call fcn.00445450
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x28
ret