Function at 0x10022530
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x158
mov eax, dword [0x100a8024]
xor eax, esp
mov dword [esp + 0x154], eax
mov eax, dword [ebp + 8]
mov dword [esp + 0x48], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x4c], eax
push esi
mov esi, ecx
mov dword [esp + 0x44], 0xf
push edi
mov edi, edx
mov dword [esp + 0x1c], esi
mov dword [esp + 0x18], edi
mov edx, 1
mov eax, dword [esi + 0x5c]
mov ecx, dword [esi + 4]
mov dword [esp + 0x24], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x24]
mov dword [esp + 0x10], eax
mov eax, edi
sub eax, ecx
mov dword [esp + 0x20], ecx
mov ecx, dword [esi + 0xb8]
mov dword [esp + 0xc], eax
mov edi, dword [esp + 0xc]
shl edx, cl
mov ecx, dword [esi + 0x10]
sub edi, edx
sub eax, ecx
cmp eax, edx
mov eax, edi
mov edi, dword [esp + 0x18]
cmovbe eax, ecx
cmp dword [esi + 0x18], 0
cmovne eax, ecx
mov ecx, 4
mov dword [esp + 0x2c], eax
mov eax, dword [esi + 0xc4]
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [esi + 0x50]
mov dword [esp + 0x4c], eax
mov eax, 1
shl eax, cl
mov ecx, 0x18
cmp dword [esi + 0xdc], 0
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0xc]
jne 0x100227d1
mov edi, dword [esi + 0x1c]
sub eax, edi
cmp eax, 0x180
jbe 0x10022711
lea eax, [edi + 0x60]
mov dword [esp + 0x34], eax
cmp edi, eax
jae 0x10022697
sub ecx, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
add edx, 8
mov dword [esp + 0x38], ecx
mov dword [esp + 0x14], edx
nop word [eax + eax]
imul edx, dword [edi + edx], 0x9e3779b1
mov eax, edi
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov esi, ecx
mov edx, dword [esp + 0x28]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 8], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x48]
add ecx, eax
mov eax, dword [esp + 8]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x24]
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov dword [ecx + eax*4], edi
inc edi
mov ecx, dword [esp + 0x38]
cmp edi, dword [esp + 0x34]
jb 0x10022630
mov edi, dword [esp + 0xc]
mov ecx, dword [esp + 0x18]
add edi, 0xffffffe0
mov eax, dword [esp + 0x20]
inc ecx
add eax, edi
mov dword [esp + 0x38], edi
mov edx, edi
mov dword [esp + 8], edx
cmp eax, ecx
jbe 0x100226bb
xor ecx, ecx
jmp 0x100226c2
sub ecx, dword [esp + 0x20]
sub ecx, edi
inc ecx
mov eax, 8
cmp ecx, eax
cmova ecx, eax
add ecx, edi
mov dword [esp + 0x14], ecx
cmp edi, ecx
lea ecx, [eax + 0x10]
jae 0x10022711
sub ecx, dword [esi + 0x24]
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
imul edx, dword [edx + eax], 0x9e3779b1
mov eax, dword [esp + 8]
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov dword [esi + eax*4 + 0x2c], edx
mov edx, dword [esp + 8]
inc edx
mov dword [esp + 8], edx
cmp edx, edi
jb 0x100226e0
mov edi, dword [esp + 0x38]
mov ecx, 0x18
mov eax, dword [esi + 0x5c]
mov edx, dword [esi + 4]
mov dword [esp + 0x34], eax
mov eax, dword [esi + 0x28]
mov dword [esp + 0x14], eax
mov dword [esp + 0x40], edx
cmp edi, dword [esp + 0xc]
jae 0x1002279b
sub ecx, dword [esi + 0x24]
mov dword [esp + 8], ecx
imul edx, dword [edi + edx + 8], 0x9e3779b1
mov eax, edi
and eax, 7
xor edx, dword [esi + 0x50]
shr edx, cl
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov esi, ecx
mov edx, dword [esp + 0x14]
mov eax, 0
shr esi, 4
and esi, 0xffffff0
mov dword [esp + 0x38], ecx
add edx, esi
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, dword [esp + 0x48]
add ecx, eax
mov eax, dword [esp + 0x38]
mov byte [edx], cl
mov byte [ecx + edx], al
lea eax, [ecx + esi]
mov ecx, dword [esp + 0x34]
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x40]
mov dword [ecx + eax*4], edi
inc edi
mov ecx, dword [esp + 8]
cmp edi, dword [esp + 0xc]
jb 0x10022733
mov eax, dword [esp + 0x18]
mov ecx, 0x18
mov edi, dword [esp + 0xc]
sub ecx, dword [esp + 0x10]
mov dword [esi + 0x1c], edi
imul edx, dword [eax + 8], 0x9e3779b1
mov eax, edi
xor edx, dword [esp + 0x4c]
shr edx, cl
and eax, 7
mov ecx, dword [esi + eax*4 + 0x2c]
mov dword [esi + eax*4 + 0x2c], edx
mov edx, ecx
mov dword [esp + 0x10], ecx
jmp 0x100227e8
imul edx, dword [edi], 0x9e3779b1
sub ecx, dword [esp + 0x10]
mov dword [esi + 0x1c], eax
xor edx, dword [esp + 0x4c]
shr edx, cl
mov dword [esp + 0x10], edx
mov ecx, dword [esp + 0x24]
mov eax, edx
add dword [esi + 0x58], edx
shr eax, 4
and eax, 0xffffff0
mov dword [esp + 8], 0
lea ecx, [ecx + eax*4]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x28]
add ecx, eax
movsx eax, dl
mov dword [esp + 0x14], ecx
movzx edi, byte [ecx]
movd xmm0, eax
and edi, 0xf
punpcklbw xmm0, xmm0
punpcklwd xmm0, xmm0
pshufd xmm1, xmm0, 0
movups xmm0, xmmword [ecx]
mov ecx, edi
mov dword [esp + 0x40], edi
neg ecx
pcmpeqb xmm0, xmm1
and ecx, 0xf
pmovmskb edx, xmm0
mov ax, dx
shl ax, cl
mov cx, di
shr dx, cl
or ax, dx
movzx eax, ax
cdq
mov dword [esp + 0x28], edx
mov edi, eax
test edx, edx
jne 0x10022863
test edi, edi
je 0x100228bb
xor esi, esi
cmp dword [esp + 0x30], 0
jbe 0x100228b3
push edx
push edi
call fcn.10021700
add eax, dword [esp + 0x48]
add esp, 8
and eax, 0xf
je 0x10022895
mov ecx, dword [esp + 0x24]
mov eax, dword [ecx + eax*4]
cmp eax, dword [esp + 0x2c]
jb 0x100228b3
mov dword [esp + esi*4 + 0x58], eax
inc esi
dec dword [esp + 0x30]
mov edx, dword [esp + 0x28]
mov ecx, edi
add ecx, 0xffffffff
mov eax, edx
adc eax, 0xffffffff
and edi, ecx
and edx, eax
mov dword [esp + 0x28], edx
ja 0x10022865
jb 0x100228b3
test edi, edi
jne 0x10022865
mov dword [esp + 8], esi
mov esi, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov eax, 0
mov edi, 0xf
movzx ecx, byte [edx]
dec ecx
and ecx, 0xf
cmove eax, edi
add ecx, eax
mov eax, dword [esp + 0x10]
mov byte [edx], cl
mov byte [ecx + edx], al
mov edx, dword [esp + 0x24]
mov eax, dword [esi + 0x1c]
mov dword [edx + ecx*4], eax
inc dword [esi + 0x1c]
cmp dword [esp + 8], 0
jbe 0x10022964
mov ecx, dword [esp + 0x18]
xor esi, esi
mov edi, 3
nop dword [eax]
mov edx, dword [esp + 0x20]
add edx, dword [esp + esi*4 + 0x58]
mov eax, dword [edx + edi - 3]
cmp eax, dword [edi + ecx - 3]
jne 0x10022947
push dword [esp + 0x50]
call fcn.1001b4b0
add esp, 4
cmp eax, edi
jbe 0x10022943
mov ecx, dword [esp + 0xc]
mov edi, eax
sub ecx, dword [esp + esi*4 + 0x58]
mov edx, dword [esp + 0x54]
add ecx, 3
mov dword [edx], ecx
mov ecx, dword [esp + 0x18]
add eax, ecx
cmp eax, dword [esp + 0x50]
je 0x1002294e
jmp 0x10022947
mov ecx, dword [esp + 0x18]
inc esi
cmp esi, dword [esp + 8]
jb 0x10022900
mov eax, edi
pop edi
pop esi
mov ecx, dword [esp + 0x154]
xor ecx, esp
call fcn.10071030
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x15c]
mov eax, 3
pop edi
pop esi
xor ecx, esp
call fcn.10071030
mov esp, ebp
pop ebp
ret