Function at 0x41a230
Capabilities:
Encode data using xor
Encrypt data using aes
Encrypt data using rc4 ksa
Reference aes constants

Disassembly:
mov eax, dword [edi + 0x3cc]
sub esp, 0x28
cmp eax, 0x10
jne 0x41a251
mov eax, dword [esp + 0x2c]
push eax
push edi
mov eax, ecx
call fcn.00419e60
add esp, 0x28
ret 4
cdq
and edx, 3
add eax, edx
push esi
mov esi, eax
sar esi, 2
xor eax, eax
cmp esi, 4
je 0x41a26d
cmp esi, 6
setne al
add eax, 1
shl eax, 5
test esi, esi
mov edx, dword [eax + 0x500b80]
push ebx
push ebp
mov ebp, dword [eax + 0x500b88]
mov eax, dword [eax + 0x500b90]
mov dword [esp + 0x24], eax
mov dword [esp + 0x20], edx
mov dword [esp + 0x18], ebp
lea eax, [edi + 0x454]
jle 0x41a2ec
lea ebx, [edi + 8]
mov dword [esp + 0xc], ebx
mov dword [esp + 0x10], esi
movzx ebx, byte [ecx]
shl ebx, 0x18
mov dword [eax], ebx
movzx ebx, byte [ecx + 1]
add ecx, 1
shl ebx, 0x10
or dword [eax], ebx
add ecx, 1
xor ebx, ebx
mov bh, byte [ecx]
add ecx, 1
add ecx, 1
or dword [eax], ebx
movzx ebp, byte [ecx - 1]
or dword [eax], ebp
mov ebp, dword [esp + 0xc]
mov ebp, dword [ebp]
add dword [esp + 0xc], 4
mov ebx, eax
xor dword [ebx], ebp
add eax, 4
sub dword [esp + 0x10], 1
jne 0x41a2a5
mov ebp, dword [esp + 0x18]
mov eax, 1
cmp dword [edi + 0x3d0], eax
mov dword [esp + 0x1c], eax
jle 0x41a402
lea ecx, [edi + 0x28]
lea ebx, [edi + 0x434]
mov dword [esp + 0xc], ecx
mov edi, edi
test esi, esi
jle 0x41a3c4
mov eax, dword [esp + 0xc]
mov dword [esp + 0x10], eax
mov eax, ebp
mov ebp, dword [esp + 0x24]
sub eax, edx
sub ebp, edx
mov ecx, edx
mov dword [esp + 0x28], eax
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x14], esi
jmp 0x41a348
mov eax, dword [esp + 0x28]
mov ebp, dword [esp + 0x2c]
add eax, ecx
cdq
idiv esi
add ebx, 4
movzx eax, byte [edi + edx*4 + 0x455]
mov dword [esp + 0x30], eax
lea eax, [ecx + ebp]
cdq
idiv esi
mov eax, dword [esp + 0x30]
mov ebp, dword [eax*4 + 0x4fe358]
mov eax, ecx
add ecx, 1
mov edx, dword [edi + edx*4 + 0x454]
and edx, 0xff
xor ebp, dword [edx*4 + 0x4fe758]
cdq
idiv esi
movzx eax, byte [edi + edx*4 + 0x456]
movzx edx, byte [ebx + 0x1f]
and eax, 0xff
xor ebp, dword [eax*4 + 0x4fdf58]
mov eax, dword [esp + 0x10]
xor ebp, dword [edx*4 + 0x4fdb58]
add eax, 4
xor ebp, dword [eax - 4]
sub dword [esp + 0x14], 1
mov dword [ebx - 4], ebp
mov dword [esp + 0x10], eax
jne 0x41a340
mov ebp, dword [esp + 0x18]
lea eax, [esi*4]
push eax
lea ebx, [edi + 0x434]
lea eax, [edi + 0x454]
push ebx
push eax
call fcn.004c4ce0
mov eax, dword [esp + 0x28]
add dword [esp + 0x18], 0x20
mov edx, dword [esp + 0x2c]
add eax, 1
add esp, 0xc
cmp eax, dword [edi + 0x3d0]
mov dword [esp + 0x1c], eax
jl 0x41a310
test esi, esi
mov dword [esp + 0xc], 0
jle 0x41a4df
mov ecx, dword [esp + 0x38]
lea eax, [edi + 0x454]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x24]
sub edx, ebp
sub eax, ebp
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
mov eax, dword [edi + 0x3d0]
mov edx, dword [esp + 0xc]
lea eax, [edx + eax*8]
mov ebx, dword [edi + eax*4 + 8]
mov edx, dword [esp + 0x38]
movzx eax, byte [edx + 3]
mov edx, ebx
sar edx, 0x18
xor dl, byte [eax + str.cw]
mov eax, dword [esp + 0x30]
mov byte [ecx], dl
add eax, ebp
cdq
idiv esi
mov eax, ebx
sar eax, 0x10
add ecx, 1
add ecx, 1
add dword [esp + 0x38], 4
add ecx, 1
add ecx, 1
movzx edx, byte [edi + edx*4 + 0x456]
and edx, 0xff
xor al, byte [edx + str.cw]
mov byte [ecx - 3], al
mov eax, ebp
cdq
idiv esi
mov eax, ebx
sar eax, 8
movzx edx, byte [edi + edx*4 + 0x455]
xor al, byte [edx + str.cw]
mov edx, dword [esp + 0x2c]
mov byte [ecx - 2], al
lea eax, [edx + ebp]
cdq
idiv esi
add ebp, 1
mov eax, dword [edi + edx*4 + 0x454]
and eax, 0xff
movzx edx, byte [eax + str.cw]
mov eax, dword [esp + 0xc]
xor dl, bl
add eax, 1
cmp eax, esi
mov byte [ecx - 1], dl
mov dword [esp + 0xc], eax
jl 0x41a430
pop ebp
pop ebx
pop esi
add esp, 0x28
ret 4