Function at 0x651cc8
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x30
mov eax, dword [ecx + 0xc]
mov dword [esp + 0x10], eax
inc eax
je 0x652149
mov ebp, dword [ecx + 4]
mov edx, ecx
mov dword [esp + 0x18], edx
lea ebx, [ebp + 1]
mov dword [esp + 0x14], ebp
mov ecx, ebx
mov esi, ebx
shr ecx, 3
and esi, 0xfffffff8
sub esi, ecx
cmp ebp, 8
cmovb esi, ebp
mov ecx, esi
shr ecx, 1
cmp eax, ecx
jbe 0x651d26
inc esi
cmp eax, esi
cmova esi, eax
cmp esi, 8
jae 0x651d79
xor eax, eax
cmp esi, 4
setae al
lea eax, [eax*4 + 4]
jmp 0x651f41
mov ecx, ebx
mov edi, dword [edx]
xor eax, eax
mov dword [esp + 8], esi
shr ecx, 4
test bl, 0xf
setne al
add eax, ecx
je 0x651d5d
movdqa xmm0, xmmword [0x661800]
mov ecx, edi
pxor xmm1, xmm1
dec eax
pcmpgtb xmm1, xmmword [ecx]
por xmm1, xmm0
movdqa xmmword [ecx], xmm1
lea ecx, [ecx + 0x10]
jne 0x651d47
cmp ebx, 0x10
jae 0x651d98
lea eax, [edi + 0x10]
push ebx
push edi
push eax
call fcn.0064a810
add esp, 0xc
test ebx, ebx
jne 0x651dac
jmp 0x651f04
cmp esi, 0x20000000
jae 0x652149
shl esi, 3
cmp esi, 0xe
jae 0x651f18
xor eax, eax
jmp 0x651f40
movq xmm0, qword [edi]
movq xmm1, qword [edi + 8]
movq qword [edi + ebx + 8], xmm1
movq qword [edi + ebx], xmm0
xor esi, esi
mov ebx, edi
mov dword [esp + 0x20], edi
cmp byte [edi + esi], 0x80
jne 0x651ef6
mov eax, esi
mov dword [esp], esi
neg esi
not eax
mov dword [esp + 0xc], esi
shl eax, 2
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0xc]
mov ebp, 0xcbf29ce4
mov esi, 0xfffffffc
mov eax, dword [edi + eax*4 - 4]
mov edi, 0x1b3
mov dword [esp + 0x2c], eax
mov eax, 0x84222325
movzx ecx, byte [esp + esi + 0x30]
imul ebp, ebp, 0x1b3
xor ecx, eax
mov eax, ecx
shl ecx, 8
mul edi
add ecx, edx
add ebp, ecx
inc esi
jne 0x651df2
mov ebp, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
mov ecx, ebp
and ecx, eax
movdqu xmm0, xmmword [edi + ecx]
mov esi, ecx
pmovmskb edx, xmm0
test edx, edx
jne 0x651e53
mov esi, ecx
mov ecx, edi
mov edi, ebp
mov ebp, 0x10
mov dword [esp + 4], esi
add esi, ebp
add ebp, 0x10
and esi, edi
movdqu xmm0, xmmword [ecx + esi]
pmovmskb edx, xmm0
test edx, edx
je 0x651e37
mov ebp, edi
mov edi, ecx
mov ecx, dword [esp + 4]
bsf edx, edx
add edx, esi
and edx, ebp
cmp byte [edi + edx], 0
js 0x651e6b
movdqa xmm0, xmmword [edi]
pmovmskb edx, xmm0
bsf edx, edx
mov esi, dword [esp]
mov ebp, edx
sub ebp, ecx
sub esi, ecx
mov ecx, dword [esp + 0x14]
xor ebp, esi
and ebp, ecx
cmp ebp, 0x10
jb 0x651ec0
mov ebp, ecx
mov ch, byte [edi + edx]
lea esi, [edx - 0x10]
shr eax, 0x19
and esi, ebp
mov byte [edi + edx], al
mov byte [esi + edi + 0x10], al
mov byte [esp + 4], ch
cmp byte [esp + 4], 0xff
je 0x651ed6
shl edx, 2
mov eax, edi
mov ecx, 0xfffffffc
sub eax, edx
mov dl, byte [ebx + ecx]
mov dh, byte [eax + ecx]
mov byte [ebx + ecx], dh
mov byte [eax + ecx], dl
inc ecx
jne 0x651eac
jmp 0x651dd2
mov esi, dword [esp]
shr eax, 0x19
mov ebp, ecx
lea edx, [esi - 0x10]
mov byte [edi + esi], al
and edx, ecx
mov byte [edx + edi + 0x10], al
jmp 0x651ef6
mov esi, dword [esp]
mov cl, 0xff
not edx
shl edx, 2
lea eax, [esi - 0x10]
mov byte [edi + esi], cl
and eax, ebp
mov byte [eax + edi + 0x10], cl
mov eax, dword [esp + 0x1c]
mov eax, dword [edi + eax]
mov dword [edi + edx], eax
add ebx, 0xfffffffc
cmp esi, ebp
lea esi, [esi + 1]
jne 0x651db4
mov ecx, dword [esp + 8]
mov eax, dword [esp + 0x18]
sub ecx, dword [esp + 0x10]
mov dword [eax + 8], ecx
jmp 0x65213c
mov ecx, 0x24924925
mov eax, esi
mul ecx
sub esi, edx
shr esi, 1
add esi, edx
shr esi, 2
dec esi
bsr ecx, esi
xor eax, eax
dec eax
not ecx
shr eax, cl
cmp eax, 0x3ffffffe
ja 0x652149
inc eax
lea edi, [eax*4]
add edi, 0xf
jb 0x652149
and edi, 0xfffffff0
lea ecx, [eax + 0x10]
mov ebx, edi
add ebx, ecx
jb 0x652149
cmp ebx, 0x7ffffff1
jae 0x652149
test ebx, ebx
mov dword [esp + 0xc], ecx
mov dword [esp], eax
je 0x651f98
mov al, byte [0x803894]
mov ecx, ebx
mov edx, 0x10
call fcn.004889b0
mov esi, eax
test eax, eax
jne 0x651f9d
mov ecx, ebx
call fcn.004c4f10
ud2
mov esi, 0x10
add esi, edi
mov edi, dword [esp]
mov eax, edi
mov edx, edi
lea ecx, [edi - 1]
shr eax, 3
and edx, 0xfffffff8
mov dword [esp], ecx
sub edx, eax
cmp edi, 9
cmovb edx, ecx
mov dword [esp + 0x24], edx
push dword [esp + 0xc]
push 0xff
push esi
call fcn.0064ad90
add esp, 0xc
mov eax, dword [esp + 0x18]
cmp dword [esp + 0x10], 0
mov edi, esi
mov eax, dword [eax]
mov dword [esp + 8], eax
je 0x6520f9
mov ebx, dword [esp + 8]
mov ecx, dword [esp + 0x10]
xor esi, esi
mov dword [esp + 4], edi
movdqa xmm0, xmmword [ebx]
pmovmskb eax, xmm0
not eax
test ax, ax
mov dword [esp + 0xc], ecx
jne 0x652020
movdqa xmm0, xmmword [ebx + 0x10]
add ebx, 0x10
add esi, 0x10
pmovmskb eax, xmm0
cmp eax, 0xffff
je 0x652008
not eax
mov ecx, dword [esp + 8]
mov dword [esp + 0x20], eax
bsf eax, eax
mov ebp, 0xcbf29ce4
mov edi, 0xfffffffc
add eax, esi
shl eax, 2
sub ecx, eax
mov eax, dword [ecx - 4]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x28], eax
mov eax, 0x84222325
movzx ecx, byte [esp + edi + 0x2c]
mov edx, 0x1b3
imul ebp, ebp, 0x1b3
xor ecx, eax
mov eax, ecx
shl ecx, 8
mul edx
add ecx, edx
add ebp, ecx
inc edi
jne 0x65204c
mov ecx, dword [esp]
mov edi, dword [esp + 4]
and ecx, eax
movdqu xmm0, xmmword [edi + ecx]
pmovmskb edx, xmm0
test edx, edx
jne 0x6520a6
mov ebp, dword [esp]
mov edi, 0x10
mov edx, dword [esp + 4]
add ecx, edi
add edi, 0x10
and ecx, ebp
movdqu xmm0, xmmword [edx + ecx]
pmovmskb edx, xmm0
test edx, edx
je 0x65208a
mov edi, dword [esp + 4]
bsf edx, edx
mov ebp, dword [esp + 0x14]
add edx, ecx
and edx, dword [esp]
cmp byte [edi + edx], 0
js 0x6520c3
movdqa xmm0, xmmword [edi]
pmovmskb ecx, xmm0
bsf edx, ecx
lea ecx, [edx - 0x10]
shr eax, 0x19
and ecx, dword [esp]
mov byte [edi + edx], al
shl edx, 2
neg edx
mov byte [ecx + edi + 0x10], al
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
mov eax, dword [eax - 4]
mov dword [edi + edx - 4], eax
lea eax, [ecx - 1]
and eax, ecx
mov ecx, dword [esp + 0xc]
dec ecx
test ecx, ecx
jne 0x651fff
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x18]
mov ecx, dword [esp]
sub edx, dword [esp + 0x10]
test ebp, ebp
mov dword [eax], edi
mov dword [eax + 4], ecx
mov dword [eax + 8], edx
je 0x65213c
lea eax, [ebp*4 + 0x13]
and eax, 0xfffffff0
add ebp, eax
cmp ebp, 0xffffffef
je 0x65213c
mov ecx, dword [esp + 8]
sub ecx, eax
push dword [ecx - 4]
push 0
push dword [0x8032a8]
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, 0x80000001
add esp, 0x30
pop esi
pop edi
pop ebx
pop ebp
ret
call fcn.004c4f20
ud2