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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push esi
mov esi, ecx
cmp byte [esi + 4], 0
jne 0x1001715a
push 0x1002c370
lea ecx, [ebp - 0x34]
call fcn.1000d5e8
push 0x10029ad0
lea eax, [ebp - 0x34]
push eax
call fcn.1000de51
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x1001717b
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
push ecx
push edx
mov ecx, esi
call fcn.10016950
pop esi
mov esp, ebp
pop ebp
ret 8
cdq
and edx, 3
push edi
lea edi, [edx + eax]
sar edi, 2
xor eax, eax
cmp edi, 4
je 0x10017194
cmp edi, 6
setne al
inc eax
shl eax, 5
mov edx, dword [eax + 0x100272a0]
mov ecx, dword [eax + 0x100272a8]
mov eax, dword [eax + 0x100272b0]
mov dword [ebp - 0x1c], eax
push ebx
mov dword [ebp - 8], edx
mov dword [ebp - 0x18], ecx
lea eax, [esi + 0x454]
test edi, edi
jle 0x1001720b
lea ecx, [esi + 8]
mov dword [ebp - 4], ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0xc], edi
lea esp, [esp]
movzx edx, byte [ecx]
shl edx, 0x18
mov dword [eax], edx
movzx edx, byte [ecx + 1]
shl edx, 0x10
or dword [eax], edx
movzx edx, byte [ecx + 2]
shl edx, 8
or dword [eax], edx
movzx ebx, byte [ecx + 3]
or dword [eax], ebx
mov ebx, dword [ebp - 4]
mov ebx, dword [ebx]
add dword [ebp - 4], 4
mov edx, eax
xor dword [edx], ebx
add ecx, 4
add eax, 4
dec dword [ebp - 0xc]
jne 0x100171d0
mov edx, dword [ebp - 8]
mov eax, 1
mov dword [ebp - 0x14], eax
cmp dword [esi + 0x3d0], eax
jle 0x10017315
lea eax, [esi + 0x28]
lea ebx, [esi + 0x434]
mov dword [ebp + 8], eax
jmp 0x10017230
test edi, edi
jle 0x100172dd
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x18]
mov dword [ebp - 4], ebx
mov ebx, dword [ebp - 0x1c]
sub eax, edx
sub ebx, edx
mov ecx, edx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x10], edi
jmp 0x1001725e
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp - 0x24]
add eax, ecx
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
sar eax, 8
and eax, 0xff
mov dword [ebp - 0x28], eax
lea eax, [ebx + ecx]
cdq
idiv edi
mov eax, dword [ebp - 0x28]
mov ebx, dword [eax*4 + 0x10024a78]
mov eax, ecx
inc ecx
mov edx, dword [esi + edx*4 + 0x454]
and edx, 0xff
xor ebx, dword [edx*4 + 0x10024e78]
cdq
idiv edi
movsx eax, word [esi + edx*4 + 0x456]
and eax, 0xff
xor ebx, dword [eax*4 + 0x10024678]
mov eax, dword [ebp - 4]
movzx edx, byte [eax + 0x23]
xor ebx, dword [edx*4 + 0x10024278]
mov edx, dword [ebp - 0xc]
xor ebx, dword [edx]
add edx, 4
mov dword [eax], ebx
add eax, 4
dec dword [ebp - 0x10]
mov dword [ebp - 0xc], edx
mov dword [ebp - 4], eax
jne 0x10017258
lea eax, [edi*4]
push eax
lea ebx, [esi + 0x434]
lea eax, [esi + 0x454]
push ebx
push eax
call fcn.1000d700
mov eax, dword [ebp - 0x14]
add dword [ebp + 8], 0x20
mov edx, dword [ebp - 8]
inc eax
add esp, 0xc
mov dword [ebp - 0x14], eax
cmp eax, dword [esi + 0x3d0]
jl 0x10017230
mov dword [ebp - 8], 0
test edi, edi
jle 0x100173e7
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp + 0xc]
sub edx, eax
mov dword [ebp - 0x28], edx
mov edx, dword [ebp - 0x1c]
lea ebx, [esi + 0x454]
sub edx, eax
mov dword [ebp + 8], eax
mov dword [ebp + 0xc], ebx
mov dword [ebp - 0x24], edx
mov eax, dword [esi + 0x3d0]
mov edx, dword [ebp - 8]
lea eax, [edx + eax*8]
mov ebx, dword [esi + eax*4 + 8]
mov edx, dword [ebp + 0xc]
movzx eax, byte [edx + 3]
mov edx, ebx
sar edx, 0x18
xor dl, byte [eax + str.cw]
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x28]
mov byte [ecx], dl
cdq
idiv edi
add dword [ebp + 0xc], 4
add ecx, 4
movsx eax, word [esi + edx*4 + 0x456]
and eax, 0xff
mov edx, ebx
sar edx, 0x10
xor dl, byte [eax + str.cw]
mov eax, dword [ebp + 8]
mov byte [ecx - 3], dl
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
sar eax, 8
and eax, 0xff
mov edx, ebx
sar edx, 8
xor dl, byte [eax + str.cw]
mov eax, dword [ebp + 8]
add eax, dword [ebp - 0x24]
mov byte [ecx - 2], dl
cdq
idiv edi
inc dword [ebp + 8]
mov eax, dword [esi + edx*4 + 0x454]
and eax, 0xff
mov dl, byte [eax + str.cw]
mov eax, dword [ebp - 8]
xor dl, bl
inc eax
mov byte [ecx - 1], dl
mov dword [ebp - 8], eax
cmp eax, edi
jl 0x10017343
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 8