Function at 0x4040ed
Capabilities:
Encode data using xor
Encrypt data using aes via x86 extensions

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x360
mov dword [esp + 0x1c], ecx
mov esi, dword [edx]
mov eax, dword [edx + 4]
mov ecx, dword [edx + 8]
mov edx, dword [edx + 0xc]
mov dword [esp + 0x14], ecx
mov ecx, edx
mov dword [esp + 0x18], eax
mov dword [esp + 8], edx
mov dword [esp + 0x10], esi
and ecx, 0xffffff8
shl ecx, 4
cmp edx, 8
mov dword [esp + 0xac], ecx
jb 0x4047b9
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 8]
xor edi, edi
mov dword [esp + 0xb0], 0
movaps xmm2, xmmword [ecx + 0x10]
movaps xmm1, xmmword [ecx + 0x20]
movdqa xmm0, xmmword [ecx]
shr eax, 3
mov dword [esp + 0x110], eax
movaps xmmword [esp + 0xf0], xmm2
movaps xmmword [esp + 0xe0], xmm1
movaps xmm2, xmmword [ecx + 0x30]
movaps xmm1, xmmword [ecx + 0x40]
movdqa xmmword [esp + 0x100], xmm0
movaps xmmword [esp + 0xd0], xmm2
movaps xmmword [esp + 0xc0], xmm1
movaps xmm2, xmmword [ecx + 0x50]
movaps xmm1, xmmword [ecx + 0x60]
movaps xmmword [esp + 0x1c0], xmm2
movaps xmmword [esp + 0x1b0], xmm1
movaps xmm2, xmmword [ecx + 0x70]
movaps xmm1, xmmword [ecx + 0x80]
movaps xmmword [esp + 0x1a0], xmm2
movaps xmmword [esp + 0x190], xmm1
movaps xmm2, xmmword [ecx + 0x90]
movaps xmm1, xmmword [ecx + 0xa0]
movaps xmmword [esp + 0x180], xmm2
movaps xmmword [esp + 0x170], xmm1
movaps xmm2, xmmword [ecx + 0xb0]
movaps xmm1, xmmword [ecx + 0xc0]
movaps xmmword [esp + 0x160], xmm2
movaps xmmword [esp + 0x150], xmm1
movdqa xmm2, xmmword [ecx + 0xd0]
movdqa xmm1, xmmword [ecx + 0xe0]
movdqa xmmword [esp + 0x140], xmm2
movdqa xmmword [esp + 0x130], xmm1
mov eax, 0xffffff80
mov dword [esp + 0xa0], 0
mov dword [esp + eax + 0xa4], edi
mov dword [esp + eax + 0xa0], edi
mov dword [esp + eax + 0xac], edi
mov dword [esp + eax + 0xa8], edi
inc dword [esp + 0xa0]
add eax, 0x10
jne 0x404233
push 0x80
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x258]
push eax
call fcn.00462380
add esp, 0xc
mov eax, 0xffffff80
mov dword [esp + 0xa0], 0
mov dword [esp + eax + 0xa4], edi
mov dword [esp + eax + 0xa0], edi
mov dword [esp + eax + 0xac], edi
mov dword [esp + eax + 0xa8], edi
inc dword [esp + 0xa0]
add eax, 0x10
jne 0x404285
push 0x80
lea eax, [esp + 0x24]
push eax
lea edi, [esp + 0x1d8]
push edi
call fcn.00462380
add esp, 0xc
mov eax, dword [esi]
mov ecx, dword [esi + 0x10]
xor edx, edx
pxor xmm2, xmm2
mov dword [esp + 0x120], eax
mov eax, dword [esp + 0x120]
mov dword [esp + 0xc], edi
xor edi, edi
movdqa xmmword [esp + 0x20], xmm2
lea esi, [eax + ecx]
test edi, edi
je 0x4042fe
mov eax, dword [esp + 0x10]
mov ebx, edi
mov eax, dword [eax + edi]
jmp 0x404302
xor ebx, ebx
mov eax, esi
add edi, 4
mov dword [esp + ebx + 0x20], eax
cmp edi, 0x10
jne 0x4042ef
movaps xmm0, xmmword [esp + 0x20]
mov eax, dword [esp + 0x10]
inc ecx
inc edx
movaps xmmword [esp + 0x2d0], xmm0
mov dword [eax + 0x10], ecx
mov eax, dword [esp + 0xc]
movq xmm0, qword [esp + 0x2d0]
movq xmm1, qword [esp + 0x2d8]
movq qword [eax + 8], xmm1
movq qword [eax], xmm0
mov eax, edx
shl eax, 4
cmp edx, 8
lea edi, [esp + eax + 0x1d0]
jne 0x4042d9
movdqu xmm0, xmmword [esp + 0x1d0]
movdqa xmm1, xmmword [esp + 0x100]
movdqu xmm2, xmmword [esp + 0x1e0]
movdqu xmm3, xmmword [esp + 0x1f0]
mov eax, 0xffffff80
pxor xmm0, xmm1
pxor xmm2, xmm1
pxor xmm3, xmm1
movdqa xmmword [esp + 0x20], xmm0
movdqa xmmword [esp + 0x30], xmm2
movdqu xmm2, xmmword [esp + 0x200]
movdqa xmmword [esp + 0x40], xmm3
movdqu xmm3, xmmword [esp + 0x210]
pxor xmm2, xmm1
pxor xmm3, xmm1
movdqa xmmword [esp + 0x50], xmm2
movdqu xmm2, xmmword [esp + 0x220]
movdqa xmmword [esp + 0x60], xmm3
movdqu xmm3, xmmword [esp + 0x230]
pxor xmm2, xmm1
pxor xmm3, xmm1
movdqa xmmword [esp + 0x70], xmm2
movdqu xmm2, xmmword [esp + 0x240]
movdqa xmmword [esp + 0x80], xmm3
pxor xmm2, xmm1
movdqa xmm1, xmmword [esp + 0xf0]
movdqa xmmword [esp + 0x90], xmm2
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404409
movdqa xmm1, xmmword [esp + 0xe0]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404433
movdqa xmm1, xmmword [esp + 0xd0]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x40445d
movdqa xmm1, xmmword [esp + 0xc0]
mov eax, 0xffffff80
xor esi, esi
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404489
movdqa xmm1, xmmword [esp + 0x1c0]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x4044b3
movdqa xmm1, xmmword [esp + 0x1b0]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x4044dd
movdqa xmm1, xmmword [esp + 0x1a0]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404507
movdqa xmm1, xmmword [esp + 0x190]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404531
movdqa xmm1, xmmword [esp + 0x180]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x40455b
movdqa xmm1, xmmword [esp + 0x170]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404585
movdqa xmm1, xmmword [esp + 0x160]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x4045af
movdqa xmm1, xmmword [esp + 0x150]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x4045d9
movdqa xmm1, xmmword [esp + 0x140]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenc xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x404603
movdqa xmm1, xmmword [esp + 0x130]
mov eax, 0xffffff80
movdqa xmm0, xmmword [esp + eax + 0xa0]
aesenclast xmm0, xmm1
movdqa xmmword [esp + eax + 0xa0], xmm0
add eax, 0x10
jne 0x40462d
mov ecx, dword [esp + 0xb0]
mov eax, dword [esp + 0x18]
movdqa xmm0, xmmword [esp + 0x20]
movdqa xmm1, xmmword [esp + 0x30]
movdqa xmm2, xmmword [esp + 0x40]
movdqa xmm3, xmmword [esp + 0x50]
movdqa xmm4, xmmword [esp + 0x60]
movdqa xmm5, xmmword [esp + 0x70]
movdqa xmm6, xmmword [esp + 0x80]
movdqa xmm7, xmmword [esp + 0x90]
shl ecx, 7
movdqu xmmword [esp + 0x250], xmm0
movdqu xmmword [esp + 0x260], xmm1
movdqu xmmword [esp + 0x270], xmm2
movdqu xmmword [esp + 0x280], xmm3
movdqu xmmword [esp + 0x290], xmm4
movdqu xmmword [esp + 0x2a0], xmm5
movdqu xmmword [esp + 0x2b0], xmm6
movdqu xmmword [esp + 0x2c0], xmm7
add eax, ecx
mov dword [esp + 0xc], ecx
push 0x80
push eax
lea eax, [esp + 0x2d8]
push eax
call fcn.00462380
add esp, 0xc
mov eax, 0xffffff80
mov dword [esp + 0xa0], 0
mov dword [esp + eax + 0xa4], esi
mov dword [esp + eax + 0xa0], esi
mov dword [esp + eax + 0xac], esi
mov dword [esp + eax + 0xa8], esi
inc dword [esp + 0xa0]
add eax, 0x10
jne 0x404701
push 0x80
lea eax, [esp + 0x24]
push eax
lea ebx, [esp + 0x1d8]
push ebx
call fcn.00462380
add esp, 0xc
xor esi, esi
lea ecx, [esp + 0x2d0]
lea edx, [esp + 0x250]
mov edi, 0xfffffff0
mov al, byte [edx + edi + 0x10]
xor al, byte [ecx + edi + 0x10]
mov byte [ebx + edi + 0x10], al
inc edi
jne 0x404758
inc esi
add ebx, 0x10
add edx, 0x10
add ecx, 0x10
cmp esi, 8
jne 0x404753
mov ecx, dword [esp + 0xc]
mov esi, dword [esp + 0xb0]
add ecx, dword [esp + 0x14]
inc esi
push 0x80
lea eax, [esp + 0x1d4]
push eax
push ecx
call fcn.00462380
add esp, 0xc
mov dword [esp + 0xb0], esi
cmp dword [esp + 0x110], esi
mov esi, dword [esp + 0x10]
mov edi, 0
jne 0x404223
mov eax, dword [esp + 0xac]
and dword [esp + 8], 7
xor ecx, ecx
mov dword [esp + 0xa0], 0
add dword [esp + 0x18], eax
add dword [esp + 0x14], eax
mov eax, 0xffffff80
mov dword [esp + eax + 0xa4], ecx
mov dword [esp + eax + 0xa0], ecx
mov dword [esp + eax + 0xac], ecx
mov dword [esp + eax + 0xa8], ecx
inc dword [esp + 0xa0]
add eax, 0x10
jne 0x4047df
lea edi, [esp + 0x1d0]
lea eax, [esp + 0x20]
push 0x80
push eax
push edi
call fcn.00462380
add esp, 0xc
cmp dword [esp + 8], 0
je 0x404a12
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 8]
movaps xmm0, xmmword [ecx]
movdqa xmm1, xmmword [ecx + 0x90]
movdqa xmm2, xmmword [ecx + 0xa0]
movdqa xmm3, xmmword [ecx + 0xb0]
movdqa xmm4, xmmword [ecx + 0xc0]
movdqa xmm5, xmmword [ecx + 0xd0]
movdqa xmm6, xmmword [ecx + 0xe0]
shl eax, 4
lea eax, [esp + eax + 0x1d0]
mov dword [esp + 0xc], eax
movaps xmmword [esp + 0x120], xmm0
movaps xmm0, xmmword [ecx + 0x10]
movaps xmmword [esp + 0xb0], xmm0
movaps xmm0, xmmword [ecx + 0x20]
movaps xmmword [esp + 0x110], xmm0
movaps xmm0, xmmword [ecx + 0x30]
movaps xmmword [esp + 0x100], xmm0
movaps xmm0, xmmword [ecx + 0x40]
movaps xmmword [esp + 0xf0], xmm0
movaps xmm0, xmmword [ecx + 0x50]
movaps xmmword [esp + 0xe0], xmm0
movaps xmm0, xmmword [ecx + 0x60]
movaps xmmword [esp + 0xd0], xmm0
movaps xmm0, xmmword [ecx + 0x70]
movaps xmmword [esp + 0xc0], xmm0
movdqa xmm0, xmmword [ecx + 0x80]
pxor xmm7, xmm7
xor ebx, ebx
movdqa xmmword [esp + 0x20], xmm7
mov ecx, dword [esi + 0x10]
mov eax, dword [esi]
add eax, ecx
test ebx, ebx
mov edx, eax
mov esi, 0
je 0x404900
mov edx, dword [esp + 0x10]
mov esi, ebx
mov edx, dword [edx + ebx]
add ebx, 4
mov dword [esp + esi + 0x20], edx
cmp ebx, 0x10
jne 0x4048ec
movdqa xmm7, xmmword [esp + 0x20]
mov esi, dword [esp + 0x10]
inc ecx
pxor xmm7, xmmword [esp + 0x120]
mov dword [esi + 0x10], ecx
aesenc xmm7, xmmword [esp + 0xb0]
aesenc xmm7, xmmword [esp + 0x110]
aesenc xmm7, xmmword [esp + 0x100]
aesenc xmm7, xmmword [esp + 0xf0]
aesenc xmm7, xmmword [esp + 0xe0]
aesenc xmm7, xmmword [esp + 0xd0]
aesenc xmm7, xmmword [esp + 0xc0]
aesenc xmm7, xmm0
aesenc xmm7, xmm1
aesenc xmm7, xmm2
aesenc xmm7, xmm3
aesenc xmm7, xmm4
aesenc xmm7, xmm5
aesenclast xmm7, xmm6
movdqu xmmword [edi], xmm7
add edi, 0x10
cmp edi, dword [esp + 0xc]
jne 0x4048d9
xor eax, eax
lea ecx, [esp + 0x1d0]
pxor xmm0, xmm0
mov esi, dword [esp + 0x18]
mov edx, eax
shl edx, 4
movq xmm1, qword [esi + edx]
movq xmm2, qword [esi + edx + 8]
mov esi, 0xfffffff0
movdqa xmmword [esp + 0x20], xmm0
movq qword [esp + 0x2d8], xmm2
movq qword [esp + 0x2d0], xmm1
mov bl, byte [ecx + esi + 0x10]
xor bl, byte [esp + esi + 0x2e0]
mov byte [esp + esi + 0x30], bl
inc esi
jne 0x4049db
inc eax
add ecx, 0x10
movq xmm1, qword [esp + 0x20]
movq xmm2, qword [esp + 0x28]
mov esi, dword [esp + 0x14]
cmp eax, dword [esp + 8]
movq qword [esi + edx + 8], xmm2
movq qword [esi + edx], xmm1
jne 0x4049aa
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret