Function at 0x41a610
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, dword [esp + 0x3c]
push esi
push edi
xor edi, edi
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], edi
test ebp, ebp
je 0x41aa28
mov edx, dword [esp + 0x40]
test edx, edx
je 0x41aa35
mov eax, dword [esp + 0x10]
mov ecx, eax
mov ebx, dword [0x7aa6b8]
and ecx, 0x20
mov dword [esp + 0x24], ecx
mov esi, 0x800
cmp edx, esi
cmovb esi, edx
cmp word [esp + 0x24], 0
mov dword [esp + 0x18], esi
je 0x41a71b
mov dword [0x7aa6b0], 0
test edi, edi
jne 0x41a6d2
mov ebx, eax
and ebx, 1
push ebp
lea eax, [ebx*8 + 9]
mov word [esp + 0x30], ax
xor eax, eax
mov dword [esp + 0x32], eax
mov eax, dword [ebp + 0xc]
call eax
movzx edi, al
mov eax, dword [ebp + 0xc]
push ebp
call eax
mov edx, dword [esp + 0x18]
add esp, 8
movzx eax, al
shl ax, 8
or ax, di
mov edi, ebx
xor edi, 1
movzx eax, ax
inc edi
mov dword [esp + 0x44], eax
shl edi, 0xe
test dl, 0x10
je 0x41a6d6
xor eax, eax
mov word [0x7aa6bc], ax
jmp 0x41a6d6
mov edx, dword [esp + 0x10]
lea ecx, [esp + 0x44]
movzx eax, si
push ecx
push eax
push ecx
test dl, 1
lea ecx, [esp + 0x38]
mov edx, ebp
je 0x41a6f2
call fcn.00419f90
jmp 0x41a6f7
call fcn.00419c70
add esp, 0xc
test eax, eax
je 0x41aa28
cmp eax, esi
jne 0x41aa1e
mov ebx, dword [0x7aa6b8]
sub edi, esi
mov dword [esp + 0x20], edi
jmp 0x41a7dd
test al, 1
je 0x41a7a2
mov dword [esp + 0x28], esi
test al, 8
je 0x41a75d
test esi, esi
jle 0x41a791
nop
mov eax, dword [ebp + 0xc]
dec esi
push ebp
call eax
movzx eax, al
shl ax, 8
movzx edi, ax
mov eax, dword [ebp + 0xc]
push ebp
call eax
movzx eax, al
lea ebx, [ebx + 2]
or ax, di
add esp, 8
mov word [ebx - 2], ax
test esi, esi
jg 0x41a730
jmp 0x41a78d
test esi, esi
jle 0x41a791
mov esi, dword [esp + 0x28]
mov eax, dword [ebp + 0xc]
dec esi
push ebp
call eax
movzx edi, al
mov eax, dword [ebp + 0xc]
push ebp
call eax
movzx eax, al
lea ebx, [ebx + 2]
shl ax, 8
add esp, 8
or ax, di
mov word [ebx - 2], ax
test esi, esi
jg 0x41a765
mov esi, dword [esp + 0x18]
mov eax, dword [ebp + 0x10]
push ebp
call eax
mov ebx, dword [0x7aa6b8]
add esp, 4
jmp 0x41a7d7
mov eax, dword [ebp + 8]
push esi
push ebx
push ebp
call eax
mov ebx, dword [0x7aa6b8]
add esp, 0xc
lea ecx, [ebx + esi]
lea edx, [ebx + esi*2]
test esi, esi
jle 0x41a7d7
mov edi, esi
nop
movsx ax, byte [ecx - 1]
lea ecx, [ecx - 1]
lea edx, [edx - 2]
shl ax, 8
mov word [edx], ax
sub edi, 1
jne 0x41a7c0
sub dword [0x7aa6b0], esi
mov edx, dword [esp + 0x10]
test dl, 0x10
je 0x41a807
xor eax, eax
test esi, esi
jle 0x41a807
mov cx, word [0x7aa6bc]
add word [ebx + eax*2], cx
mov cx, word [ebx + eax*2]
inc eax
cmp eax, esi
jl 0x41a7f3
mov word [0x7aa6bc], cx
mov al, dl
xor al, byte [esp + 0x38]
test al, 4
je 0x41a899
xor ecx, ecx
test esi, esi
jle 0x41a899
cmp esi, 0x20
jb 0x41a88a
mov eax, esi
and eax, 0x8000001f
jns 0x41a832
dec eax
or eax, 0xffffffe0
inc eax
movaps xmm2, xmmword [0x4a98b0]
mov edx, esi
sub edx, eax
lea eax, [ebx + 0x20]
movups xmm0, xmmword [eax - 0x20]
lea eax, [eax + 0x40]
add ecx, 0x20
movaps xmm1, xmm2
pxor xmm1, xmm0
movups xmmword [eax - 0x60], xmm1
movaps xmm1, xmm2
movups xmm0, xmmword [eax - 0x50]
pxor xmm1, xmm0
movups xmmword [eax - 0x50], xmm1
movaps xmm1, xmm2
movups xmm0, xmmword [eax - 0x40]
pxor xmm1, xmm0
movups xmmword [eax - 0x40], xmm1
movaps xmm1, xmm2
movups xmm0, xmmword [eax - 0x30]
pxor xmm1, xmm0
movups xmmword [eax - 0x30], xmm1
cmp ecx, edx
jl 0x41a840
cmp ecx, esi
jge 0x41a899
mov eax, 0xffff8000
nop
xor word [ebx + ecx*2], ax
inc ecx
cmp ecx, esi
jl 0x41a890
cmp dword [esp + 0x3c], 0
mov edx, dword [esp + 0x40]
je 0x41a8f7
xor ecx, ecx
xor edi, edi
mov dword [esp + 0x18], ecx
test esi, esi
jle 0x41a8f3
test edx, edx
je 0x41a8f3
mov edx, dword [esp + 0x3c]
xor eax, eax
nop word [eax + eax]
cmp edi, esi
jge 0x41a8d0
movsx ecx, word [ebx + edi*2]
inc edi
add eax, ecx
sub edx, 1
jne 0x41a8c0
mov ecx, dword [esp + 0x3c]
sub ecx, edx
cdq
idiv ecx
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x40]
dec edx
mov dword [esp + 0x40], edx
mov word [ebx + ecx*2], ax
inc ecx
mov dword [esp + 0x18], ecx
cmp edi, esi
jl 0x41a8b0
mov esi, ecx
jmp 0x41a8fd
sub edx, esi
mov dword [esp + 0x40], edx
test byte [esp + 0x38], 1
je 0x41a92a
xor ecx, ecx
test esi, esi
jle 0x41aa0d
mov edi, dword [esp + 0x1c]
mov ax, word [ebx + ecx*2]
inc ecx
mov word [edi], ax
add edi, 2
cmp ecx, esi
jl 0x41a912
mov dword [esp + 0x1c], edi
jmp 0x41aa0d
xor edi, edi
test esi, esi
jle 0x41aa0d
mov edx, dword [esp + 0x14]
cmp esi, 0x20
jb 0x41a9f2
lea eax, [esi - 1]
lea ecx, [edx - 1]
lea eax, [ebx + eax*2]
add ecx, esi
cmp edx, eax
ja 0x41a958
cmp ecx, ebx
jae 0x41a9f2
mov eax, esi
and eax, 0x8000001f
jns 0x41a966
dec eax
or eax, 0xffffffe0
inc eax
mov ecx, esi
sub ecx, eax
mov eax, 8
movd xmm1, eax
lea eax, [ebx + 0x20]
movups xmm0, xmmword [eax - 0x20]
add edi, 0x20
lea eax, [eax + 0x40]
psraw xmm0, xmm1
pand xmm0, xmmword [0x4a9870]
packuswb xmm0, xmm0
movq qword [edx], xmm0
movups xmm0, xmmword [eax - 0x50]
psraw xmm0, xmm1
pand xmm0, xmmword [0x4a9870]
packuswb xmm0, xmm0
movq qword [edx + 8], xmm0
movups xmm0, xmmword [eax - 0x40]
psraw xmm0, xmm1
pand xmm0, xmmword [0x4a9870]
packuswb xmm0, xmm0
movq qword [edx + 0x10], xmm0
movups xmm0, xmmword [eax - 0x30]
psraw xmm0, xmm1
pand xmm0, xmmword [0x4a9870]
packuswb xmm0, xmm0
movq qword [edx + 0x18], xmm0
add edx, 0x20
cmp edi, ecx
jl 0x41a976
mov dword [esp + 0x28], edi
mov dword [esp + 0x14], edx
cmp edi, esi
jge 0x41aa09
lea ecx, [ebx + edi*2]
sub esi, edi
mov al, byte [ecx + 1]
lea ecx, [ecx + 2]
mov byte [edx], al
inc edx
sub esi, 1
jne 0x41a9f7
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x40]
test edx, edx
je 0x41aa35
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x20]
jmp 0x41a654
mov dword [0x4d9b5c], 0xf
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x24
ret
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret