Function at 0x46ec60
Capabilities:
Encrypt data using aes via x86 extensions

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
and esp, 0xfffffff0
sub esp, 0x30
mov edx, dword [ebp + 0x20]
mov eax, dword [ebp + 0x14]
and edx, 3
cmp edx, 1
sbb ebx, ebx
and ebx, 0xfffffff0
cmp edx, 1
sbb esi, esi
and esi, 0x10
mov dword [esp + 0x2c], esi
test eax, eax
je 0x46efc0
mov edx, dword [ebp + 0x20]
mov esi, 0xfffffff0
and edx, 2
cmp edx, 1
sbb ecx, ecx
and ecx, 0xfffffff0
cmp edx, 1
mov edx, dword [ebp + 0x20]
sbb edi, edi
and edi, 0x10
and edx, 4
mov edx, 0x10
setne byte [esp + 0x22]
sete byte [esp + 0x23]
test byte [ebp + 0x20], 8
je 0x46ecdd
mov edx, dword [ebp + 0x1c]
mov dword [esp + 0x2c], ebx
mov edi, ecx
sub edx, 0x10
add dword [ebp + 0x10], edx
add eax, edx
add dword [ebp + 0x18], edx
mov edx, esi
test byte [ebp + 0x20], 0x10
je 0x46ee9e
cmp dword [ebp + 0x1c], 0x3f
jbe 0x46ee9e
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp + 0x20]
mov dword [esp + 0x24], edi
movdqa xmm7, xmmword [0x5d4b60]
mov ebx, dword [ebp + 0x18]
movdqa xmm6, xmmword [0x5d4b70]
shl ecx, 4
add ecx, dword [ebp + 8]
and esi, 1
movdqa xmm5, xmmword [0x5d4b80]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp + 0x1c]
mov dword [esp + 4], esi
lea esi, [edi*4]
mov dword [esp + 8], esi
mov esi, dword [ebp + 0x18]
mov dword [esp + 0x28], ecx
lea esi, [esi + edi*2]
nop
mov edi, dword [ebp + 0x10]
mov ecx, dword [esp + 4]
movdqu xmm1, xmmword [edi]
test ecx, ecx
je 0x46ef90
movdqa xmm4, xmm7
paddd xmm4, xmm1
movdqa xmm3, xmm4
movdqa xmm4, xmm6
paddd xmm4, xmm1
movdqa xmm2, xmm4
movdqa xmm4, xmm5
paddd xmm4, xmm1
movdqa xmm0, xmm4
movdqa xmm4, xmmword [0x5d4b90]
paddd xmm4, xmm1
movups xmmword [edi], xmm4
cmp byte [esp + 0x22], 0
je 0x46edb5
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm1, xmm4
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm3, xmm4
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm2, xmm4
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm0, xmm4
mov edi, dword [ebp + 8]
cmp dword [ebp + 0xc], 1
movdqa xmm4, xmmword [edi]
movaps xmmword [esp + 0x10], xmm4
pxor xmm1, xmm4
pxor xmm3, xmm4
pxor xmm2, xmm4
pxor xmm0, xmm4
jbe 0x46ee02
lea ecx, [edi + 0x10]
mov edi, dword [esp + 0x24]
nop
aesenc xmm1, xmmword [ecx]
aesenc xmm3, xmmword [ecx]
aesenc xmm2, xmmword [ecx]
add ecx, 0x10
aesenc xmm0, xmmword [ecx - 0x10]
cmp dword [esp + 0xc], ecx
jne 0x46ede0
mov dword [esp + 0x24], edi
mov edi, dword [esp + 0xc]
cmp byte [esp + 0x23], 0
movdqa xmm4, xmmword [edi]
movaps xmmword [esp + 0x10], xmm4
aesenclast xmm1, xmm4
aesenclast xmm3, xmm4
aesenclast xmm2, xmm4
aesenclast xmm0, xmm4
je 0x46ee52
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm1, xmm4
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm3, xmm4
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm2, xmm4
movdqu xmm4, xmmword [eax]
add eax, edx
pxor xmm0, xmm4
mov edi, dword [esp + 0x24]
movups xmmword [ebx], xmm1
movups xmmword [ebx + edi], xmm3
movups xmmword [esi], xmm2
movups xmmword [esi + edi], xmm0
mov edi, dword [esp + 8]
sub dword [esp + 0x28], 0x40
mov ecx, dword [esp + 0x28]
add ebx, edi
add esi, edi
cmp ecx, 0x3f
ja 0x46ed40
mov esi, dword [ebp + 0x1c]
mov edi, dword [esp + 0x24]
and dword [ebp + 0x1c], 0x3f
lea ecx, [esi - 0x40]
mov esi, dword [ebp + 0x18]
shr ecx, 6
add ecx, 1
imul ecx, edi
lea esi, [esi + ecx*4]
mov dword [ebp + 0x18], esi
cmp dword [ebp + 0x1c], 0xf
jbe 0x46eff0
mov esi, dword [ebp + 0xc]
mov ebx, dword [ebp + 0x20]
sub esi, 1
and ebx, 1
mov dword [esp + 0x24], esi
mov esi, dword [ebp + 0xc]
mov dword [esp + 0x28], ebx
mov ebx, dword [ebp + 8]
lea ecx, [esi + 0xfffffff]
mov esi, dword [ebp + 8]
shl ecx, 4
add ebx, ecx
lea esi, [esi + ecx + 0x10]
mov dword [esp + 0x10], ebx
mov ebx, dword [ebp + 0xc]
lea ecx, [ebx - 3]
mov ebx, dword [ebp + 8]
shr ecx, 1
shl ecx, 5
lea ebx, [ebx + ecx + 0x30]
mov ecx, dword [ebp + 0x1c]
mov dword [esp + 0xc], ebx
mov ebx, dword [ebp + 0x10]
cmp byte [esp + 0x22], 0
movdqu xmm0, xmmword [ebx]
je 0x46ef07
movdqu xmm5, xmmword [eax]
pxor xmm0, xmm5
mov ebx, dword [esp + 0x28]
test ebx, ebx
je 0x46ef16
mov ebx, dword [ebp + 0x10]
add byte [ebx + 0xf], 1
mov ebx, dword [ebp + 8]
cmp dword [esp + 0x24], 1
pxor xmm0, xmmword [ebx]
jbe 0x46ef44
add ebx, 0x10
mov esi, esi
lea edi, [edi]
aesenc xmm0, xmmword [ebx]
add ebx, 0x20
aesenc xmm0, xmmword [ebx - 0x10]
cmp dword [esp + 0xc], ebx
jne 0x46ef30
mov ebx, dword [esp + 0x10]
cmp byte [esp + 0x23], 0
aesenc xmm0, xmmword [ebx]
aesenclast xmm0, xmmword [esi]
je 0x46ef61
movdqu xmm6, xmmword [eax]
pxor xmm0, xmm6
mov ebx, dword [ebp + 0x18]
sub ecx, 0x10
add dword [ebp + 0x18], edi
add eax, edx
movups xmmword [ebx], xmm0
mov ebx, dword [esp + 0x2c]
add dword [ebp + 0x10], ebx
cmp ecx, 0xf
ja 0x46eef1
mov eax, dword [ebp + 0x1c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
and eax, 0xf
pop edi
pop ebp
ret
mov edi, dword [esp + 0x2c]
mov ecx, dword [ebp + 0x10]
add ecx, edi
movdqu xmm3, xmmword [ecx]
add ecx, edi
movdqu xmm2, xmmword [ecx]
add ecx, edi
mov edi, dword [esp + 0x2c]
movdqu xmm0, xmmword [ecx]
add edi, ecx
mov dword [ebp + 0x10], edi
jmp 0x46ed86
mov edx, dword [ebp + 0x20]
mov byte [esp + 0x22], 0
mov byte [esp + 0x23], 0
and edx, 2
cmp edx, 1
sbb ecx, ecx
xor esi, esi
and ecx, 0xfffffff0
cmp edx, 1
sbb edi, edi
xor edx, edx
and edi, 0x10
jmp 0x46ecc1
mov eax, dword [ebp + 0x1c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret