Function at 0x409190
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 0x4091e9
mov dword [esi + 0x3c0], 0x408b00
mov dword [esi + 0x3c4], 0x407c60
jmp 0x40921d
cmp eax, 6
jne 0x409204
mov dword [esi + 0x3c0], 0x4086a0
mov dword [esi + 0x3c4], 0x4077f0
jmp 0x40921d
cmp eax, 4
jne 0x40921d
mov dword [esi + 0x3c0], 0x4083c0
mov dword [esi + 0x3c4], 0x407500
lea ecx, [edx + 1]
mov dword [ebp + 0xc], 1
imul ecx, eax
xor edi, edi
test ecx, ecx
jle 0x409376
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 0x409277
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 0x40933e
mov eax, edi
mov ebx, dword [esi + edi*4 - 4]
cdq
idiv ecx
test edx, edx
jne 0x4092e4
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 0x409331
cmp edx, 4
jne 0x409331
cmp ecx, 6
jle 0x409331
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 0x409250
mov edx, dword [ebp - 8]
xor ebx, ebx
test edx, edx
js 0x40942a
xor edi, edi
test eax, eax
jle 0x40941d
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 0x409402
cmp ebx, edx
je 0x409402
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 + 0x48b870]
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x48bc70]
mov ecx, dword [ebp + 0x14]
shr ecx, 0x18
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x48b470]
mov ecx, dword [ebp + 0x14]
movzx ecx, cl
movzx ecx, byte [ecx + str.cw]
xor edx, dword [ecx*4 + 0x48c070]
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 0x409390
inc ebx
cmp ebx, dword [esi + 0x3ec]
jle 0x409380
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret