Function at 0x1001a850
Capabilities:
Encrypt data using aes
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
push ecx
mov eax, dword [ebp + 0x14]
cdq
and edx, 3
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
lea edi, [edx + eax]
mov eax, dword [ebp + 0xc]
cdq
and edx, 3
sar edi, 2
add edx, eax
mov dword [ebp - 4], edi
sar edx, 2
cmp edx, edi
mov dword [esi + 0x3e8], edx
mov ecx, edx
cmovle ecx, edi
add ecx, 6
mov dword [esi + 0x3ec], ecx
cmp edx, 8
jne 0x1001a8a7
mov dword [esi + 0x3c0], 0x1001a350
mov dword [esi + 0x3c4], 0x10019580
jmp 0x1001a8db
cmp edx, 6
jne 0x1001a8c2
mov dword [esi + 0x3c0], 0x10019ee0
mov dword [esi + 0x3c4], 0x100190e0
jmp 0x1001a8db
cmp edx, 4
jne 0x1001a8db
mov dword [esi + 0x3c0], 0x10019c40
mov dword [esi + 0x3c4], 0x10018e30
lea eax, [ecx + 1]
mov dword [ebp + 0x14], 1
imul eax, edx
xor ebx, ebx
test eax, eax
jle 0x1001a9e3
mov ecx, edi
mov edx, esi
mov edi, dword [ebp + 0x10]
lea eax, [ecx*4]
sub edx, eax
add edi, 2
mov dword [ebp + 0xc], edx
cmp ebx, ecx
jge 0x1001a92f
movzx ecx, byte [edi - 2]
movzx eax, byte [edi - 1]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi]
shl ecx, 8
or ecx, eax
movzx eax, byte [edi + 1]
shl ecx, 8
or ecx, eax
jmp 0x1001a9b7
mov eax, esi
sub eax, dword [ebp + 0x10]
mov eax, dword [eax + edi - 6]
mov dword [ebp + 8], eax
mov eax, ebx
cdq
idiv ecx
test edx, edx
jne 0x1001aaa1
mov edx, dword [ebp + 8]
mov eax, edx
shr eax, 0x10
movzx eax, al
movzx ecx, byte [eax + 0x1008ea98]
mov eax, edx
xor ecx, dword [ebp + 0x14]
shr eax, 8
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + 0x1008ea98]
or ecx, eax
movzx eax, dl
shl ecx, 8
shr edx, 0x18
movzx eax, byte [eax + 0x1008ea98]
or ecx, eax
movzx eax, byte [edx + 0x1008ea98]
shl ecx, 8
or ecx, eax
mov dword [ebp + 8], ecx
mov ecx, dword [ebp + 0x14]
mov eax, ecx
and al, 0x80
movzx eax, al
neg eax
sbb eax, eax
and ecx, 0x7f
and eax, 0x1b
add ecx, ecx
xor ecx, eax
mov dword [ebp + 0x14], ecx
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov ecx, dword [edx]
xor ecx, eax
mov dword [esi + ebx*4], ecx
add edx, 4
mov eax, dword [esi + 0x3ec]
inc ebx
mov ecx, dword [ebp - 4]
add edi, 4
mov dword [ebp + 8], eax
inc eax
imul eax, dword [esi + 0x3e8]
mov dword [ebp + 0xc], edx
cmp ebx, eax
jl 0x1001a908
mov ecx, dword [ebp + 8]
xor ebx, ebx
test ecx, ecx
js 0x1001aa9a
nop dword [eax]
mov eax, dword [esi + 0x3e8]
xor edi, edi
test eax, eax
jle 0x1001aa8d
mov edx, dword [esi + 0x3ec]
mov ecx, edx
sub ecx, ebx
imul ecx, eax
add ecx, edi
mov ecx, dword [esi + ecx*4]
mov dword [ebp + 8], ecx
test ebx, ebx
je 0x1001aa72
cmp ebx, edx
je 0x1001aa72
shr ecx, 0x10
movzx ecx, cl
movzx edx, byte [ecx + 0x1008ea98]
mov ecx, dword [ebp + 8]
shr ecx, 8
movzx ecx, cl
mov edx, dword [edx*4 + 0x10090098]
movzx ecx, byte [ecx + 0x1008ea98]
xor edx, dword [ecx*4 + 0x10090498]
mov ecx, dword [ebp + 8]
shr ecx, 0x18
movzx ecx, byte [ecx + 0x1008ea98]
xor edx, dword [ecx*4 + 0x1008fc98]
mov ecx, dword [ebp + 8]
movzx ecx, cl
movzx ecx, byte [ecx + 0x1008ea98]
xor edx, dword [ecx*4 + 0x10090898]
mov ecx, edx
imul eax, ebx
add eax, edi
inc edi
mov dword [esi + eax*4 + 0x1e0], ecx
mov eax, dword [esi + 0x3e8]
cmp edi, eax
jl 0x1001aa00
inc ebx
cmp ebx, dword [esi + 0x3ec]
jle 0x1001a9f0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp edx, 4
jne 0x1001a9ad
cmp ecx, 6
jle 0x1001a9ad
mov edx, dword [ebp + 8]
mov eax, edx
shr eax, 0x10
movzx eax, al
movzx ecx, byte [eax + 0x1008ea98]
mov eax, edx
shr eax, 0x18
movzx eax, byte [eax + 0x1008ea98]
shl eax, 8
or ecx, eax
mov eax, edx
shr eax, 8
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + 0x1008ea98]
or ecx, eax
movzx eax, dl
shl ecx, 8
movzx eax, byte [eax + 0x1008ea98]
or eax, ecx
jmp 0x1001a9b0