Function at 0x6c5890
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x50
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp + 0x1c]
add ecx, 1
xor eax, eax
cmp ecx, edx
ja 0x6c5aee
mov esi, dword [ebp + 0x10]
movzx eax, byte [esi + edx - 1]
mov dword [esp + 8], eax
add ecx, eax
mov eax, edx
sub eax, ecx
xor ecx, edx
xor eax, edx
or eax, ecx
xor eax, edx
sar eax, 0x1f
not eax
cmp edx, 0x100
mov ebx, 0x100
cmovb ebx, edx
test ebx, ebx
je 0x6c5ac8
xor edi, edi
cmp ebx, 4
jb 0x6c5a90
mov edi, ebx
and edi, 0x1fc
movd xmm1, eax
movaps xmm0, xmmword [0x73c5d0]
movss xmm0, xmm1
movd xmm1, dword [esp + 8]
pshufd xmm5, xmm1, 0
punpcklbw xmm1, xmm1
pshuflw xmm1, xmm1, 0
lea eax, [edi - 4]
mov ecx, eax
shr ecx, 2
add ecx, 1
test eax, eax
je 0x6c5af6
mov dword [esp + 0xc], ecx
mov eax, ecx
and eax, 0xfffffffe
lea ecx, [edx + esi]
add ecx, 0xfffffffc
movdqa xmm4, xmmword [0x7882a0]
xor esi, esi
movdqa xmmword [esp + 0x20], xmm5
por xmm5, xmmword [0x6fac20]
movdqa xmmword [esp + 0x30], xmm5
movdqa xmmword [esp + 0x10], xmm1
pxor xmm6, xmm6
movdqa xmm1, xmmword [esp + 0x30]
movdqa xmm5, xmmword [esp + 0x10]
movdqa xmm2, xmm4
movdqa xmm7, xmmword [0x6fac20]
pxor xmm2, xmm7
pcmpgtd xmm2, xmm1
movd xmm3, dword [ecx + esi]
punpcklbw xmm3, xmm6
pshuflw xmm3, xmm3, 0x1b
packuswb xmm3, xmm3
pxor xmm3, xmm5
punpcklbw xmm3, xmm6
punpcklwd xmm3, xmm6
pcmpeqd xmm7, xmm7
pxor xmm3, xmm7
pcmpeqd xmm7, xmm7
por xmm3, xmm2
pand xmm3, xmm0
movdqa xmm2, xmm4
paddd xmm2, xmmword [0x7882b0]
pxor xmm2, xmmword [0x6fac20]
pcmpgtd xmm2, xmm1
movd xmm0, dword [ecx + esi - 4]
punpcklbw xmm0, xmm6
pshuflw xmm0, xmm0, 0x1b
packuswb xmm0, xmm0
pxor xmm0, xmm5
punpcklbw xmm0, xmm6
punpcklwd xmm0, xmm6
pxor xmm0, xmm7
por xmm0, xmm2
pand xmm0, xmm3
paddd xmm4, xmmword [str._b_b_b_b_f_r]
add esi, 0xfffffff8
add eax, 0xfffffffe
jne 0x6c5970
neg esi
movdqa xmm5, xmmword [esp + 0x20]
mov ecx, dword [esp + 0xc]
movdqa xmm1, xmmword [esp + 0x10]
test cl, 1
je 0x6c5a73
lea eax, [edx - 1]
movdqa xmm2, xmmword [0x6fac20]
por xmm5, xmm2
pxor xmm4, xmm2
pcmpgtd xmm4, xmm5
sub eax, esi
mov ecx, dword [ebp + 0x10]
movd xmm2, dword [ecx + eax - 3]
pxor xmm3, xmm3
punpcklbw xmm2, xmm3
pshuflw xmm2, xmm2, 0x1b
packuswb xmm2, xmm2
pxor xmm2, xmm1
punpcklbw xmm2, xmm3
punpcklwd xmm2, xmm3
pcmpeqd xmm1, xmm1
pxor xmm1, xmm2
por xmm1, xmm4
pand xmm0, xmm1
pshufd xmm1, xmm0, 0xee
pand xmm1, xmm0
pshufd xmm0, xmm1, 0x55
pand xmm0, xmm1
movd eax, xmm0
cmp ebx, edi
mov esi, dword [ebp + 0x10]
je 0x6c5ac8
mov ecx, dword [ebp + 0x14]
sub ecx, edi
add ecx, esi
add ecx, 0xffffffff
nop word [eax + eax]
movzx edx, byte [ecx]
mov esi, ebx
mov ebx, dword [esp + 8]
xor dl, bl
cmp edi, ebx
mov ebx, esi
movzx edx, dl
not edx
mov esi, 0xffffffff
cmova edx, esi
and eax, edx
add edi, 1
add ecx, 0xffffffff
cmp ebx, edi
jne 0x6c5aa0
xor ecx, ecx
cmp al, 0xff
sete cl
neg ecx
mov edi, dword [esp + 8]
add edi, 1
and edi, ecx
mov eax, dword [ebp + 0x14]
sub eax, edi
mov edx, dword [ebp + 0xc]
mov dword [edx], eax
mov eax, dword [ebp + 8]
mov dword [eax], ecx
mov eax, 1
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
movdqa xmm4, xmmword [0x7882a0]
xor esi, esi
test cl, 1
jne 0x6c5a24
jmp 0x6c5a73