Function at 0x10022120
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x38
mov eax, dword [0x1005d3b0]
xor eax, esp
mov dword [esp + 0x34], eax
cmp dword [esp + 0x50], 0
mov ecx, dword [esp + 0x48]
push ebx
mov ebx, dword [esp + 0x40]
push ebp
mov ebp, dword [esp + 0x54]
push esi
push edi
mov edi, dword [esp + 0x50]
mov esi, ebp
mov dword [esp + 0x10], ebx
mov dword [esp + 0x20], edi
mov dword [esp + 0x18], ecx
mov dword [esp + 0x24], ebp
je 0x10022295
mov edx, dword [esp + 0x54]
mov dword [esp + 0x28], edx
cmp edx, 0x10
jb 0x10022219
shr edx, 4
mov dword [esp + 0x14], edx
mov eax, ebx
lea edx, [ebx + 3]
sub eax, esi
lea ecx, [edi + 1]
mov dword [esp + 0x30], eax
mov ebp, 4
mov eax, edi
sub eax, esi
sub ebx, edi
mov dword [esp + 0x1c], ebx
mov edi, eax
mov ebx, dword [esp + 0x30]
mov dword [esp + 0x2c], eax
mov edi, edi
movzx eax, byte [ebx + esi]
lea esi, [esi + 4]
xor al, byte [esi - 4]
lea ecx, [ecx + 4]
mov byte [edi + esi - 4], al
lea edx, [edx + 4]
mov eax, dword [esp + 0x1c]
movzx eax, byte [eax + ecx - 4]
xor al, byte [esi - 3]
mov byte [ecx - 4], al
movzx eax, byte [esi - 2]
xor al, byte [edx - 5]
mov byte [ecx - 3], al
movzx eax, byte [esi - 1]
xor al, byte [edx - 4]
mov byte [ecx - 2], al
dec ebp
jne 0x100221a0
push dword [esp + 0x18]
mov edi, dword [esp + 0x24]
push edi
push edi
call fcn.10023300
mov edx, dword [esp + 0x34]
mov esi, edi
mov ebx, dword [esp + 0x1c]
sub edx, 0x10
add ebx, 0x10
mov dword [esp + 0x34], edx
add edi, 0x10
mov dword [esp + 0x1c], ebx
add esp, 0xc
mov dword [esp + 0x20], edi
dec dword [esp + 0x14]
jne 0x10022177
mov ebp, dword [esp + 0x24]
test edx, edx
je 0x1002227c
sub ebx, esi
mov ecx, esi
sub edi, esi
mov ebp, edx
mov dword [esp + 0x1c], edi
lea esp, [esp]
mov al, byte [ecx + ebx]
lea ecx, [ecx + 1]
xor al, byte [ecx - 1]
mov byte [ecx + edi - 1], al
dec ebp
jne 0x10022230
mov edi, dword [esp + 0x20]
mov ebp, dword [esp + 0x24]
cmp edx, 0x10
jae 0x1002226c
mov ebx, 0x10
lea ecx, [edi + edx]
sub esi, edi
sub ebx, edx
lea esp, [esp]
mov al, byte [esi + ecx]
lea ecx, [ecx + 1]
mov byte [ecx - 1], al
dec ebx
jne 0x10022260
push dword [esp + 0x18]
push edi
push edi
call fcn.10023300
add esp, 0xc
mov esi, edi
mov eax, dword [esi]
mov dword [ebp], eax
mov eax, dword [esi + 4]
mov dword [ebp + 4], eax
mov eax, dword [esi + 8]
mov dword [ebp + 8], eax
mov eax, dword [esi + 0xc]
jmp 0x1002249c
cmp ebx, edi
je 0x10022375
mov ebp, dword [esp + 0x54]
mov dword [esp + 0x14], ebp
cmp ebp, 0x10
jb 0x10022312
shr ebp, 4
mov dword [esp + 0x10], ebp
push ecx
push edi
push ebx
call fcn.100224c0
add esp, 0xc
lea edx, [esi + 2]
mov ecx, edi
sub esi, edi
mov ebp, 4
jmp 0x100222d0
movzx eax, byte [ecx + esi]
lea ecx, [ecx + 4]
xor byte [ecx - 4], al
lea edx, [edx + 4]
movzx eax, byte [edx - 5]
xor byte [ecx - 3], al
movzx eax, byte [edx - 4]
xor byte [ecx - 2], al
movzx eax, byte [edx - 3]
xor byte [ecx - 1], al
dec ebp
jne 0x100222d0
mov ebp, dword [esp + 0x14]
mov esi, ebx
mov ecx, dword [esp + 0x18]
sub ebp, 0x10
add ebx, 0x10
mov dword [esp + 0x14], ebp
add edi, 0x10
dec dword [esp + 0x10]
jne 0x100222b1
test ebp, ebp
je 0x10022348
push ecx
lea eax, [esp + 0x38]
push eax
push ebx
call fcn.100224c0
add esp, 0xc
xor edx, edx
test ebp, ebp
je 0x10022346
lea eax, [esp + 0x34]
sub esi, eax
sub edi, eax
lea ecx, [esp + 0x34]
add ecx, edx
inc edx
mov al, byte [ecx + esi]
xor al, byte [ecx]
mov byte [ecx + edi], al
cmp edx, ebp
jb 0x10022333
mov esi, ebx
mov ecx, dword [esp + 0x24]
mov eax, dword [esi]
pop edi
mov dword [ecx], eax
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
mov eax, dword [esi + 8]
mov dword [ecx + 8], eax
mov eax, dword [esi + 0xc]
pop esi
pop ebp
mov dword [ecx + 0xc], eax
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.1003cf2f
add esp, 0x38
ret
mov esi, dword [esp + 0x54]
cmp esi, 0x10
jb 0x10022432
lea eax, [ebp + 2]
mov dword [esp + 0x1c], eax
mov eax, ebp
sub eax, edi
mov dword [esp + 0x14], eax
mov eax, esi
shr eax, 4
mov dword [esp + 0x10], eax
lea ebx, [ebx]
mov eax, dword [ebx]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 4]
push ecx
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx + 0xc]
push edi
push ebx
mov dword [esp + 0x2c], eax
call fcn.100224c0
mov ecx, dword [esp + 0x28]
add esp, 0xc
mov edx, dword [esp + 0x14]
mov ebp, 4
movzx eax, byte [edx + edi]
lea ecx, [ecx + 4]
xor byte [edi], al
movzx eax, byte [ecx - 5]
xor byte [edi + 1], al
movzx eax, byte [ecx - 4]
xor byte [edi + 2], al
movzx eax, byte [ecx - 3]
xor byte [edi + 3], al
add edi, 4
dec ebp
jne 0x100223d3
mov ebp, dword [esp + 0x24]
sub edx, 0x10
mov eax, dword [esp + 0x2c]
sub esi, 0x10
mov ecx, dword [esp + 0x18]
add ebx, 0x10
dec dword [esp + 0x10]
mov dword [ebp], eax
mov eax, dword [esp + 0x30]
mov dword [ebp + 4], eax
mov eax, dword [esp + 0x28]
mov dword [ebp + 8], eax
mov eax, dword [esp + 0x20]
mov dword [ebp + 0xc], eax
mov dword [esp + 0x14], edx
jne 0x100223a0
test esi, esi
je 0x1002249f
mov eax, dword [ebx]
mov dword [esp + 0x34], eax
mov eax, dword [ebx + 4]
mov dword [esp + 0x38], eax
mov eax, dword [ebx + 8]
mov dword [esp + 0x3c], eax
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x40], eax
lea eax, [esp + 0x34]
push ecx
push eax
push eax
call fcn.100224c0
add esp, 0xc
xor edx, edx
test esi, esi
je 0x10022483
lea eax, [esp + 0x34]
mov ebx, ebp
sub ebx, eax
sub edi, eax
lea ecx, [esp + 0x34]
add ecx, edx
inc edx
mov al, byte [ebx + ecx]
xor al, byte [ecx]
mov byte [ecx + edi], al
cmp edx, esi
jb 0x10022470
mov eax, dword [esp + 0x34]
mov dword [ebp], eax
mov eax, dword [esp + 0x38]
mov dword [ebp + 4], eax
mov eax, dword [esp + 0x3c]
mov dword [ebp + 8], eax
mov eax, dword [esp + 0x40]
mov dword [ebp + 0xc], eax
mov ecx, dword [esp + 0x44]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.1003cf2f
add esp, 0x38
ret