Function at 0x1022a90
Capabilities:
Encode data using xor

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 8
cmp eax, 0x40
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
jge 0x1022ad3
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
push esi
push eax
push ebx
push edi
call fcn.01022990
mov ecx, dword [ebp + 0x10]
cmp eax, 0xffffffff
jne 0x1022de3
push esi
push ecx
push ebx
push edi
call fcn.01022990
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov cl, byte [ebx]
xor eax, eax
mov dword [ebp - 4], eax
lea ebx, [ebx]
mov esi, dword [ebp + 0x14]
mov edi, dword [ebp + 8]
cmp cl, byte [eax + ebx]
jne 0x1022b46
inc eax
cmp eax, 0xc
jl 0x1022ae0
lea eax, [ebx + 1]
mov dword [ebp + 0x14], 8
jmp 0x1022b00
cmp cl, byte [eax - 1]
je 0x1022b08
inc dword [ebp - 4]
cmp cl, byte [eax]
je 0x1022b0f
inc dword [ebp - 4]
cmp cl, byte [eax + 1]
je 0x1022b17
inc dword [ebp - 4]
cmp cl, byte [eax + 2]
je 0x1022b1f
inc dword [ebp - 4]
cmp cl, byte [eax + 3]
je 0x1022b27
inc dword [ebp - 4]
cmp cl, byte [eax + 4]
je 0x1022b2f
inc dword [ebp - 4]
add eax, 6
sub dword [ebp + 0x14], 1
jne 0x1022b00
cmp dword [ebp - 4], 3
jge 0x1022b46
or eax, 0xffffffff
jmp 0x1022c4e
lea eax, [ebx + 2]
mov dword [ebp + 0x14], 8
movzx ebx, byte [eax - 2]
mov edx, dword [esi + 4]
mov ecx, dword [esi]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax - 1]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax + 1]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
add eax, 6
sub dword [ebp + 0x14], 1
mov dword [esi], ecx
mov dword [esi + 4], ebx
jne 0x1022b50
mov ebx, dword [ebp + 0xc]
xor eax, eax
mov ecx, dword [ebp + 0x10]
cmp ecx, 0x80
jl 0x1022ab8
cmp ecx, 0x100
jge 0x1022c73
push esi
add ecx, 0xffffffa0
push ecx
lea eax, [ebx + 0x60]
push eax
jmp 0x1022aaf
cmp ecx, 0x200
jge 0x1022c99
lea eax, [ecx - 0xc0]
cmp eax, 0x30
jle 0x1022c8b
mov eax, 0x30
push esi
push eax
lea ecx, [ebx + 0xc0]
push ecx
jmp 0x1022aaf
cmp ecx, 0x400
jge 0x1022cbf
lea eax, [ecx - 0x180]
cmp eax, 0x30
jle 0x1022cb1
mov eax, 0x30
push esi
push eax
lea edx, [ebx + 0x180]
push edx
jmp 0x1022aaf
mov dl, byte [ebx + ecx - 0x100]
lea eax, [ebx + ecx - 0x100]
xor ecx, ecx
mov dword [ebp + 0x14], ecx
cmp dl, byte [ecx + eax]
jne 0x1022d19
inc ecx
cmp ecx, 0x10
jl 0x1022cd2
lea ecx, [eax + 1]
mov dword [ebp + 8], 0x10
cmp dl, byte [ecx - 1]
je 0x1022cef
inc dword [ebp + 0x14]
cmp dl, byte [ecx]
je 0x1022cf6
inc dword [ebp + 0x14]
cmp dl, byte [ecx + 1]
je 0x1022cfe
inc dword [ebp + 0x14]
cmp dl, byte [ecx + 2]
je 0x1022d06
inc dword [ebp + 0x14]
add ecx, 4
sub dword [ebp + 8], 1
jne 0x1022ce7
cmp dword [ebp + 0x14], 4
jl 0x1022dd4
mov dword [ebp + 0x10], 0x10
mov edx, dword [esi + 4]
movzx ebx, byte [eax]
mov ecx, dword [esi]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov dword [esi + 4], ebx
mov edx, ebx
mov dword [esi], ecx
movzx ebx, byte [eax + 1]
mov dword [ebp - 4], edx
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 2]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
mov edx, ebx
mov dword [esi + 4], ebx
mov dword [ebp - 4], edx
mov dword [esi], ecx
movzx ebx, byte [eax + 3]
shr edx, 0x18
movzx edx, dl
xor edx, ebx
mov ebx, dword [ebp - 4]
shld ebx, ecx, 8
xor ebx, dword [edi + edx*8 + 4]
shl ecx, 8
xor ecx, dword [edi + edx*8]
add eax, 4
sub dword [ebp + 0x10], 1
mov dword [esi], ecx
mov dword [esi + 4], ebx
jne 0x1022d20
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
push esi
push ecx
push ebx
push edi
call fcn.01022990
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10