Function at 0x10021d80
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x15c
push esi
mov esi, ecx
mov dword [ebp - 8], edx
mov dword [ebp - 0x28], esi
cmp dword [esi + 0x28], 0x40
ja 0x10022005
push ebx
mov ebx, dword [ebp + 8]
test ebx, ebx
je 0x10022004
push edi
nop dword [eax]
mov ecx, dword [esi + 0x28]
test ecx, ecx
jne 0x10021fa9
cmp ebx, 0x40
jb 0x10021fa9
mov eax, dword [esi + 8]
xor edi, edi
mov dword [ebp - 4], eax
add edx, 2
mov eax, dword [esi + 0xc]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x10]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x1c], eax
mov eax, dword [esi + 0x14]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x44], eax
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 0x1c]
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x20]
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x14], eax
mov eax, dword [esi + 0x24]
mov dword [ebp - 0x5c], eax
mov dword [ebp - 0x20], eax
nop
movzx ecx, byte [edx - 2]
lea edx, [edx + 4]
movzx eax, byte [edx - 5]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx - 4]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx - 3]
shl ecx, 8
or ecx, eax
mov dword [ebp + edi*4 - 0x15c], ecx
inc edi
cmp edi, 0x10
jl 0x10021e10
lea ebx, [ebp - 0x124]
mov esi, 0x30
nop word [eax + eax]
mov ecx, dword [ebx - 0x34]
lea ebx, [ebx + 4]
mov edx, dword [ebx - 4]
mov edi, ecx
mov eax, ecx
ror edi, 0x12
ror eax, 7
xor edi, eax
shr ecx, 3
xor edi, ecx
mov eax, edx
mov ecx, edx
ror eax, 0x11
ror ecx, 0x13
xor ecx, eax
shr edx, 0xa
xor ecx, edx
add edi, ecx
add edi, dword [ebx - 0x3c]
add edi, dword [ebx - 0x18]
mov dword [ebx + 4], edi
sub esi, 1
jne 0x10021e50
mov ecx, dword [ebp - 0x18]
xor ebx, ebx
mov eax, dword [ebp - 4]
mov edi, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
mov eax, ecx
ror eax, 0xb
mov dword [ebp - 0x34], edi
mov edi, ecx
ror edi, 0x19
xor edi, eax
mov esi, dword [ebp - 0xc]
mov eax, ecx
mov dword [ebp - 0x48], ecx
ror eax, 6
xor edi, eax
mov dword [ebp - 0x58], edx
mov eax, dword [ebp - 0xc]
xor eax, edx
mov dword [ebp - 0x50], esi
and eax, ecx
mov esi, dword [ebp - 0x1c]
mov ecx, dword [ebp - 4]
xor eax, edx
add edi, eax
mov dword [ebp - 0x3c], esi
add edi, dword [ebx + 0x101fdb70]
mov edx, ecx
add edi, dword [ebp + ebx - 0x15c]
mov eax, ecx
add edi, dword [ebp - 0x20]
add ebx, 4
ror eax, 0xd
ror edx, 0x16
xor edx, eax
mov eax, ecx
ror eax, 2
xor edx, eax
mov eax, dword [ebp - 0x10]
mov ecx, eax
add edx, edi
or ecx, dword [ebp - 4]
and eax, dword [ebp - 4]
and ecx, esi
or ecx, eax
mov eax, dword [ebp - 0x14]
add edx, ecx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
mov eax, esi
mov esi, dword [ebp - 0x28]
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x24], eax
add ecx, edi
mov eax, dword [ebp - 0x10]
mov edi, dword [ebp - 4]
mov dword [ebp - 0x1c], eax
mov eax, edx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x10], edi
mov dword [ebp - 4], eax
cmp ebx, 0x100
jl 0x10021e96
add dword [esi + 8], edx
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x30]
mov dword [esi + 0xc], eax
mov eax, dword [ebp - 0x34]
add eax, dword [ebp - 0x38]
mov dword [esi + 0x10], eax
mov eax, dword [ebp - 0x3c]
add eax, dword [ebp - 0x40]
mov edx, dword [ebp - 8]
mov dword [esi + 0x14], eax
mov eax, dword [ebp - 0x44]
mov ebx, dword [ebp + 8]
add eax, ecx
mov dword [esi + 0x18], eax
mov eax, dword [ebp - 0x48]
add eax, dword [ebp - 0x4c]
mov dword [esi + 0x1c], eax
mov eax, dword [ebp - 0x50]
add eax, dword [ebp - 0x54]
mov dword [esi + 0x20], eax
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x5c]
mov dword [esi + 0x24], eax
add dword [esi], 0x200
adc dword [esi + 4], 0
add edx, 0x40
sub ebx, 0x40
mov dword [ebp - 8], edx
mov dword [ebp + 8], ebx
jmp 0x10021ffb
mov eax, 0x40
mov edi, ebx
sub eax, ecx
cmp ebx, eax
cmovae edi, eax
lea eax, [ecx + 0x2c]
push edi
push edx
add eax, esi
push eax
call sub.VCRUNTIME140.dll_memcpy
mov edx, dword [ebp - 8]
sub ebx, edi
add dword [esi + 0x28], edi
add edx, edi
add esp, 0xc
mov dword [ebp - 8], edx
cmp dword [esi + 0x28], 0x40
mov dword [ebp + 8], ebx
jne 0x10021ffb
lea edx, [esi + 0x2c]
mov ecx, esi
call fcn.10021b90
add dword [esi], 0x200
mov edx, dword [ebp - 8]
adc dword [esi + 4], 0
mov dword [esi + 0x28], 0
test ebx, ebx
jne 0x10021db0
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret