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

Disassembly:
mov edx, dword [esp + 8]
sub esp, 0x1c
push ebx
mov ebx, dword [esp + 0x24]
cmp byte [ebx + 4], 0
jne 0x4310ff
push 0x501190
lea ecx, [esp + 0x18]
call fcn.004913de
push 0x4ecc6c
lea eax, [esp + 0x18]
push eax
call fcn.00494ebb
movzx ecx, byte [eax + 1]
push ebp
inc eax
push esi
inc eax
push edi
movzx edi, byte [eax - 2]
shl ecx, 0x10
inc eax
shl edi, 0x18
or edi, ecx
movzx ecx, byte [eax - 1]
shl ecx, 8
or edi, ecx
movzx ecx, byte [eax]
inc eax
movzx esi, byte [eax + 1]
inc eax
or edi, ecx
movzx ecx, byte [eax - 1]
shl esi, 0x10
inc eax
shl ecx, 0x18
or ecx, esi
movzx esi, byte [eax]
inc eax
shl esi, 8
or ecx, esi
movzx esi, byte [eax]
xor edi, dword [ebx + 0x1e8]
inc eax
movzx ebp, byte [eax + 1]
or ecx, esi
movzx esi, byte [eax]
xor ecx, dword [ebx + 0x1ec]
inc eax
shl ebp, 0x10
inc eax
shl esi, 0x18
or esi, ebp
movzx ebp, byte [eax]
shl ebp, 8
or esi, ebp
movzx ebp, byte [eax + 1]
inc eax
or esi, ebp
xor esi, dword [ebx + 0x1f0]
movzx ebx, byte [eax + 1]
inc eax
movzx ebp, byte [eax + 1]
inc eax
shl ebp, 0x10
shl ebx, 0x18
or ebx, ebp
movzx ebp, byte [eax + 1]
inc eax
movzx eax, byte [eax + 1]
shl ebp, 8
or ebp, eax
or ebp, ebx
mov ebx, dword [esp + 0x30]
mov eax, dword [ebx + 0x3d0]
xor ebp, dword [ebx + 0x1f4]
cmp eax, 1
mov dword [esp + 0x1c], eax
jle 0x431317
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 + 0x4e4ad0]
mov edx, dword [esp + 0x18]
xor eax, dword [edx*4 + 0x4e42d0]
mov edx, edi
sar edx, 0x10
and edx, 0xff
xor eax, dword [edx*4 + 0x4e46d0]
mov edx, esi
and edx, 0xff
xor eax, dword [edx*4 + 0x4e4ed0]
mov edx, esi
xor eax, dword [ebx - 4]
sar edx, 0x18
and edx, 0xff
mov edx, dword [edx*4 + 0x4e42d0]
mov ebx, ecx
sar ebx, 0x10
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4e46d0]
mov ebx, edi
sar ebx, 8
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4e4ad0]
mov ebx, ebp
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4e4ed0]
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 + 0x4e42d0]
xor edx, dword [ebx*4 + 0x4e46d0]
sar ebp, 0x10
mov ebx, ecx
sar ebx, 8
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4e4ad0]
and ebp, 0xff
mov ebp, dword [ebp*4 + 0x4e46d0]
sar esi, 8
mov ebx, edi
and esi, 0xff
xor ebp, dword [esi*4 + 0x4e4ad0]
mov esi, dword [esp + 0x18]
sar edi, 0x18
and edi, 0xff
xor ebp, dword [edi*4 + 0x4e42d0]
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4e4ed0]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx + 4]
and ecx, 0xff
xor ebp, dword [ecx*4 + 0x4e4ed0]
add ebx, 0x20
xor ebp, dword [ebx - 0x28]
sub dword [esp + 0x14], 1
mov edi, ebp
mov ecx, eax
mov ebp, edx
mov dword [esp + 0x10], ebx
jne 0x4311c5
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov eax, dword [esp + 0x1c]
shl eax, 5
lea eax, [eax + ebx + 0x1e8]
mov dword [esp + 0x34], eax
mov eax, dword [eax]
mov dword [esp + 0x30], eax
sar eax, 0x18
mov ebx, edi
sar ebx, 0x18
and ebx, 0xff
xor al, byte [ebx + 0x4e31d0]
mov ebx, dword [esp + 0x30]
mov byte [edx], al
sar ebx, 0x10
mov eax, ebp
sar eax, 0x10
and eax, 0xff
xor bl, byte [eax + 0x4e31d0]
mov eax, esi
sar eax, 8
mov byte [edx + 1], bl
mov ebx, dword [esp + 0x30]
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + 0x4e31d0]
mov eax, ecx
and eax, 0xff
mov byte [edx + 2], bl
movzx eax, byte [eax + 0x4e31d0]
xor al, byte [esp + 0x30]
mov ebx, ecx
mov byte [edx + 3], al
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 4]
mov dword [esp + 0x30], eax
sar eax, 0x18
sar ebx, 0x18
and ebx, 0xff
xor al, byte [ebx + 0x4e31d0]
mov ebx, dword [esp + 0x30]
mov byte [edx + 4], al
sar ebx, 0x10
mov eax, edi
sar eax, 0x10
and eax, 0xff
xor bl, byte [eax + 0x4e31d0]
mov eax, ebp
mov byte [edx + 5], bl
mov ebx, dword [esp + 0x30]
sar eax, 8
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + 0x4e31d0]
mov eax, esi
and eax, 0xff
mov byte [edx + 6], bl
movzx eax, byte [eax + 0x4e31d0]
xor al, byte [esp + 0x30]
mov ebx, esi
mov byte [edx + 7], al
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 8]
mov dword [esp + 0x30], eax
sar ebx, 0x18
sar eax, 0x18
and ebx, 0xff
xor al, byte [ebx + 0x4e31d0]
mov ebx, dword [esp + 0x30]
mov byte [edx + 8], al
mov eax, ecx
sar eax, 0x10
and eax, 0xff
sar ebx, 0x10
xor bl, byte [eax + 0x4e31d0]
mov eax, edi
mov byte [edx + 9], bl
mov ebx, dword [esp + 0x30]
sar eax, 8
and eax, 0xff
sar ebx, 8
xor bl, byte [eax + 0x4e31d0]
mov byte [edx + 0xa], bl
mov eax, ebp
and eax, 0xff
movzx eax, byte [eax + 0x4e31d0]
xor al, byte [esp + 0x30]
sar ebp, 0x18
mov byte [edx + 0xb], al
mov eax, dword [esp + 0x34]
mov eax, dword [eax + 0xc]
and ebp, 0xff
mov ebx, eax
sar ebx, 0x18
xor bl, byte [ebp + 0x4e31d0]
sar esi, 0x10
mov byte [edx + 0xc], bl
and esi, 0xff
mov ebx, eax
sar ebx, 0x10
xor bl, byte [esi + 0x4e31d0]
sar ecx, 8
mov byte [edx + 0xd], bl
and ecx, 0xff
mov ebx, eax
sar ebx, 8
xor bl, byte [ecx + 0x4e31d0]
and edi, 0xff
mov byte [edx + 0xe], bl
mov cl, byte [edi + 0x4e31d0]
pop edi
pop esi
xor cl, al
pop ebp
mov byte [edx + 0xf], cl
pop ebx
add esp, 0x1c
ret 8