Function at 0x10022310
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x14
mov eax, dword [ebp + 0x10]
push ebx
push esi
push edi
mov edi, ecx
xor ecx, ecx
cmp eax, ecx
je 0x10022534
test al, 7
jne 0x10022534
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp + 0x14]
cmp ecx, 1
jne 0x100223ff
cmp eax, 8
mov ecx, dword [edi + 0xc]
mov ebx, dword [edi + 8]
mov dword [esp + 0x1c], ecx
jb 0x10022534
mov esi, dword [ebp + 0xc]
add esi, 0xfffffff9
shr eax, 3
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 8]
lea edx, [esp + 0x10]
push edx
push eax
call fcn.10022290
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
xor ecx, ebx
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0x24]
add esp, 8
xor eax, ecx
lea edx, [esp + 0x10]
push edx
mov ecx, edi
mov dword [esp + 0x18], eax
call fcn.10021f00
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
mov byte [esi + 0xe], cl
add esi, 8
mov edx, ecx
shr edx, 8
mov byte [esi + 5], dl
mov edx, ecx
mov dword [esp + 0x1c], ecx
shr ecx, 0x18
shr edx, 0x10
mov byte [esi + 4], dl
mov byte [esi + 3], cl
mov ecx, eax
mov byte [esi + 2], al
mov edx, eax
shr ecx, 8
mov ebx, eax
mov byte [esi + 1], cl
mov ecx, dword [ebp + 8]
shr edx, 0x10
shr eax, 0x18
mov byte [esi], dl
mov byte [esi - 1], al
mov eax, dword [esp + 0xc]
add ecx, 8
dec eax
mov dword [ebp + 8], ecx
mov dword [esp + 0xc], eax
jne 0x10022367
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
cmp ecx, 2
jne 0x100224b9
cmp eax, 8
mov ecx, dword [edi + 8]
mov edx, dword [edi + 0xc]
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], edx
jb 0x10022534
mov esi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
add esi, 0xfffffff9
shr eax, 3
mov dword [esp + 0xc], eax
nop
lea eax, [esp + 0x18]
push eax
mov ecx, edi
call fcn.10021f00
lea ecx, [esp + 0x10]
push ecx
push ebx
call fcn.10022290
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x24]
xor eax, ecx
mov ecx, dword [esp + 0x1c]
xor ecx, edx
add esi, 8
mov byte [esi + 6], cl
mov edx, ecx
shr edx, 8
mov byte [esi + 5], dl
mov edx, ecx
shr edx, 0x10
mov byte [esi + 4], dl
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x24], ecx
shr ecx, 0x18
mov byte [esi + 3], cl
mov ecx, eax
mov byte [esi + 2], al
mov edx, eax
mov dword [esp + 0x18], eax
mov dword [esp + 0x20], eax
shr ecx, 8
shr edx, 0x10
shr eax, 0x18
mov byte [esi + 1], cl
mov byte [esi], dl
mov byte [esi - 1], al
mov eax, dword [esp + 0x14]
add esp, 8
add ebx, 8
dec eax
mov dword [esp + 0xc], eax
jne 0x10022430
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 8
jb 0x10022534
mov esi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
add esi, 0xfffffff9
shr eax, 3
mov dword [esp + 0xc], eax
mov edi, edi
lea eax, [esp + 0x10]
push eax
push ebx
call fcn.10022290
add esp, 8
lea ecx, [esp + 0x10]
push ecx
mov ecx, edi
call fcn.10021f00
mov eax, dword [esp + 0x14]
mov byte [esi + 0xe], al
add esi, 8
mov edx, eax
mov ecx, eax
shr edx, 8
mov byte [esi + 5], dl
shr ecx, 0x10
mov byte [esi + 4], cl
shr eax, 0x18
mov byte [esi + 3], al
mov eax, dword [esp + 0x10]
mov edx, eax
mov byte [esi + 2], al
mov ecx, eax
shr edx, 8
shr ecx, 0x10
shr eax, 0x18
mov byte [esi + 1], dl
mov byte [esi], cl
mov byte [esi - 1], al
mov eax, dword [esp + 0xc]
add ebx, 8
dec eax
mov dword [esp + 0xc], eax
jne 0x100224d0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10