Function at 0x10047ab0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 0x18
push esi
mov esi, ecx
mov dword [esp + 0xc], 0
mov eax, edx
mov dword [esp + 0x14], eax
test esi, esi
jne 0x10047ae4
push str.image_has_wrong_mode
mov eax, dword [sym.imp.python310.dll_PyExc_ValueError]
push dword [eax]
call dword [sym.imp.python310.dll_PyErr_SetString]
add esp, 8
xor eax, eax
pop esi
add esp, 0x18
ret
dec eax
cmp eax, 0xff
ja 0x1004810b
mov ecx, 0x101e1280
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047b17
test dl, dl
je 0x10047b13
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047b17
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047af7
xor eax, eax
jmp 0x10047b1c
sbb eax, eax
or eax, 1
test eax, eax
je 0x10047bbd
mov ecx, 0x101e1608
mov eax, esi
nop dword [eax + eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047b50
test dl, dl
je 0x10047b4c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047b50
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047b30
xor eax, eax
jmp 0x10047b55
sbb eax, eax
or eax, 1
test eax, eax
je 0x10047bbd
mov ecx, 0x101e14f8
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047b80
test dl, dl
je 0x10047b7c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047b80
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047b60
xor eax, eax
jmp 0x10047b85
sbb eax, eax
or eax, 1
test eax, eax
je 0x10047bbd
mov ecx, str.RGBA
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047bb0
test dl, dl
je 0x10047bac
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047bb0
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047b90
xor eax, eax
jmp 0x10047bb5
sbb eax, eax
or eax, 1
test eax, eax
jne 0x10047ac8
mov ecx, str.RGBA
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047be4
test dl, dl
je 0x10047be0
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047be4
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047bc4
xor eax, eax
jmp 0x10047be9
sbb eax, eax
or eax, 1
test eax, eax
jne 0x10047bff
mov eax, dword [esp + 0x20]
cmp eax, 2
je 0x10047bff
cmp eax, 3
jne 0x10047ac8
mov eax, 0x7fffffff
mov ecx, dword [esi + 0x14]
push edi
mov edi, dword [esi + 0x18]
cdq
idiv edi
cmp ecx, eax
jle 0x10047c1d
pop edi
pop esi
add esp, 0x18
jmp dword [sym.imp.python310.dll_PyErr_NoMemory]
imul ecx, edi
push ebp
push 4
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_calloc]
mov ebp, eax
add esp, 8
mov dword [esp + 0x10], ebp
test ebp, ebp
jne 0x10047c43
pop ebp
pop edi
pop esi
add esp, 0x18
jmp dword [sym.imp.python310.dll_PyErr_NoMemory]
mov ecx, 0x101e1280
mov eax, esi
nop word [eax + eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047c70
test dl, dl
je 0x10047c6c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047c70
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047c50
xor eax, eax
jmp 0x10047c75
sbb eax, eax
or eax, 1
push ebx
test eax, eax
jne 0x10047ccd
xor ebx, ebx
xor edi, edi
cmp dword [esi + 0x18], ebx
jle 0x10047ed8
mov eax, dword [esi + 0x14]
nop word [eax + eax]
xor edx, edx
test eax, eax
jle 0x10047cc2
lea ecx, [ebp + 1]
lea ecx, [ecx + edi*4]
nop dword [eax]
mov eax, dword [esi + 0x20]
lea ecx, [ecx + 4]
inc edi
mov eax, dword [eax + ebx*4]
mov al, byte [edx + eax]
inc edx
mov byte [ecx - 3], al
mov byte [ecx - 4], al
mov byte [ecx - 5], al
mov byte [ecx - 2], 0xff
mov eax, dword [esi + 0x14]
cmp edx, eax
jl 0x10047ca0
inc ebx
cmp ebx, dword [esi + 0x18]
jl 0x10047c90
jmp 0x10047ed8
mov ecx, 0x101e1608
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047cf4
test dl, dl
je 0x10047cf0
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047cf4
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047cd4
xor eax, eax
jmp 0x10047cf9
sbb eax, eax
or eax, 1
test eax, eax
jne 0x10047d74
mov ebp, dword [esi + 0x1c]
xor ecx, ecx
xor ebx, ebx
mov dword [esp + 0x24], ecx
cmp dword [esi + 0x18], ecx
jle 0x10047ed4
mov eax, dword [esi + 0x14]
xor edi, edi
test eax, eax
jle 0x10047d69
mov edx, dword [esp + 0x14]
add edx, 2
lea edx, [edx + ecx*4]
mov eax, dword [esi + 0x20]
lea edx, [edx + 4]
mov eax, dword [eax + ebx*4]
movzx eax, byte [eax + edi]
inc edi
lea ecx, [eax*4]
movzx eax, byte [ecx + ebp + 0xc]
mov byte [edx - 6], al
movzx eax, byte [ecx + ebp + 0xd]
mov byte [edx - 5], al
movzx eax, byte [ecx + ebp + 0xe]
mov byte [edx - 4], al
movzx eax, byte [ecx + ebp + 0xf]
mov ecx, dword [esp + 0x24]
mov byte [edx - 3], al
inc ecx
mov eax, dword [esi + 0x14]
mov dword [esp + 0x24], ecx
cmp edi, eax
jl 0x10047d24
inc ebx
cmp ebx, dword [esi + 0x18]
jl 0x10047d14
jmp 0x10047ed4
mov ecx, 0x101e14f8
mov eax, esi
nop dword [eax + eax]
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047da0
test dl, dl
je 0x10047d9c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047da0
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047d80
xor eax, eax
jmp 0x10047da5
sbb eax, eax
or eax, 1
test eax, eax
je 0x10047dff
mov ecx, str.RGBA
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047dd0
test dl, dl
je 0x10047dcc
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047dd0
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047db0
xor eax, eax
jmp 0x10047dd5
sbb eax, eax
or eax, 1
test eax, eax
je 0x10047dff
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [sym.imp.python310.dll_PyExc_ValueError]
push str.internal_error
push dword [eax]
call dword [sym.imp.python310.dll_PyErr_SetString]
add esp, 0xc
xor eax, eax
pop ebx
pop ebp
pop edi
pop esi
add esp, 0x18
ret
mov ecx, str.RGBA
mov eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x10047e26
test dl, dl
je 0x10047e22
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x10047e26
add eax, 2
add ecx, 2
test dl, dl
jne 0x10047e06
xor eax, eax
jmp 0x10047e2b
sbb eax, eax
or eax, 1
xor ecx, ecx
mov dword [esp + 0x24], eax
test eax, eax
mov byte [esp + 0x11], 0
mov byte [esp + 0x12], 0
sete cl
mov byte [esp + 0x13], 0
xor ebx, ebx
mov dword [esp + 0x18], ecx
xor ebp, ebp
mov dword [esp + 0x1c], ebx
xor edi, edi
cmp dword [esi + 0x18], ebx
jle 0x10047ed4
xor edx, edx
cmp dword [esi + 0x14], edx
jle 0x10047eca
mov ecx, dword [esp + 0x14]
add ecx, 2
lea ecx, [ecx + edi*4]
nop dword [eax]
cmp dword [esp + 0x24], 0
mov eax, dword [esi + 0x24]
mov eax, dword [eax + ebx*4]
mov ebx, dword [eax + edx*4]
mov dword [ecx - 2], ebx
jne 0x10047ebc
mov eax, ebx
shr eax, 0x18
test al, al
jne 0x10047ebc
test ebp, ebp
jne 0x10047ea8
mov al, byte [ecx - 1]
mov ebp, 1
mov byte [esp + 0x12], al
mov al, byte [ecx]
mov byte [esp + 0x11], bl
mov byte [esp + 0x13], al
jmp 0x10047ebc
mov al, byte [esp + 0x11]
mov byte [ecx - 2], al
mov al, byte [esp + 0x12]
mov byte [ecx - 1], al
mov al, byte [esp + 0x13]
mov byte [ecx], al
mov ebx, dword [esp + 0x1c]
inc edx
inc edi
add ecx, 4
cmp edx, dword [esi + 0x14]
jl 0x10047e70
inc ebx
mov dword [esp + 0x1c], ebx
cmp ebx, dword [esi + 0x18]
jl 0x10047e58
mov ebp, dword [esp + 0x14]
call dword [sym.imp.python310.dll_PyEval_SaveThread]
mov ebx, eax
mov eax, dword [esp + 0x2c]
cmp eax, 3
ja case.default.0x10047eed
jmp dword [eax*4 + 0x10048118]
push dword [esp + 0x30]
mov edx, dword [esi + 0x14]
lea eax, [esp + 0x18]
imul edx, dword [esi + 0x18]
mov ecx, ebp
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x30]
push eax
push dword [esp + 0x30]
call fcn.10047300
jmp 0x10047f67
push dword [esp + 0x30]
mov edx, dword [esi + 0x14]
lea eax, [esp + 0x18]
imul edx, dword [esi + 0x18]
mov ecx, ebp
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x30]
push eax
push dword [esp + 0x30]
call fcn.100ce440
jmp 0x10047f67
push dword [esp + 0x18]
mov edx, dword [esi + 0x14]
lea eax, [esp + 0x18]
imul edx, dword [esi + 0x18]
mov ecx, ebp
push eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x30]
push eax
push dword [esp + 0x30]
call fcn.10048bd0
add esp, 0x14
mov edi, eax
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call dword [sym.imp.python310.dll_PyEval_RestoreThread]
add esp, 8
test edi, edi
jle 0x100480b7
mov edx, dword [esi + 0x14]
mov ecx, 0x101e1608
push 1
push dword [esi + 0x18]
call fcn.100ce440
add esp, 8
mov ebp, eax
call dword [sym.imp.python310.dll_PyEval_SaveThread]
xor ebx, ebx
mov dword [esp + 0x20], eax
xor edi, edi
cmp dword [esi + 0x18], ebx
jle 0x10047fdf
mov ecx, dword [esi + 0x14]
xor edx, edx
test ecx, ecx
jle 0x10047fd9
nop dword [eax + eax]
mov eax, dword [ebp + 0x20]
mov ecx, dword [eax + ebx*4]
mov eax, dword [esp + 0x14]
mov al, byte [eax + edi*4]
inc edi
mov byte [edx + ecx], al
inc edx
mov ecx, dword [esi + 0x14]
cmp edx, ecx
jl 0x10047fc0
inc ebx
cmp ebx, dword [esi + 0x18]
jl 0x10047fb2
push dword [esp + 0x14]
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [ebp + 0x1c]
add esp, 4
mov esi, dword [esp + 0x1c]
add eax, 0xc
mov ebx, dword [esp + 0x24]
xor edi, edi
test esi, esi
jle 0x1004806b
cmp dword [esp + 0x18], edi
lea edx, [ebx + 2]
mov edi, esi
je 0x10048040
nop dword [eax + eax]
movzx ecx, byte [edx - 2]
lea edx, [edx + 4]
mov byte [eax], cl
movzx ecx, byte [edx - 5]
mov byte [eax + 1], cl
movzx ecx, byte [edx - 4]
mov byte [eax + 2], cl
movzx ecx, byte [edx - 3]
mov byte [eax + 3], cl
add eax, 4
sub esi, 1
jne 0x10048010
jmp 0x10048063
movzx ecx, byte [edx - 2]
lea edx, [edx + 4]
mov byte [eax], cl
movzx ecx, byte [edx - 5]
mov byte [eax + 1], cl
movzx ecx, byte [edx - 4]
mov byte [eax + 2], cl
mov byte [eax + 3], 0xff
add eax, 4
sub esi, 1
jne 0x10048040
cmp edi, 0x100
jge 0x10048080
mov ecx, 0x100
sub ecx, edi
mov dword [eax], 0xff000000
lea eax, [eax + 4]
sub ecx, 1
jne 0x10048072
cmp dword [esp + 0x18], 0
je 0x10048099
mov ecx, dword [ebp + 0x1c]
mov eax, dword [str.RGBA]
mov dword [ecx], eax
mov al, byte [0x101e161c]
mov byte [ecx + 4], al
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push dword [esp + 0x24]
call dword [sym.imp.python310.dll_PyEval_RestoreThread]
add esp, 8
mov eax, ebp
pop ebx
pop ebp
pop edi
pop esi
add esp, 0x18
ret
cmp edi, 0xffffffff
jne 0x100480ec
push str.dependency_required_by_this_method_was_not_enabled_at_compile_time
jmp 0x100480f1
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call dword [sym.imp.python310.dll_PyEval_RestoreThread]
add esp, 8
push str.dependency_required_by_this_method_was_not_enabled_at_compile_time
jmp 0x100480f1
push ebp
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
push ebx
call dword [sym.imp.python310.dll_PyEval_RestoreThread]
add esp, 8
push str.quantization_error
mov eax, dword [sym.imp.python310.dll_PyExc_ValueError]
push dword [eax]
call dword [sym.imp.python310.dll_PyErr_SetString]
add esp, 8
xor eax, eax
pop ebx
pop ebp
pop edi
pop esi
add esp, 0x18
ret
push str.bad_number_of_colors
jmp 0x10047acd