Function at 0x407c90
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 0x407ce9
mov dword [esi + 0x3c0], 0x407600
mov dword [esi + 0x3c4], 0x406770
jmp 0x407d1d
cmp eax, 6
jne 0x407d04
mov dword [esi + 0x3c0], 0x4071b0
mov dword [esi + 0x3c4], 0x406300
jmp 0x407d1d
cmp eax, 4
jne 0x407d1d
mov dword [esi + 0x3c0], 0x406ed0
mov dword [esi + 0x3c4], 0x406010
lea ecx, [edx + 1]
mov dword [ebp + 0xc], 1
imul ecx, eax
xor edi, edi
test ecx, ecx
jle 0x407e76
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 0x407d77
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 0x407e3e
mov eax, edi
mov ebx, dword [esi + edi*4 - 4]
cdq
idiv ecx
test edx, edx
jne 0x407de4
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 0x407e31
cmp edx, 4
jne 0x407e31
cmp ecx, 6
jle 0x407e31
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 0x407d50
mov edx, dword [ebp - 8]
xor ebx, ebx
test edx, edx
js 0x407f2a
xor edi, edi
test eax, eax
jle 0x407f1d
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 0x407f02
cmp ebx, edx
je 0x407f02
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 + 0x468458]
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x468858]
mov ecx, dword [ebp + 0x14]
shr ecx, 0x18
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x468058]
mov ecx, dword [ebp + 0x14]
movzx ecx, cl
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x468c58]
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 0x407e90
inc ebx
cmp ebx, dword [esi + 0x3ec]
jle 0x407e80
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret