Function at 0x101607b0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0xc
mov eax, dword [esp + 0x1c]
xor edx, edx
sub eax, dword [esp + 0x18]
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
push esi
lea ecx, [eax - 1]
mov dword [esp + 0xc], 0
push edi
mov edi, dword [esp + 0x30]
mov dword [esp + 0x14], edx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x18], ecx
xor esi, esi
xor ebx, ebx
test edi, edi
jle 0x10160816
mov eax, dword [ebp + ebx*4]
cdq
xor eax, edx
sub eax, edx
cmp eax, esi
mov edx, eax
mov eax, ebx
cmovle eax, dword [esp + 0x10]
cmovle edx, esi
inc ebx
mov dword [esp + 0x10], eax
mov esi, edx
cmp ebx, edi
jl 0x101607e8
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x10], eax
mov ebx, dword [esp + 0x2c]
mov eax, esi
cmp ebx, 1
jne 0x10160829
sar eax, 1
and esi, ebx
add eax, esi
jmp 0x1016082e
sar eax, cl
inc eax
sar eax, 1
cmp eax, 0x7fff
jle 0x1016087c
mov ecx, dword [esp + 0x10]
mov edx, 0x27ffe
cmp eax, edx
cmovl edx, eax
inc ecx
imul ecx, edx
mov eax, 0x7fff
sub eax, edx
shl eax, 0xe
cdq
sar ecx, 2
idiv ecx
add eax, 0xffbe
push eax
push edi
push ebp
call fcn.10160710
mov edx, dword [esp + 0x20]
lea ecx, [ebx - 1]
inc edx
add esp, 0xc
mov dword [esp + 0x14], edx
cmp edx, 0xa
jl 0x101607e0
cmp edx, 0xa
jne 0x10160924
xor edx, edx
test edi, edi
jle 0x10160a72
mov esi, dword [esp + 0x20]
cmp ebx, 1
jne 0x101608dd
mov ecx, dword [ebp + edx*4]
mov eax, ecx
sar eax, 1
and ecx, 1
add eax, ecx
cmp eax, 0x7fff
jle 0x101608b3
mov eax, 0x7fff
jmp 0x101608c0
cmp eax, 0xffff8000
mov ecx, 0xffff8000
cmovl eax, ecx
movzx eax, ax
mov ecx, ebx
mov word [esi + edx*2], ax
cwde
shl eax, cl
mov dword [ebp + edx*4], eax
inc edx
cmp edx, edi
jl 0x10160898
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
xor edx, edx
nop
mov eax, dword [ebp + edx*4]
lea ecx, [ebx - 1]
sar eax, cl
inc eax
sar eax, 1
cmp eax, 0x7fff
jle 0x101608fa
mov eax, 0x7fff
jmp 0x10160907
cmp eax, 0xffff8000
mov ecx, 0xffff8000
cmovl eax, ecx
movzx eax, ax
mov ecx, ebx
mov word [esi + edx*2], ax
cwde
shl eax, cl
mov dword [ebp + edx*4], eax
inc edx
cmp edx, edi
jl 0x101608e0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
xor edx, edx
test edi, edi
jle 0x10160a72
cmp edi, 0x10
jb 0x10160a28
cmp ebx, 1
jne 0x10160a51
mov ebx, dword [esp + 0x20]
lea eax, [edi*4 - 4]
add eax, ebp
lea ecx, [edi - 1]
lea ecx, [ebx + ecx*2]
cmp ebx, eax
ja 0x1016095f
cmp ecx, ebp
jae 0x10160a33
movaps xmm2, xmmword [0x102053b0]
lea ecx, [ebx + 0x10]
mov esi, edi
lea eax, [ebp + 0x20]
and esi, 0xfffffff0
movups xmm1, xmmword [eax - 0x20]
lea eax, [eax + 0x40]
add edx, 0x10
movaps xmm0, xmm2
lea ecx, [ecx + 0x20]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x30], xmm0
movaps xmm0, xmm2
movups xmm1, xmmword [eax - 0x50]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x28], xmm0
movaps xmm0, xmm2
movups xmm1, xmmword [eax - 0x40]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x20], xmm0
movaps xmm0, xmm2
movups xmm1, xmmword [eax - 0x30]
andps xmm0, xmm1
psrad xmm1, 1
paddd xmm0, xmm1
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
movq qword [ecx - 0x18], xmm0
cmp edx, esi
jl 0x10160971
mov dword [esp + 0x14], edx
cmp edx, edi
jge 0x10160a72
jmp 0x10160a2c
mov ebx, dword [esp + 0x20]
cmp dword [esp + 0x2c], 1
jne 0x10160a51
mov ecx, dword [ebp + edx*4]
mov eax, ecx
sar eax, 1
and ecx, 1
add eax, ecx
mov word [ebx + edx*2], ax
inc edx
cmp edx, edi
jl 0x10160a33
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
mov esi, dword [esp + 0x20]
xor edx, edx
mov ecx, dword [esp + 0x18]
nop dword [eax + eax]
mov eax, dword [ebp + edx*4]
sar eax, cl
inc eax
sar eax, 1
mov word [esi + edx*2], ax
inc edx
cmp edx, edi
jl 0x10160a60
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret