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

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, dword [ebp + 0x14]
cdq
and edx, 3
push ebx
push esi
mov esi, dword [ebp + 8]
lea ecx, [edx + eax]
mov eax, dword [ebp + 0xc]
cdq
and edx, 3
sar ecx, 2
add eax, edx
mov dword [ebp - 4], ecx
sar eax, 2
cmp eax, ecx
mov dword [esi + 0x3e8], eax
mov edx, eax
cmovle edx, ecx
add edx, 6
mov dword [esi + 0x3ec], edx
push edi
cmp eax, 8
jne 0x407d19
mov dword [esi + 0x3c0], 0x407630
mov dword [esi + 0x3c4], 0x406790
jmp 0x407d4d
cmp eax, 6
jne 0x407d34
mov dword [esi + 0x3c0], 0x4071e0
mov dword [esi + 0x3c4], 0x406320
jmp 0x407d4d
cmp eax, 4
jne 0x407d4d
mov dword [esi + 0x3c0], 0x406f00
mov dword [esi + 0x3c4], 0x406030
lea ecx, [edx + 1]
mov dword [ebp + 0xc], 1
imul ecx, eax
xor edi, edi
test ecx, ecx
jle 0x407ea6
mov ecx, dword [ebp - 4]
mov ebx, esi
mov edx, dword [ebp + 0x10]
lea eax, [ecx*4]
sub ebx, eax
add edx, 2
mov dword [ebp + 0x14], ebx
mov dword [ebp + 8], edx
nop
cmp edi, ecx
jge 0x407da7
movzx ecx, byte [edx - 2]
movzx eax, byte [edx - 1]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx]
shl ecx, 8
or ecx, eax
movzx eax, byte [edx + 1]
shl ecx, 8
or ecx, eax
jmp 0x407e6e
mov eax, edi
mov ebx, dword [esi + edi*4 - 4]
cdq
idiv ecx
test edx, edx
jne 0x407e14
mov edx, dword [ebp + 0xc]
mov eax, ebx
shr eax, 0x10
movzx eax, al
movzx ecx, byte [eax + str.cw]
mov eax, ebx
shr eax, 8
xor ecx, edx
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + str.cw]
or ecx, eax
movzx eax, bl
shl ecx, 8
shr ebx, 0x18
movzx eax, byte [eax + str.cw]
or ecx, eax
mov eax, edx
movzx ebx, byte [ebx + str.cw]
and al, 0x80
shl ecx, 8
movzx eax, al
or ebx, ecx
neg eax
sbb eax, eax
and edx, 0x7f
and eax, 0x1b
add edx, edx
xor edx, eax
mov dword [ebp + 0xc], edx
jmp 0x407e61
cmp edx, 4
jne 0x407e61
cmp ecx, 6
jle 0x407e61
mov eax, ebx
shr eax, 0x10
movzx eax, al
movzx ecx, byte [eax + str.cw]
mov eax, ebx
shr eax, 0x18
movzx eax, byte [eax + str.cw]
shl eax, 8
or ecx, eax
mov eax, ebx
shr eax, 8
movzx eax, al
shl ecx, 8
movzx eax, byte [eax + str.cw]
or ecx, eax
movzx eax, bl
shl ecx, 8
movzx ebx, byte [eax + str.cw]
or ebx, ecx
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 8]
mov ecx, dword [ecx]
xor ecx, ebx
mov ebx, dword [ebp + 0x14]
lea eax, [edi*4]
add edx, 4
mov dword [eax + esi], ecx
inc edi
mov ecx, dword [esi + 0x3ec]
add ebx, 4
mov eax, dword [esi + 0x3e8]
mov dword [ebp - 8], ecx
inc ecx
imul ecx, eax
mov dword [ebp + 8], edx
mov dword [ebp + 0x14], ebx
cmp edi, ecx
mov ecx, dword [ebp - 4]
jl 0x407d80
mov edx, dword [ebp - 8]
xor ebx, ebx
test edx, edx
js 0x407f5a
xor edi, edi
test eax, eax
jle 0x407f4d
nop word [eax + eax]
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 + 0x14], ecx
test ebx, ebx
je 0x407f32
cmp ebx, edx
je 0x407f32
shr ecx, 0x10
movzx ecx, cl
movzx edx, byte [ecx + str.cw]
mov ecx, dword [ebp + 0x14]
shr ecx, 8
movzx ecx, cl
mov edx, dword [edx*4 + 0x472458]
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x472858]
mov ecx, dword [ebp + 0x14]
shr ecx, 0x18
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x472058]
mov ecx, dword [ebp + 0x14]
movzx ecx, cl
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x472c58]
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 0x407ec0
inc ebx
cmp ebx, dword [esi + 0x3ec]
jle 0x407eb0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret