Function at 0x474d40
Capabilities:
Terminate process

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
mov ecx, dword [ebp + 0x74]
movzx ebx, byte [ebp + 0x126]
mov eax, ecx
and eax, 0x100
push esi
push edi
mov dword [esp + 0x18], ebx
je 0x474d67
test bl, 2
je 0x474d97
test cl, cl
jns 0x474d9e
test eax, eax
jne 0x474da6
test ecx, 0x4000
je 0x474d9e
movzx edx, word [ebp + 0x13a]
cmp dx, word [ebp + 0x13c]
jne 0x474d9e
cmp dx, word [ebp + 0x13e]
jne 0x474d9e
mov word [ebp + 0x140], dx
or dword [ebp + 0x6c], 0x800
test eax, eax
je 0x474f46
test ecx, 0x1000
je 0x474f46
test bl, 2
jne 0x474ed7
movzx eax, byte [ebp + 0x127]
sub eax, 1
je 0x474e79
sub eax, 1
je 0x474e39
sub eax, 2
je 0x474df6
movzx eax, word [ebp + 0x140]
mov word [ebp + 0x13e], ax
mov word [ebp + 0x13c], ax
mov word [ebp + 0x13a], ax
jmp 0x474f46
mov ax, word [ebp + 0x140]
imul ax, ax, 0x11
test ecx, 0x2000000
mov word [ebp + 0x140], ax
mov word [ebp + 0x13e], ax
mov word [ebp + 0x13c], ax
mov word [ebp + 0x13a], ax
jne 0x474f46
mov ax, word [ebp + 0x194]
imul ax, ax, 0x11
jmp 0x474eb9
mov ax, word [ebp + 0x140]
imul ax, ax, 0x55
test ecx, 0x2000000
mov word [ebp + 0x140], ax
mov word [ebp + 0x13e], ax
mov word [ebp + 0x13c], ax
mov word [ebp + 0x13a], ax
jne 0x474f46
mov ax, word [ebp + 0x194]
imul ax, ax, 0x55
jmp 0x474eb9
mov ax, word [ebp + 0x140]
imul ax, ax, 0xff
test ecx, 0x2000000
mov word [ebp + 0x140], ax
mov word [ebp + 0x13e], ax
mov word [ebp + 0x13c], ax
mov word [ebp + 0x13a], ax
jne 0x474f46
mov ax, word [ebp + 0x194]
imul ax, ax, 0xff
mov word [ebp + 0x194], ax
mov word [ebp + 0x192], ax
mov word [ebp + 0x190], ax
mov word [ebp + 0x18e], ax
jmp 0x474f46
cmp ebx, 3
jne 0x474f46
movzx eax, byte [ebp + 0x138]
mov edx, dword [ebp + 0x114]
lea eax, [eax + eax*2]
add eax, edx
test ecx, 0x80000
movzx edx, byte [eax]
mov word [ebp + 0x13a], dx
movzx edx, byte [eax + 1]
mov word [ebp + 0x13c], dx
movzx ax, byte [eax + 2]
mov word [ebp + 0x13e], ax
je 0x474f46
test ecx, 0x2000000
jne 0x474f46
movzx esi, word [ebp + 0x11a]
xor eax, eax
test esi, esi
jle 0x474f46
lea esp, [esp]
mov ecx, dword [ebp + 0x188]
add ecx, eax
or dl, 0xff
sub dl, byte [ecx]
add eax, 1
cmp eax, esi
mov byte [ecx], dl
jl 0x474f30
cmp ebx, 3
mov eax, dword [ebp + 0x138]
mov ecx, dword [ebp + 0x13c]
mov dx, word [ebp + 0x140]
mov dword [ebp + 0x142], eax
mov dword [ebp + 0x146], ecx
mov word [ebp + 0x14a], dx
jne 0x474ff6
movzx edi, word [ebp + 0x11a]
test di, di
je 0x474ff6
mov eax, dword [ebp + 0x15c]
mov ecx, dword [ebp + 0x160]
push 0x186a0
push eax
push ecx
lea esi, [esp + 0x30]
call fcn.00467520
add esp, 0xc
test eax, eax
je 0x474fb6
mov edx, dword [esp + 0x24]
add edx, 0xfffe8ce8
cmp edx, 0x2710
jbe 0x474ff6
xor ebx, ebx
xor ecx, ecx
test di, di
jbe 0x474feb
movzx esi, word [ebp + 0x11a]
mov edx, dword [ebp + 0x188]
lea esp, [esp]
mov al, byte [edx + ecx]
test al, al
je 0x474fe0
cmp al, 0xff
je 0x474fe0
mov ebx, 1
add ecx, 1
cmp ecx, esi
jl 0x474fd0
test ebx, ebx
jne 0x474ff2
and dword [ebp + 0x74], 0xffffdfff
mov ebx, dword [esp + 0x18]
mov eax, dword [ebp + 0x74]
test eax, 0x602000
je 0x475545
cmp dword [ebp + 0x15c], 0
je 0x475545
movzx eax, byte [ebp + 0x127]
push eax
mov esi, ebp
call fcn.00467be0
add esp, 4
test byte [ebp + 0x74], 0x80
je 0x4754da
cmp ebx, 3
jne 0x475352
movzx edi, word [ebp + 0x118]
mov al, byte [ebp + 0x130]
cmp al, 2
mov dword [esp + 0x1c], edi
jne 0x47509a
movzx ecx, word [ebp + 0x13a]
mov eax, dword [ebp + 0x164]
movzx edx, byte [eax + ecx]
movzx esi, word [ebp + 0x13c]
mov byte [esp + 0x24], dl
movzx edx, byte [esi + eax]
mov byte [esp + 0x25], dl
movzx edx, word [ebp + 0x13e]
mov al, byte [edx + eax]
mov byte [esp + 0x26], al
mov eax, dword [ebp + 0x16c]
movzx edx, byte [eax + edx]
mov bl, byte [eax + ecx]
mov cl, byte [eax + esi]
mov byte [esp + 0x15], cl
mov byte [esp + 0x16], dl
jmp 0x475135
movzx eax, al
sub eax, 1
je 0x475200
sub eax, 1
je 0x4751e6
sub eax, 1
je 0x47518c
mov esi, 0x186a0
mov ebx, esi
movzx eax, word [ebp + 0x13a]
push ebx
call fcn.004676f0
mov byte [esp + 0x28], al
movzx eax, word [ebp + 0x13c]
add esp, 4
push ebx
call fcn.004676f0
mov byte [esp + 0x29], al
movzx eax, word [ebp + 0x13e]
add esp, 4
push ebx
call fcn.004676f0
add esp, 4
mov byte [esp + 0x26], al
movzx eax, word [ebp + 0x13a]
push esi
call fcn.004676f0
mov bl, al
movzx eax, word [ebp + 0x13c]
add esp, 4
push esi
call fcn.004676f0
mov byte [esp + 0x19], al
movzx eax, word [ebp + 0x13e]
add esp, 4
push esi
call fcn.004676f0
add esp, 4
mov byte [esp + 0x16], al
xor esi, esi
test edi, edi
jle 0x475346
mov ecx, dword [ebp + 0x114]
add ecx, 2
jmp 0x475150
movzx edx, word [ebp + 0x11a]
cmp esi, edx
jge 0x475308
mov eax, dword [ebp + 0x188]
lea edx, [eax + esi]
mov al, byte [edx]
cmp al, 0xff
je 0x475308
test al, al
jne 0x475210
mov dx, word [esp + 0x24]
mov al, byte [esp + 0x26]
mov word [ecx - 2], dx
jmp 0x475336
mov ebx, dword [ebp + 0x134]
push ebx
call fcn.00467590
mov esi, eax
mov eax, dword [ebp + 0x160]
add esp, 4
push eax
push ebx
call fcn.00467630
mov ebx, eax
add esp, 8
cmp ebx, 0x17318
jl 0x4751c3
cmp ebx, 0x19a28
jle 0x4750bf
mov dl, byte [ebp + 0x13a]
mov al, byte [ebp + 0x13c]
mov cl, byte [ebp + 0x13e]
mov byte [esp + 0x24], dl
mov byte [esp + 0x25], al
mov byte [esp + 0x26], cl
jmp 0x4750fb
mov ebx, dword [ebp + 0x15c]
push ebx
call fcn.00467590
mov ecx, dword [ebp + 0x160]
add esp, 4
mov esi, eax
push ecx
jmp 0x4751a4
mov esi, dword [ebp + 0x160]
mov ebx, 0x186a0
jmp 0x4750bf
movzx dx, byte [edx]
mov edi, dword [ebp + 0x16c]
movzx eax, byte [ecx - 2]
movzx eax, byte [eax + edi]
imul ax, dx
mov edi, 0xff
sub edi, edx
movzx dx, bl
imul di, dx
add ax, di
add ax, 0x80
movzx edx, ax
movzx edx, dx
mov eax, edx
shr eax, 8
add eax, edx
sar eax, 8
movzx edx, al
mov eax, dword [ebp + 0x168]
movzx edx, byte [edx + eax]
mov byte [ecx - 2], dl
mov eax, dword [ebp + 0x188]
movzx dx, byte [eax + esi]
movzx eax, byte [ecx - 1]
mov edi, dword [ebp + 0x16c]
movzx eax, byte [eax + edi]
imul ax, dx
mov edi, 0xff
sub edi, edx
movzx edx, byte [esp + 0x15]
imul di, dx
add ax, di
add ax, 0x80
movzx edx, ax
movzx edx, dx
mov eax, edx
shr eax, 8
add eax, edx
sar eax, 8
movzx edx, al
mov eax, dword [ebp + 0x168]
movzx edx, byte [edx + eax]
mov byte [ecx - 1], dl
mov eax, dword [ebp + 0x188]
movzx dx, byte [eax + esi]
movzx eax, byte [ecx]
mov edi, dword [ebp + 0x16c]
movzx eax, byte [eax + edi]
imul ax, dx
mov edi, 0xff
sub edi, edx
movzx edx, byte [esp + 0x16]
imul di, dx
add ax, di
mov edi, dword [esp + 0x1c]
add ax, 0x80
movzx edx, ax
movzx edx, dx
mov eax, edx
shr eax, 8
add eax, edx
sar eax, 8
movzx edx, al
mov eax, dword [ebp + 0x168]
movzx edx, byte [edx + eax]
mov byte [ecx], dl
jmp 0x475338
movzx eax, byte [ecx - 2]
mov edx, dword [ebp + 0x164]
movzx eax, byte [eax + edx]
movzx edx, byte [ecx - 1]
mov byte [ecx - 2], al
mov eax, dword [ebp + 0x164]
mov dl, byte [edx + eax]
movzx eax, byte [ecx]
mov byte [ecx - 1], dl
mov edx, dword [ebp + 0x164]
movzx eax, byte [eax + edx]
mov byte [ecx], al
add esi, 1
add ecx, 3
cmp esi, edi
jl 0x475150
and dword [ebp + 0x74], 0xffffdf7f
jmp 0x475681
movzx eax, byte [ebp + 0x130]
sub eax, 1
mov esi, 0x186a0
je 0x4753c3
sub eax, 1
je 0x47539e
sub eax, 1
je 0x475379
mov edi, str.invalid_background_gamma_type
mov eax, ebp
jmp fcn.004665a0
mov esi, dword [ebp + 0x134]
push esi
call fcn.00467590
mov ecx, dword [ebp + 0x160]
add esp, 4
push ecx
push esi
mov edi, eax
call fcn.00467630
add esp, 8
mov esi, eax
jmp 0x4753c9
mov esi, dword [ebp + 0x15c]
push esi
call fcn.00467590
mov edx, dword [ebp + 0x160]
add esp, 4
push edx
push esi
mov edi, eax
call fcn.00467630
add esp, 8
mov esi, eax
jmp 0x4753c9
mov edi, dword [ebp + 0x160]
movzx ebx, word [ebp + 0x140]
mov ecx, edi
mov eax, ebx
mov edx, ebp
call fcn.004677f0
mov word [esp + 0x24], ax
mov word [ebp + 0x14a], ax
mov ecx, esi
mov eax, ebx
mov edx, ebp
call fcn.004677f0
movzx edx, word [ebp + 0x13c]
movzx ecx, word [ebp + 0x13a]
cmp cx, dx
mov word [ebp + 0x140], ax
jne 0x47544e
cmp cx, word [ebp + 0x13e]
jne 0x47544e
cmp cx, ax
jne 0x47544e
mov cx, word [esp + 0x24]
mov word [ebp + 0x148], cx
mov word [ebp + 0x146], cx
mov word [ebp + 0x144], cx
mov word [ebp + 0x13e], ax
mov word [ebp + 0x13c], ax
mov word [ebp + 0x13a], ax
jmp 0x475688
movzx ebx, cx
mov ecx, edi
mov eax, ebx
mov edx, ebp
call fcn.004677f0
mov word [ebp + 0x144], ax
movzx eax, word [ebp + 0x13c]
movzx eax, ax
mov ecx, edi
mov edx, ebp
mov dword [esp + 0x24], eax
call fcn.004677f0
mov word [ebp + 0x146], ax
movzx eax, word [ebp + 0x13e]
mov ecx, edi
mov edx, ebp
call fcn.004677f0
mov word [ebp + 0x148], ax
mov ecx, esi
mov eax, ebx
mov edx, ebp
call fcn.004677f0
mov word [ebp + 0x13a], ax
mov eax, dword [esp + 0x24]
mov ecx, esi
mov edx, ebp
call fcn.004677f0
mov word [ebp + 0x13c], ax
movzx eax, word [ebp + 0x13e]
mov ecx, esi
mov edx, ebp
call fcn.004677f0
mov word [ebp + 0x13e], ax
jmp 0x475688
cmp ebx, 3
jne 0x47568c
movzx ecx, word [ebp + 0x118]
test ecx, ecx
mov eax, dword [ebp + 0x114]
jle 0x475539
add eax, 2
jmp 0x475500
movzx edx, byte [eax - 2]
mov esi, dword [ebp + 0x164]
movzx edx, byte [edx + esi]
mov byte [eax - 2], dl
movzx edx, byte [eax - 1]
mov esi, dword [ebp + 0x164]
movzx edx, byte [edx + esi]
mov byte [eax - 1], dl
movzx edx, byte [eax]
mov esi, dword [ebp + 0x164]
movzx edx, byte [edx + esi]
mov byte [eax], dl
add eax, 3
sub ecx, 1
jne 0x475500
and dword [ebp + 0x74], 0xffffdfff
jmp 0x47568c
test al, al
jns 0x47568c
cmp ebx, 3
jne 0x47568c
movzx edi, word [ebp + 0x11a]
movzx edx, byte [ebp + 0x13c]
mov cl, byte [ebp + 0x13a]
mov eax, dword [ebp + 0x114]
xor esi, esi
test edi, edi
mov byte [esp + 0x25], dl
mov dl, byte [ebp + 0x13e]
mov dword [esp + 0x1c], edi
mov byte [esp + 0x24], cl
jle 0x47567a
add eax, 2
nop
mov ecx, dword [ebp + 0x188]
mov bl, byte [ecx + esi]
add ecx, esi
test bl, bl
jne 0x4755af
mov cx, word [esp + 0x24]
mov word [eax - 2], cx
mov byte [eax], dl
jmp 0x47566c
cmp bl, 0xff
je 0x47566c
movzx cx, byte [ecx]
movzx ebx, byte [esp + 0x24]
mov edi, 0xff
sub edi, ecx
imul di, bx
movzx ebx, byte [eax - 2]
imul bx, cx
add di, bx
add di, 0x80
movzx ecx, di
movzx ecx, cx
mov ebx, ecx
shr ebx, 8
add ebx, ecx
sar ebx, 8
mov byte [eax - 2], bl
mov ecx, dword [ebp + 0x188]
movzx cx, byte [ecx + esi]
movzx ebx, byte [esp + 0x25]
mov edi, 0xff
sub edi, ecx
imul di, bx
movzx ebx, byte [eax - 1]
imul bx, cx
add di, bx
add di, 0x80
movzx ecx, di
movzx ecx, cx
mov ebx, ecx
shr ebx, 8
add ebx, ecx
sar ebx, 8
mov byte [eax - 1], bl
mov ecx, dword [ebp + 0x188]
movzx cx, byte [ecx + esi]
movzx bx, dl
mov edi, 0xff
sub edi, ecx
imul di, bx
movzx ebx, byte [eax]
imul bx, cx
add di, bx
add di, 0x80
movzx ecx, di
mov edi, dword [esp + 0x1c]
movzx ecx, cx
mov ebx, ecx
shr ebx, 8
add ebx, ecx
sar ebx, 8
mov byte [eax], bl
add esi, 1
add eax, 3
cmp esi, edi
jl 0x475590
and dword [ebp + 0x74], 0xffffff7f
or dword [ebp + 0x70], 0x400000
mov ebx, dword [esp + 0x18]
test byte [ebp + 0x74], 8
je 0x475749
cmp ebx, 3
jne 0x475749
movzx eax, byte [ebp + 0x17d]
movzx edx, byte [ebp + 0x17c]
movzx esi, word [ebp + 0x118]
mov ecx, 8
sub ecx, eax
movzx eax, byte [ebp + 0x17e]
mov ebx, 8
sub ebx, edx
mov edx, 8
sub edx, eax
xor eax, eax
cmp ebx, eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x18], edx
jl 0x4756e3
cmp ebx, 8
jle 0x4756e5
xor ebx, ebx
cmp ecx, eax
jl 0x4756ee
cmp ecx, 8
jle 0x4756f2
mov dword [esp + 0x24], eax
cmp edx, eax
jl 0x4756fb
cmp edx, 8
jle 0x4756ff
mov dword [esp + 0x18], eax
cmp si, ax
jbe 0x475749
movzx esi, si
jmp 0x475710
mov ecx, dword [ebp + 0x114]
lea edx, [eax + ecx]
mov cl, bl
shr byte [edx], cl
mov edx, dword [ebp + 0x114]
movzx ecx, byte [esp + 0x24]
shr byte [eax + edx + 1], cl
mov ecx, dword [ebp + 0x114]
lea edx, [eax + edx + 1]
lea edx, [eax + ecx + 2]
movzx ecx, byte [esp + 0x18]
shr byte [edx], cl
add eax, 3
sub esi, 1
jne 0x475710
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret