Function at 0x415013
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
push edi
lea eax, [ebp - 0x40]
push dword [ebp + 8]
push 8
push 1
pop edi
push edi
push eax
call sub.MSVCRT.dll_fread
lea eax, [ebp - 0x40]
push 8
push eax
call fcn.00417624
add esp, 0x18
test eax, eax
je 0x41508a
xor esi, esi
push esi
push esi
push esi
push 0x4427d0
call fcn.00415c7a
push eax
mov dword [ebp - 4], eax
call fcn.004176f9
push dword [ebp - 4]
mov dword [ebp - 0x10], eax
call fcn.004176f9
push esi
mov dword [ebp - 0x24], eax
push dword [ebp - 4]
call sub.MSVCRT.dll__setjmp3
add esp, 0x20
test eax, eax
je 0x415091
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 4]
push eax
call fcn.00416313
add esp, 0xc
xor eax, eax
jmp 0x4157dd
push dword [ebp + 8]
push dword [ebp - 4]
call fcn.00417777
push 8
push dword [ebp - 4]
call fcn.004175b2
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.00415d8f
push esi
push esi
lea eax, [ebp - 0x18]
push esi
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.004164e5
mov eax, dword [ebp + 0x14]
add esp, 0x3c
cmp eax, esi
je 0x4150ea
mov ecx, dword [ebp - 0xc]
mov dword [eax], ecx
mov ecx, dword [ebp - 8]
mov dword [eax + 4], ecx
mov ecx, dword [ebp - 0x2c]
mov dword [eax + 8], ecx
cmp dword [0x44532c], esi
jne 0x415102
push 0x44532c
push 0xd33
call dword [sym.imp.OPENGL32.dll_glGetIntegerv]
cmp dword [0x4427c4], 0xffffffff
jne 0x415142
push str.GL_EXT_paletted_texture
call fcn.004158ad
test eax, eax
pop ecx
je 0x41513c
push str.1.1.0_3Dfx_Beta
push 0x1f02
call dword [sym.imp.OPENGL32.dll_glGetString]
push eax
call sub.MSVCRT.dll_strstr
pop ecx
mov dword [0x4427c4], edi
test eax, eax
pop ecx
je 0x415142
mov dword [0x4427c4], esi
cmp dword [0x4427c4], esi
je 0x41516c
cmp dword [0x445328], esi
jne 0x41516c
push str.glColorTableEXT
call dword [sym.imp.OPENGL32.dll_wglGetProcAddress]
cmp eax, esi
mov dword [0x445328], eax
jne 0x41516c
mov dword [0x4427c4], esi
cmp dword [0x4427c4], 0xffffffff
jne 0x41517b
mov dword [0x4427c4], esi
cmp dword [ebp - 0x18], esi
je 0x415186
cmp dword [ebp - 0x18], 4
jne 0x41518f
push dword [ebp - 4]
call fcn.0041663b
pop ecx
test byte [ebp - 0x18], 4
je 0x4151a8
cmp dword [ebp + 0x10], 0xfffffffe
je 0x4151a8
push dword [ebp - 4]
call fcn.004165e8
and dword [ebp - 0x18], 0xfffffffb
pop ecx
cmp dword [0x4427c4], esi
je 0x4151bb
cmp dword [ebp + 0xc], esi
jl 0x4151bb
cmp dword [ebp + 0x10], 0xffffffff
je 0x4151ca
cmp dword [ebp - 0x18], 3
jne 0x4151ca
push dword [ebp - 4]
call fcn.00416632
pop ecx
call fcn.00414f93
lea eax, [ebp - 0x48]
push eax
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.004164bc
add esp, 0xc
test eax, eax
je 0x4151ea
fld qword [ebp - 0x48]
jmp 0x4151f0
fld qword [0x41caf8]
push ecx
push ecx
fstp qword [esp]
fld qword [0x4427c8]
push ecx
push ecx
fstp qword [esp]
push dword [ebp - 4]
call fcn.004165f1
add esp, 0x14
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.00415f4e
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.004164a6
imul eax, dword [ebp - 8]
push eax
call sub.MSVCRT.dll_malloc
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 8]
shl eax, 2
push eax
call sub.MSVCRT.dll_malloc
add esp, 0x18
cmp dword [ebp - 8], esi
mov edi, eax
jbe 0x415285
mov ebx, edi
push dword [ebp - 0x10]
cmp dword [0x445324], 0
push dword [ebp - 4]
je 0x41526d
call fcn.004164a6
imul eax, esi
add eax, dword [ebp - 0x14]
pop ecx
pop ecx
mov ecx, dword [ebp - 8]
sub ecx, esi
mov dword [edi + ecx*4 - 4], eax
jmp 0x41527c
call fcn.004164a6
imul eax, esi
add eax, dword [ebp - 0x14]
pop ecx
pop ecx
mov dword [ebx], eax
inc esi
add ebx, 4
cmp esi, dword [ebp - 8]
jb 0x415246
push edi
push dword [ebp - 4]
call fcn.00416194
push edi
call sub.MSVCRT.dll_free
push dword [ebp - 0xc]
call fcn.00415810
push dword [ebp - 8]
mov esi, eax
call fcn.00415810
add esp, 0x14
cmp esi, dword [ebp - 0xc]
mov edi, eax
jne 0x4152b5
cmp edi, dword [ebp - 8]
je 0x4152ff
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.004164a6
xor edx, edx
div dword [ebp - 0xc]
mov ebx, eax
imul eax, edi
imul eax, esi
push eax
call sub.MSVCRT.dll_malloc
push edi
push esi
push eax
mov dword [ebp - 0x20], eax
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp - 0x14]
push ebx
call fcn.00415835
push dword [ebp - 0x14]
mov dword [ebp - 0xc], esi
mov dword [ebp - 8], edi
call sub.MSVCRT.dll_free
mov eax, dword [ebp - 0x20]
add esp, 0x2c
mov dword [ebp - 0x14], eax
mov esi, dword [sym.imp.OPENGL32.dll_glGetIntegerv]
lea eax, [ebp - 0x34]
mov ebx, 0xd05
push eax
push ebx
call esi
lea eax, [ebp - 0x38]
mov edi, 0xcf5
push eax
push edi
call esi
push 1
push ebx
mov ebx, dword [sym.imp.OPENGL32.dll_glPixelStorei]
call ebx
push 1
push edi
call ebx
mov eax, dword [ebp - 0x18]
xor esi, esi
cmp dword [0x4427c4], esi
je 0x415416
cmp dword [ebp + 0xc], esi
jl 0x415416
cmp dword [ebp + 0x10], 0xffffffff
jne 0x415420
cmp eax, 3
jne 0x415416
mov eax, dword [ebp + 0x14]
cmp eax, esi
je 0x415364
mov dword [eax + 0xc], esi
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x30]
push eax
push dword [ebp - 0x10]
push dword [ebp - 4]
call fcn.004165b5
mov eax, dword [ebp - 0x28]
add esp, 0x10
dec eax
dec eax
je 0x4153d0
dec eax
dec eax
je 0x4153c7
sub eax, 0xc
je 0x4153be
sub eax, 0xf0
je 0x4153b5
sub eax, 0xf00
je 0x4153ac
sub eax, 0xf000
jne 0x41508a
mov dword [ebp - 0x1c], 0x80e7
jmp 0x4153d7
mov dword [ebp - 0x1c], 0x80e6
jmp 0x4153d7
mov dword [ebp - 0x1c], 0x80e5
jmp 0x4153d7
mov dword [ebp - 0x1c], 0x80e4
jmp 0x4153d7
mov dword [ebp - 0x1c], 0x80e3
jmp 0x4153d7
mov dword [ebp - 0x1c], 0x80e2
push dword [ebp - 0x30]
mov edi, 0x1401
mov esi, 0xde1
push edi
push 0x1907
push dword [ebp - 0x28]
push 0x8051
push esi
call dword [0x445328]
push dword [ebp - 0x14]
push edi
push 0x1900
push 0
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp - 0x1c]
push dword [ebp + 0xc]
push esi
jmp 0x415799
cmp dword [ebp + 0x10], 0xffffffff
je 0x415711
cmp dword [ebp + 0x10], 0xfffffffe
je 0x415711
cmp eax, 6
je 0x415711
cmp eax, 4
je 0x415711
mov eax, dword [ebp - 0xc]
mov edi, dword [ebp - 0x14]
imul eax, dword [ebp - 8]
mov ebx, eax
lea ecx, [edi + eax*2]
shl eax, 2
add ebx, ecx
push eax
mov dword [ebp - 0x30], ebx
call sub.MSVCRT.dll_malloc
cmp dword [ebp + 0x14], 0
mov esi, eax
pop ecx
mov dword [ebp - 0x20], esi
je 0x41546f
mov eax, dword [ebp + 0x14]
mov dword [eax + 0xc], 8
mov eax, dword [ebp + 0x10]
add eax, 3
cmp eax, 0xa
ja case.default.0x41547e
jmp dword [eax*4 + 0x4157e4]
movzx eax, byte [edi]
movzx ecx, byte [edi + 1]
inc edi
inc edi
movzx edx, byte [edi]
inc edi
mov byte [esi], al
inc esi
push edx
push ecx
push eax
mov byte [esi], cl
inc esi
mov byte [esi], dl
inc esi
call dword [0x4427c0]
add esp, 0xc
mov byte [esi], al
inc esi
cmp edi, ebx
jne 0x415485
jmp case.default.0x41547e
movzx eax, byte [edi]
movzx ecx, byte [edi + 1]
inc edi
inc edi
movzx edx, byte [edi]
inc edi
mov byte [esi], al
inc esi
mov byte [esi], cl
inc esi
mov byte [esi], dl
inc esi
movzx ebx, byte [0x445320]
cmp eax, ebx
jne 0x4154ef
movzx eax, byte [0x445321]
cmp ecx, eax
jne 0x4154ef
movzx eax, byte [0x445322]
cmp edx, eax
jne 0x4154ef
and byte [esi], 0
jmp 0x4154f2
or byte [esi], 0xff
inc esi
cmp edi, dword [ebp - 0x30]
jne case.0x41547e.0
jmp case.default.0x41547e
movzx edx, byte [edi]
movzx eax, byte [edi + 1]
inc edi
inc edi
movzx ecx, byte [edi]
inc edi
mov byte [esi], dl
inc esi
mov byte [esi], al
inc esi
add eax, ecx
mov byte [esi], cl
add eax, edx
inc esi
cmp eax, 0xff
jle 0x415523
or byte [esi], 0xff
jmp 0x415525
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.1
jmp case.default.0x41547e
movzx edx, byte [edi]
movzx eax, byte [edi + 1]
inc edi
inc edi
movzx ecx, byte [edi]
inc edi
mov byte [esi], dl
inc esi
mov byte [esi], al
inc esi
add eax, ecx
mov byte [esi], cl
add eax, edx
inc esi
cmp eax, 0x1fe
jle 0x415555
or byte [esi], 0xff
jmp 0x41555c
cdq
sub eax, edx
sar eax, 1
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.2
jmp case.default.0x41547e
movzx edx, byte [edi]
movzx eax, byte [edi + 1]
inc edi
push 3
inc edi
movzx ecx, byte [edi]
inc edi
mov byte [esi], dl
inc esi
mov byte [esi], al
add eax, ecx
inc esi
add eax, edx
cdq
mov byte [esi], cl
pop ecx
idiv ecx
inc esi
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.3
jmp case.default.0x41547e
movzx ecx, byte [edi]
movzx edx, byte [edi + 1]
inc edi
mov dword [ebp - 0x1c], edx
inc edi
movzx eax, byte [edi]
inc edi
mov byte [esi], cl
inc esi
mov byte [esi], dl
inc esi
imul edx, edx
mov byte [esi], al
imul eax, eax
add eax, edx
mov edx, ecx
imul edx, ecx
add eax, edx
inc esi
cmp eax, 0xff
jle 0x4155c6
or byte [esi], 0xff
jmp 0x4155c8
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.4
jmp case.default.0x41547e
movzx ecx, byte [edi]
movzx edx, byte [edi + 1]
inc edi
mov dword [ebp - 0x1c], edx
inc edi
movzx eax, byte [edi]
inc edi
mov byte [esi], cl
inc esi
mov byte [esi], dl
inc esi
imul edx, edx
mov byte [esi], al
imul eax, eax
add eax, edx
mov edx, ecx
imul edx, ecx
add eax, edx
inc esi
cmp eax, 0x1fe
jle 0x415606
or byte [esi], 0xff
jmp 0x41560d
cdq
sub eax, edx
sar eax, 1
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.5
jmp case.default.0x41547e
movzx ecx, byte [edi]
movzx edx, byte [edi + 1]
inc edi
mov dword [ebp - 0x1c], edx
inc edi
movzx eax, byte [edi]
inc edi
mov byte [esi], cl
inc esi
mov byte [esi], dl
inc esi
imul edx, edx
mov byte [esi], al
imul eax, eax
add eax, edx
mov edx, ecx
imul edx, ecx
add eax, edx
inc esi
cmp eax, 0x2fd
jle 0x41564b
or byte [esi], 0xff
jmp 0x415653
push 3
cdq
pop ecx
idiv ecx
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.6
jmp case.default.0x41547e
movzx ecx, byte [edi]
movzx edx, byte [edi + 1]
inc edi
mov dword [ebp - 0x1c], edx
inc edi
movzx eax, byte [edi]
inc edi
mov byte [esi], cl
inc esi
mov byte [esi], dl
inc esi
imul edx, edx
mov byte [esi], al
imul eax, eax
add eax, edx
mov edx, ecx
imul edx, ecx
add eax, edx
inc esi
cmp eax, 0xfe01
mov dword [ebp - 0x30], eax
jle 0x415691
or byte [esi], 0xff
jmp 0x4156a7
fild dword [ebp - 0x30]
push ecx
push ecx
fstp qword [esp]
call sub.MSVCRT.dll_sqrt
pop ecx
pop ecx
call sub.MSVCRT.dll__ftol
mov byte [esi], al
inc esi
cmp edi, ebx
jne case.0x41547e.7
cmp dword [ebp + 0xc], 0xffffffff
jne 0x4156ce
push 1
push dword [ebp - 0x20]
push 0x1908
push dword [ebp - 8]
push dword [ebp - 0xc]
push 4
call fcn.00415906
add esp, 0x18
jmp 0x4156fd
cmp dword [ebp + 0xc], 0xfffffffe
jne 0x4156d8
push 0
jmp 0x4156b4
push dword [ebp - 0x20]
push 0x1401
push 0x1908
push 0
push dword [ebp - 8]
push dword [ebp - 0xc]
push 4
push dword [ebp + 0xc]
push 0xde1
call dword [sym.imp.OPENGL32.dll_glTexImage2D]
push dword [ebp - 0x20]
call sub.MSVCRT.dll_free
mov ebx, dword [sym.imp.OPENGL32.dll_glPixelStorei]
pop ecx
jmp 0x41579f
cmp eax, esi
je 0x415748
cmp eax, 1
jle 0x41508a
cmp eax, 3
jle 0x415748
push 4
pop ecx
cmp eax, ecx
je 0x415733
cmp eax, 6
jne 0x41508a
mov edx, dword [ebp + 0x14]
mov eax, 0x1908
cmp edx, esi
je 0x41575a
mov dword [edx + 0xc], 8
jmp 0x41575a
mov edx, dword [ebp + 0x14]
push 3
cmp edx, esi
mov eax, 0x1907
pop ecx
je 0x41575a
mov dword [edx + 0xc], esi
cmp dword [ebp + 0xc], 0xffffffff
jne 0x415777
push 1
push dword [ebp - 0x14]
push eax
push dword [ebp - 8]
push dword [ebp - 0xc]
push ecx
call fcn.00415906
add esp, 0x18
jmp 0x41579f
cmp dword [ebp + 0xc], 0xfffffffe
jne 0x415780
push esi
jmp 0x415762
push dword [ebp - 0x14]
push 0x1401
push eax
push esi
push dword [ebp - 8]
push dword [ebp - 0xc]
push ecx
push dword [ebp + 0xc]
push 0xde1
call dword [sym.imp.OPENGL32.dll_glTexImage2D]
push dword [ebp - 0x34]
push 0xd05
call ebx
push dword [ebp - 0x38]
push 0xcf5
call ebx
push dword [ebp - 0x24]
push dword [ebp - 4]
call fcn.004161e1
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 4]
push eax
call fcn.00416313
push dword [ebp - 0x14]
call sub.MSVCRT.dll_free
add esp, 0x18
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret 0x10