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

Disassembly:
mov edx, dword [esp + 8]
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x18]
cmp byte [ebx + 4], 0
je 0x4175bc
movzx ecx, byte [eax + 1]
push ebp
push esi
movzx esi, byte [eax + 5]
push edi
movzx edi, byte [eax]
shl ecx, 0x10
shl edi, 0x18
or edi, ecx
movzx ecx, byte [eax + 2]
shl ecx, 8
or edi, ecx
movzx ecx, byte [eax + 3]
movzx ebp, byte [eax + 9]
or edi, ecx
movzx ecx, byte [eax + 4]
shl esi, 0x10
shl ecx, 0x18
or ecx, esi
movzx esi, byte [eax + 6]
xor edi, dword [ebx + 0x1e8]
shl esi, 8
or ecx, esi
movzx esi, byte [eax + 7]
or ecx, esi
movzx esi, byte [eax + 8]
xor ecx, dword [ebx + 0x1ec]
shl ebp, 0x10
shl esi, 0x18
or esi, ebp
movzx ebp, byte [eax + 0xa]
shl ebp, 8
or esi, ebp
movzx ebp, byte [eax + 0xb]
or esi, ebp
xor esi, dword [ebx + 0x1f0]
movzx ebx, byte [eax + 0xc]
movzx ebp, byte [eax + 0xd]
shl ebp, 0x10
shl ebx, 0x18
or ebx, ebp
movzx ebp, byte [eax + 0xe]
movzx eax, byte [eax + 0xf]
shl ebp, 8
or ebp, eax
or ebp, ebx
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx + 0x3d0]
xor ebp, dword [ebx + 0x1f4]
mov dword [esp + 0x1c], eax
cmp eax, 1
jle 0x417413
add ebx, 0x210
dec eax
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], eax
mov edx, ebp
sar edx, 8
and edx, 0xff
mov eax, ecx
sar eax, 0x18
and eax, 0xff
mov dword [esp + 0x18], eax
mov eax, dword [edx*4 + 0x61fb98]
mov edx, dword [esp + 0x18]
xor eax, dword [edx*4 + 0x61f398]
mov edx, edi
sar edx, 0x10
and edx, 0xff
xor eax, dword [edx*4 + 0x61f798]
mov edx, esi
and edx, 0xff
xor eax, dword [edx*4 + 0x61ff98]
mov edx, esi
xor eax, dword [ebx - 4]
sar edx, 0x18
and edx, 0xff
mov edx, dword [edx*4 + 0x61f398]
mov ebx, ecx
sar ebx, 0x10
and ebx, 0xff
xor edx, dword [ebx*4 + 0x61f798]
mov ebx, edi
sar ebx, 8
and ebx, 0xff
xor edx, dword [ebx*4 + 0x61fb98]
mov ebx, ebp
and ebx, 0xff
xor edx, dword [ebx*4 + 0x61ff98]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx]
mov ebx, esi
mov dword [esp + 0x18], edx
mov edx, ebp
sar edx, 0x18
sar ebx, 0x10
and ebx, 0xff
and edx, 0xff
mov edx, dword [edx*4 + 0x61f398]
xor edx, dword [ebx*4 + 0x61f798]
sar ebp, 0x10
mov ebx, ecx
sar ebx, 8
and ebx, 0xff
xor edx, dword [ebx*4 + 0x61fb98]
and ebp, 0xff
mov ebp, dword [ebp*4 + 0x61f798]
sar esi, 8
mov ebx, edi
and esi, 0xff
xor ebp, dword [esi*4 + 0x61fb98]
mov esi, dword [esp + 0x18]
sar edi, 0x18
and edi, 0xff
xor ebp, dword [edi*4 + 0x61f398]
and ebx, 0xff
xor edx, dword [ebx*4 + 0x61ff98]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx + 4]
and ecx, 0xff
xor ebp, dword [ecx*4 + 0x61ff98]
add ebx, 0x20
xor ebp, dword [ebx - 0x28]
dec dword [esp + 0x14]
mov edi, ebp
mov ecx, eax
mov ebp, edx
mov dword [esp + 0x10], ebx
jne 0x4172c2
mov ebx, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
mov eax, dword [esp + 0x1c]
shl eax, 5
lea eax, [eax + ebx + 0x1e8]
mov dword [esp + 0x28], eax
mov eax, dword [eax]
mov dword [esp + 0x24], eax
sar eax, 0x18
mov ebx, edi
sar ebx, 0x18
and ebx, 0xff
xor al, byte [ebx + 0x61e298]
mov ebx, dword [esp + 0x24]
mov byte [edx], al
sar ebx, 0x10
mov eax, ebp
sar eax, 0x10
and eax, 0xff
xor bl, byte [eax + 0x61e298]
mov eax, esi
sar eax, 8
mov byte [edx + 1], bl
mov ebx, dword [esp + 0x24]
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + 0x61e298]
mov eax, ecx
and eax, 0xff
mov byte [edx + 2], bl
movzx eax, byte [eax + 0x61e298]
xor al, byte [esp + 0x24]
mov ebx, ecx
mov byte [edx + 3], al
mov eax, dword [esp + 0x28]
mov eax, dword [eax + 4]
mov dword [esp + 0x24], eax
sar eax, 0x18
sar ebx, 0x18
and ebx, 0xff
xor al, byte [ebx + 0x61e298]
mov ebx, dword [esp + 0x24]
mov byte [edx + 4], al
sar ebx, 0x10
mov eax, edi
sar eax, 0x10
and eax, 0xff
xor bl, byte [eax + 0x61e298]
mov eax, ebp
mov byte [edx + 5], bl
mov ebx, dword [esp + 0x24]
sar eax, 8
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + 0x61e298]
mov eax, esi
and eax, 0xff
mov byte [edx + 6], bl
movzx eax, byte [eax + 0x61e298]
xor al, byte [esp + 0x24]
mov ebx, esi
mov byte [edx + 7], al
mov eax, dword [esp + 0x28]
mov eax, dword [eax + 8]
mov dword [esp + 0x24], eax
sar ebx, 0x18
sar eax, 0x18
and ebx, 0xff
xor al, byte [ebx + 0x61e298]
mov ebx, dword [esp + 0x24]
mov byte [edx + 8], al
mov eax, ecx
sar eax, 0x10
and eax, 0xff
sar ebx, 0x10
xor bl, byte [eax + 0x61e298]
mov eax, edi
mov byte [edx + 9], bl
mov ebx, dword [esp + 0x24]
sar eax, 8
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + 0x61e298]
mov byte [edx + 0xa], bl
mov eax, ebp
and eax, 0xff
movzx eax, byte [eax + 0x61e298]
xor al, byte [esp + 0x24]
sar ebp, 0x18
mov byte [edx + 0xb], al
mov eax, dword [esp + 0x28]
mov eax, dword [eax + 0xc]
and ebp, 0xff
mov ebx, eax
sar ebx, 0x18
xor bl, byte [ebp + 0x61e298]
sar esi, 0x10
mov byte [edx + 0xc], bl
and esi, 0xff
mov ebx, eax
sar ebx, 0x10
xor bl, byte [esi + 0x61e298]
sar ecx, 8
mov byte [edx + 0xd], bl
and ecx, 0xff
mov ebx, eax
sar ebx, 8
xor bl, byte [ecx + 0x61e298]
and edi, 0xff
mov byte [edx + 0xe], bl
mov cl, byte [edi + 0x61e298]
pop edi
xor cl, al
pop esi
mov byte [edx + 0xf], cl
pop ebp
pop ebx
add esp, 0x10
ret 8