Function at 0x410c40
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
push 0x4c0ed0
push edi
call fcn.0046f500
add esp, 8
mov eax, dword [eax + 0x24]
mov eax, dword [eax + 8]
dec eax
cmp eax, 8
ja case.default.0x410c71
movzx eax, byte [eax + 0x410f30]
jmp dword [eax*4 + 0x410f24]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push edi
call fcn.004116f0
add esp, 0xc
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x4c0ed0
push edi
call fcn.0046f500
mov esi, eax
add esp, 8
cmp dword [esi + 0x494], 0
jne 0x410cdd
push dword [esi + 0x18]
mov eax, dword [esi + 0x20]
push dword [esi]
mov dword [esi + 0x494], 1
push dword [eax]
mov eax, dword [esi + 0x1c]
push dword [eax]
push str.gray_threshold
push dword [esi + 4]
push str.gray
push str.Colorfunc_is__s__d_to__s___s___s___d___d_n
push edi
push 2
call fcn.0046e0c0
add esp, 0x28
mov esi, dword [esi + 4]
push 0x4c0ed0
push edi
call fcn.0046f500
add esp, 8
mov dword [ebp - 8], eax
cmp esi, 8
mov dword [ebp - 4], 1
mov esi, dword [ebp + 0x10]
jne 0x410d5b
mov ebx, dword [eax + 8]
mov edi, dword [ebp + 0xc]
lea eax, [ebx + ebx]
push eax
push 0
push esi
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 8]
xor ecx, ecx
add esp, 0xc
mov edx, 0x80
cmp dword [eax + 0x18], ecx
cmovne edx, ecx
test ebx, ebx
jle 0x410daf
mov ecx, 0xffff
movzx eax, byte [edi]
and eax, 0x80
cmp eax, edx
jne 0x410d48
mov word [esi], cx
mov dword [ebp - 4], 0
add esi, 2
inc edi
sub ebx, 1
jne 0x410d32
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [eax + 8]
lea eax, [edi + edi]
push eax
push 0
push esi
call sub.VCRUNTIME140.dll_memset
mov eax, dword [ebp - 8]
xor ecx, ecx
add esp, 0xc
mov ebx, 0x8000
cmp dword [eax + 0x18], ecx
cmovne ebx, ecx
test edi, edi
jle 0x410daf
mov edx, dword [ebp + 0xc]
mov ecx, 0xffff
sub edx, esi
nop dword [eax + eax]
movzx eax, word [edx + esi]
and eax, 0x8000
cmp eax, ebx
jne 0x410da7
mov word [esi], cx
mov dword [ebp - 4], 0
add esi, 2
sub edi, 1
jne 0x410d90
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x4c0ed0
push edi
call fcn.0046f500
mov esi, eax
add esp, 8
cmp dword [esi + 0x494], 0
jne 0x410e08
push dword [esi + 0x18]
mov eax, dword [esi + 0x20]
push dword [esi]
mov dword [esi + 0x494], 1
push dword [eax]
mov eax, dword [esi + 0x1c]
push dword [eax]
push str.gray_raw
push dword [esi + 4]
push str.gray
push str.Colorfunc_is__s__d_to__s___s___s___d___d_n
push edi
push 2
call fcn.0046e0c0
add esp, 0x28
mov esi, dword [esi + 4]
push 0x4c0ed0
push edi
call fcn.0046f500
add esp, 8
mov edi, eax
cmp esi, 8
jne 0x410eb4
mov eax, dword [edi + 8]
mov ebx, dword [ebp + 0x10]
add eax, eax
mov esi, dword [edi + 0x18]
push eax
push 0
push ebx
mov dword [ebp - 8], 0
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [ebp - 4], 0
cmp dword [edi + 8], 0
jle 0x410ea4
mov edx, dword [ebp + 0xc]
neg esi
mov eax, 0x101
sbb esi, esi
and esi, 0xffff
movzx esi, si
movzx ecx, byte [edx]
lea edx, [edx + 1]
movzx eax, ax
lea ebx, [ebx + 2]
imul ecx, eax
xor cx, si
mov word [ebx - 2], cx
movzx eax, cx
mov ecx, dword [ebp - 8]
or ecx, eax
mov eax, dword [ebp - 4]
inc eax
mov dword [ebp - 8], ecx
cmp eax, dword [edi + 8]
mov dword [ebp - 4], eax
mov eax, 0x101
jl 0x410e64
xor eax, eax
test ecx, ecx
pop edi
pop esi
sete al
pop ebx
mov esp, ebp
pop ebp
ret
xor ecx, ecx
xor eax, eax
pop edi
test ecx, ecx
pop esi
sete al
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x18]
xor ebx, ebx
mov esi, dword [ebp + 0x10]
mov dword [ebp - 8], eax
mov eax, dword [edi + 8]
add eax, eax
push eax
push ebx
push esi
call sub.VCRUNTIME140.dll_memset
xor ecx, ecx
add esp, 0xc
cmp dword [edi + 8], ecx
jle 0x410f0a
mov eax, dword [ebp - 8]
mov edx, dword [ebp + 0xc]
neg eax
sbb eax, eax
and eax, 0xffff
sub edx, esi
movzx eax, ax
mov dword [ebp - 8], eax
nop dword [eax]
mov ax, word [edx + esi]
lea esi, [esi + 2]
xor ax, word [ebp - 8]
inc ecx
mov word [esi - 2], ax
movzx eax, ax
or ebx, eax
cmp ecx, dword [edi + 8]
jl 0x410ef0
xor eax, eax
test ebx, ebx
pop edi
pop esi
sete al
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret