Function at 0x4016b0
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, edx
push esi
push edi
test eax, eax
je 0x4016c9
cmp eax, 1
je 0x4016c9
cmp eax, 2
jne 0x4016e6
mov dword [ecx], eax
lea eax, [eax + eax*2]
movq xmm0, qword [eax*4 + 0x439800]
mov eax, dword [eax*4 + 0x439808]
movq qword [ecx + 4], xmm0
mov dword [ecx + 0xc], eax
mov esi, dword [ecx + 4]
xor edx, edx
test esi, esi
jle 0x401703
lea edi, [ecx + 0x10]
mov eax, dword [ebx + edx*4]
lea edi, [edi + 4]
mov dword [edi - 4], eax
inc edx
mov esi, dword [ecx + 4]
cmp edx, esi
jl 0x4016f2
mov edx, dword [ecx + 0xc]
lea eax, [edx*4 + 4]
cmp esi, eax
jge 0x4017ce
lea edi, [ecx + 0x10]
lea edi, [edi + esi*4]
nop dword [eax + eax]
mov eax, esi
mov ebx, dword [edi - 4]
cdq
idiv dword [ecx + 4]
mov dword [ebp + 0xc], ebx
test edx, edx
jne 0x401768
mov edx, ebx
shr edx, 8
movzx edx, dl
mov dl, byte [edx + 0x437ae0]
xor dl, byte [eax + 0x438be0]
movzx eax, byte [ebp + 0xe]
mov byte [ebp + 0xc], dl
movzx eax, byte [eax + 0x437ae0]
mov byte [ebp + 0xd], al
movzx eax, byte [ebp + 0xf]
movzx eax, byte [eax + 0x437ae0]
mov byte [ebp + 0xe], al
movzx eax, bl
jmp 0x4017a0
cmp dword [ecx + 4], 6
jle 0x4017aa
cmp edx, 4
jne 0x4017aa
movzx eax, bl
movzx eax, byte [eax + 0x437ae0]
mov byte [ebp + 0xc], al
movzx eax, byte [ebp + 0xd]
movzx eax, byte [eax + 0x437ae0]
mov byte [ebp + 0xd], al
movzx eax, byte [ebp + 0xe]
movzx eax, byte [eax + 0x437ae0]
mov byte [ebp + 0xe], al
movzx eax, byte [ebp + 0xf]
movzx eax, byte [eax + 0x437ae0]
mov byte [ebp + 0xf], al
mov eax, esi
inc esi
sub eax, dword [ecx + 4]
mov eax, dword [ecx + eax*4 + 0x10]
xor eax, dword [ebp + 0xc]
mov dword [edi], eax
add edi, 4
mov edx, dword [ecx + 0xc]
lea eax, [edx*4 + 4]
cmp esi, eax
jl 0x401720
mov eax, dword [ecx + 0x10]
mov ebx, 1
mov dword [ecx + 0x100], eax
mov eax, dword [ecx + 0x14]
mov dword [ecx + 0x104], eax
mov eax, dword [ecx + 0x18]
mov dword [ecx + 0x108], eax
mov eax, dword [ecx + 0x1c]
mov dword [ecx + 0x10c], eax
cmp edx, ebx
jle 0x4018d7
lea edi, [ecx + 0x22]
movzx eax, byte [edi + 1]
lea edi, [edi + 0x10]
movzx edx, byte [edi - 0x11]
inc ebx
mov esi, dword [eax*4 + 0x437be0]
xor esi, dword [edx*4 + 0x436ee0]
movzx eax, byte [edi - 0x12]
xor esi, dword [eax*4 + 0x4387e0]
movzx eax, byte [edi - 0x10]
xor esi, dword [eax*4 + 0x439400]
mov dword [edi + 0xde], esi
movzx eax, byte [edi - 0xb]
movzx edx, byte [edi - 0xc]
mov esi, dword [eax*4 + 0x437be0]
xor esi, dword [edx*4 + 0x439400]
movzx eax, byte [edi - 0xd]
xor esi, dword [eax*4 + 0x436ee0]
movzx eax, byte [edi - 0xe]
xor esi, dword [eax*4 + 0x4387e0]
mov dword [edi + 0xe2], esi
movzx eax, byte [edi - 7]
movzx edx, byte [edi - 8]
mov esi, dword [eax*4 + 0x437be0]
xor esi, dword [edx*4 + 0x439400]
movzx eax, byte [edi - 9]
xor esi, dword [eax*4 + 0x436ee0]
movzx eax, byte [edi - 0xa]
xor esi, dword [eax*4 + 0x4387e0]
mov dword [edi + 0xe6], esi
movzx eax, byte [edi - 3]
movzx edx, byte [edi - 4]
mov esi, dword [eax*4 + 0x437be0]
movzx eax, byte [edi - 5]
xor esi, dword [edx*4 + 0x439400]
xor esi, dword [eax*4 + 0x436ee0]
movzx eax, byte [edi - 6]
xor esi, dword [eax*4 + 0x4387e0]
mov dword [edi + 0xea], esi
cmp ebx, dword [ecx + 0xc]
jl 0x401802
mov esi, ebx
lea edx, [ebx + 0x10]
shl esi, 4
add edx, edx
add esi, ecx
pop edi
mov eax, dword [esi + 0x10]
mov dword [ecx + edx*8], eax
mov eax, dword [esi + 0x14]
mov edx, dword [ebp + 8]
mov dword [esi + 0x104], eax
mov eax, dword [esi + 0x18]
mov dword [esi + 0x108], eax
mov eax, dword [esi + 0x1c]
mov dword [esi + 0x10c], eax
mov eax, dword [edx]
mov dword [ecx + 0x1f0], eax
mov eax, dword [edx + 4]
mov dword [ecx + 0x1f4], eax
mov eax, dword [edx + 8]
mov dword [ecx + 0x1f8], eax
mov eax, dword [edx + 0xc]
pop esi
mov dword [ecx + 0x1fc], eax
xor eax, eax
pop ebx
pop ebp
ret