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

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x14
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp + 8]
lea edi, [edx + 3]
test edx, edx
cmovns edi, edx
sar edi, 2
lea eax, [edi + 6]
cmp edx, 0x10
mov edx, 0xa
cmovge edx, eax
mov eax, ecx
mov dword [ecx], 4
mov dword [ecx + 4], edx
mov dword [ebp - 0x20], edx
lea esi, [edx*4 + 4]
test esi, esi
jle 0x101408c6
mov edx, edi
lea eax, [edi*4]
sub ecx, eax
mov eax, dword [ebp + 8]
add ecx, 8
mov dword [ebp - 0x18], ecx
xor ecx, ecx
xor edi, edi
inc edi
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], esi
cmp ecx, edx
jge 0x101407e4
mov edi, dword [ebp + 0xc]
mov edi, dword [edi + ecx*4]
bswap edi
jmp 0x101408b9
mov edi, dword [eax + ecx*4 + 4]
mov eax, ecx
mov esi, edx
cdq
idiv esi
test edx, edx
je 0x1014084d
cmp dword [ebp + 0x10], 0x1c
jl 0x101408aa
cmp edx, 4
jne 0x101408aa
mov edx, edi
shr edx, 0x18
mov esi, edi
shr esi, 0x10
mov ebx, 0xff
and esi, ebx
mov eax, edi
shr eax, 8
and eax, ebx
and edi, ebx
movzx edx, byte [edx + str.cw]
movzx esi, byte [esi + str.cw]
shl edx, 0x10
shl esi, 8
or esi, edx
movzx eax, byte [eax + str.cw]
or eax, esi
shl eax, 8
movzx edi, byte [edi + str.cw]
or edi, eax
jmp 0x101408aa
mov eax, edi
shr eax, 0x10
mov esi, 0xff
and eax, esi
mov edx, edi
shr edx, 8
and edx, esi
movzx eax, byte [eax + str.cw]
mov ebx, dword [ebp - 0x1c]
xor eax, ebx
movzx edx, byte [edx + str.cw]
shl eax, 0x10
shl edx, 8
or edx, eax
mov eax, edi
and eax, esi
movzx eax, byte [eax + str.cw]
or eax, edx
shr edi, 0x18
shl eax, 8
movzx edi, byte [edi + str.cw]
or edi, eax
lea eax, [ebx + ebx]
and eax, esi
movsx ebx, bl
shr ebx, 7
and ebx, 0x1b
xor ebx, eax
mov dword [ebp - 0x1c], ebx
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x14]
mov esi, dword [ebp - 0x10]
mov ebx, dword [ebp - 0x18]
xor edi, dword [ebx + ecx*4]
mov dword [eax + ecx*4 + 8], edi
inc ecx
cmp esi, ecx
jne 0x101407d3
mov esi, dword [ebp - 0x20]
test esi, esi
js 0x101409a2
mov edx, 4
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x10], 0
test edx, edx
jle 0x1014098e
xor ebx, ebx
mov esi, dword [ebp - 0x10]
mov edi, dword [eax + 4]
mov ecx, dword [ebp - 0x18]
add ecx, edi
imul ecx, edx
add ecx, ebx
mov ecx, dword [eax + ecx*4 + 8]
test esi, esi
je 0x10140974
cmp esi, edi
je 0x10140974
mov eax, ecx
shr eax, 0x18
mov dword [ebp - 0x14], eax
mov eax, ecx
shr eax, 0x10
mov edi, 0xff
and eax, edi
mov edi, ecx
shr edi, 8
mov esi, 0xff
and edi, esi
mov esi, dword [ebp - 0x14]
movzx esi, byte [esi + str.cw]
movzx eax, byte [eax + str.cw]
mov eax, dword [eax*4 + 0x10319540]
xor eax, dword [esi*4 + 0x10319140]
mov esi, 0xff
and ecx, esi
movzx esi, byte [edi + str.cw]
xor eax, dword [esi*4 + 0x10319940]
mov esi, dword [ebp - 0x10]
movzx ecx, byte [ecx + str.cw]
xor eax, dword [ecx*4 + 0x10319d40]
mov ecx, eax
mov eax, dword [ebp + 8]
imul edx, esi
add edx, ebx
mov dword [eax + edx*4 + 0x1e8], ecx
inc ebx
mov edx, dword [eax]
cmp ebx, edx
jl 0x101408f1
mov esi, dword [eax + 4]
mov edi, dword [ebp - 0x10]
lea ecx, [edi + 1]
dec dword [ebp - 0x18]
cmp edi, esi
mov dword [ebp - 0x10], ecx
jl 0x101408e4
add esp, 0x14
pop esi
pop edi
pop ebx
pop ebp
ret