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

Disassembly:
mov ecx, dword [esp + 4]
sub esp, 0xc
cmp dword [0x4c4720], 0
je 0x407869
movzx eax, byte [0x4c2d80]
movzx edx, byte [0x4c2d81]
shl edx, 0x10
shl eax, 0x18
or eax, edx
movzx edx, byte [0x4c2d82]
shl edx, 8
or eax, edx
movzx edx, byte [0x4c2d83]
or eax, edx
movzx edx, byte [0x4c2d85]
push ebx
push ebp
shl edx, 0x10
push esi
movzx esi, byte [0x4c2d84]
shl esi, 0x18
or esi, edx
movzx edx, byte [0x4c2d86]
shl edx, 8
or esi, edx
movzx edx, byte [0x4c2d87]
movzx ebx, byte [0x4c2d8d]
or esi, edx
movzx edx, byte [0x4c2d89]
movzx ebp, byte [0x4c2d8e]
push edi
movzx edi, byte [0x4c2d88]
shl edx, 0x10
shl edi, 0x18
or edi, edx
movzx edx, byte [0x4c2d8a]
xor eax, dword [0x4c2fc0]
xor esi, dword [0x4c2fc4]
shl edx, 8
or edi, edx
movzx edx, byte [0x4c2d8b]
or edi, edx
movzx edx, byte [0x4c2d8c]
xor edi, dword [0x4c2fc8]
shl edx, 0x18
shl ebx, 0x10
or edx, ebx
movzx ebx, byte [0x4c2d8f]
shl ebp, 8
or ebp, ebx
or ebp, edx
mov edx, dword [0x4c472c]
xor ebp, dword [0x4c2fcc]
cmp edx, 1
jle 0x4076b8
mov ebx, 0x4c2fe8
dec edx
mov dword [esp + 0x10], ebx
mov dword [esp + 0x14], edx
lea esp, [esp]
mov edx, edi
sar edx, 0x10
and edx, 0xff
mov ecx, ebp
sar ecx, 8
and ecx, 0xff
mov ecx, dword [ecx*4 + 0x4a48f0]
xor ecx, dword [edx*4 + 0x4a44f0]
mov edx, esi
sar edx, 0x18
and edx, 0xff
xor ecx, dword [edx*4 + 0x4a40f0]
mov edx, eax
and edx, 0xff
xor ecx, dword [edx*4 + 0x4a4cf0]
mov edx, ebp
xor ecx, dword [ebx - 4]
sar edx, 0x10
and edx, 0xff
mov edx, dword [edx*4 + 0x4a44f0]
mov ebx, edi
sar ebx, 0x18
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a40f0]
mov ebx, eax
sar ebx, 8
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a48f0]
mov ebx, esi
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4cf0]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx]
mov ebx, esi
mov dword [esp + 0x18], edx
sar ebx, 8
mov edx, ebp
sar edx, 0x18
and ebx, 0xff
and edx, 0xff
mov edx, dword [edx*4 + 0x4a40f0]
xor edx, dword [ebx*4 + 0x4a48f0]
mov ebx, eax
sar ebx, 0x10
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a44f0]
mov ebx, edi
sar edi, 8
and edi, 0xff
mov edi, dword [edi*4 + 0x4a48f0]
sar esi, 0x10
and esi, 0xff
xor edi, dword [esi*4 + 0x4a44f0]
sar eax, 0x18
and eax, 0xff
xor edi, dword [eax*4 + 0x4a40f0]
and ebx, 0xff
xor edx, dword [ebx*4 + 0x4a4cf0]
mov ebx, dword [esp + 0x10]
xor edx, dword [ebx + 4]
and ebp, 0xff
xor edi, dword [ebp*4 + 0x4a4cf0]
add ebx, 0x20
xor edi, dword [ebx - 0x28]
sub dword [esp + 0x14], 1
mov eax, edi
mov edi, dword [esp + 0x18]
mov esi, ecx
mov ebp, edx
mov dword [esp + 0x10], ebx
jne 0x407570
mov ecx, dword [esp + 0x20]
mov edx, dword [0x4c472c]
shl edx, 5
add edx, 0x4c2fc0
mov dword [esp + 0x14], edx
mov edx, dword [edx]
mov dword [esp + 0x10], edx
sar edx, 0x18
mov ebx, eax
sar ebx, 0x18
and ebx, 0xff
xor dl, byte [ebx + 0x4a3ef0]
mov ebx, dword [esp + 0x10]
mov byte [ecx], dl
sar ebx, 0x10
mov edx, esi
sar edx, 0x10
and edx, 0xff
xor bl, byte [edx + 0x4a3ef0]
mov edx, edi
sar edx, 8
mov byte [ecx + 1], bl
mov ebx, dword [esp + 0x10]
and edx, 0xff
sar ebx, 8
xor bl, byte [edx + 0x4a3ef0]
mov edx, ebp
and edx, 0xff
mov byte [ecx + 2], bl
movzx edx, byte [edx + 0x4a3ef0]
xor dl, byte [esp + 0x10]
mov ebx, esi
mov byte [ecx + 3], dl
mov edx, dword [esp + 0x14]
mov edx, dword [edx + 4]
mov dword [esp + 0x10], edx
sar edx, 0x18
sar ebx, 0x18
and ebx, 0xff
xor dl, byte [ebx + 0x4a3ef0]
mov ebx, dword [esp + 0x10]
mov byte [ecx + 4], dl
sar ebx, 0x10
mov edx, edi
sar edx, 0x10
and edx, 0xff
xor bl, byte [edx + 0x4a3ef0]
mov edx, ebp
mov byte [ecx + 5], bl
mov ebx, dword [esp + 0x10]
sar edx, 8
and edx, 0xff
sar ebx, 8
xor bl, byte [edx + 0x4a3ef0]
mov edx, eax
and edx, 0xff
mov byte [ecx + 6], bl
movzx edx, byte [edx + 0x4a3ef0]
xor dl, byte [esp + 0x10]
mov ebx, edi
mov byte [ecx + 7], dl
mov edx, dword [esp + 0x14]
mov edx, dword [edx + 8]
mov dword [esp + 0x10], edx
sar ebx, 0x18
sar edx, 0x18
and ebx, 0xff
xor dl, byte [ebx + 0x4a3ef0]
mov ebx, dword [esp + 0x10]
mov byte [ecx + 8], dl
mov edx, ebp
sar edx, 0x10
and edx, 0xff
sar ebx, 0x10
xor bl, byte [edx + 0x4a3ef0]
mov edx, eax
mov byte [ecx + 9], bl
mov ebx, dword [esp + 0x10]
sar edx, 8
and edx, 0xff
sar ebx, 8
xor bl, byte [edx + 0x4a3ef0]
mov byte [ecx + 0xa], bl
mov edx, esi
and edx, 0xff
movzx edx, byte [edx + 0x4a3ef0]
xor dl, byte [esp + 0x10]
sar ebp, 0x18
mov byte [ecx + 0xb], dl
mov edx, dword [esp + 0x14]
mov edx, dword [edx + 0xc]
and ebp, 0xff
mov ebx, edx
sar ebx, 0x18
xor bl, byte [ebp + 0x4a3ef0]
sar eax, 0x10
mov byte [ecx + 0xc], bl
and eax, 0xff
mov ebx, edx
sar ebx, 0x10
xor bl, byte [eax + 0x4a3ef0]
sar esi, 8
and esi, 0xff
mov eax, edx
sar eax, 8
mov byte [ecx + 0xd], bl
xor al, byte [esi + 0x4a3ef0]
and edi, 0xff
mov byte [ecx + 0xe], al
mov al, byte [edi + 0x4a3ef0]
pop edi
pop esi
xor al, dl
pop ebp
mov byte [ecx + 0xf], al
pop ebx
add esp, 0xc
ret
sub esp, 0x20
cmp dword [0x4c4720], 0
mov ecx, 0x4c2d80
je 0x407eca
mov eax, dword [0x4c4728]
cmp eax, 0x10
jne 0x407c77
add esp, 0x20
jmp 0x407470
cdq
and edx, 3
add eax, edx
push esi
mov esi, eax
sar esi, 2
xor eax, eax
cmp esi, 4
je 0x407c91
cmp esi, 6
setne al
inc eax
push ebx
shl eax, 5
mov edx, dword [eax + 0x4a7118]
push ebp
push edi
mov edi, dword [eax + 0x4a7120]
mov eax, dword [eax + 0x4a7128]
xor ebx, ebx
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], edi
mov eax, 0x4c2f80
test esi, esi
jle 0x407cfb
movzx edi, byte [ecx]
shl edi, 0x18
mov dword [eax], edi
movzx edi, byte [ecx + 1]
inc ecx
shl edi, 0x10
or dword [eax], edi
movzx edi, byte [ecx + 1]
inc ecx
movzx ebp, byte [ecx + 1]
inc ecx
shl edi, 8
or dword [eax], edi
or dword [eax], ebp
mov ebp, dword [ebx*4 + 0x4c2fc0]
mov edi, eax
xor dword [edi], ebp
inc ebx
inc ecx
add eax, 4
cmp ebx, esi
jl 0x407cc0
mov edi, dword [esp + 0x14]
mov ebx, dword [0x4c472c]
cmp ebx, 1
jle 0x407dfe
lea ecx, [ebx - 1]
mov dword [esp + 0x10], 0x4c2fe0
mov dword [esp + 0x18], ecx
lea esp, [esp]
xor edi, edi
test esi, esi
jle 0x407dcc
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x10]
sub eax, edx
sub ebp, edx
mov ecx, edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], ebp
jmp 0x407d4e
mov eax, dword [esp + 0x24]
mov ebp, dword [esp + 0x28]
add eax, ecx
cdq
idiv esi
inc edi
add ebx, 4
mov eax, dword [edx*4 + 0x4c2f80]
sar eax, 8
and eax, 0xff
mov dword [esp + 0x2c], eax
lea eax, [ecx + ebp]
cdq
idiv esi
mov eax, dword [esp + 0x2c]
mov ebp, dword [eax*4 + 0x4a48f0]
mov eax, ecx
inc ecx
mov edx, dword [edx*4 + 0x4c2f80]
and edx, 0xff
xor ebp, dword [edx*4 + 0x4a4cf0]
cdq
idiv esi
movsx eax, word [edx*4 + 0x4c2f82]
movzx edx, byte [edi*4 + 0x4c2f7f]
and eax, 0xff
xor ebp, dword [eax*4 + 0x4a44f0]
xor ebp, dword [edx*4 + 0x4a40f0]
xor ebp, dword [ebx - 4]
cmp edi, esi
mov dword [edi*4 + 0x4c319c], ebp
jl 0x407d46
mov ebx, dword [0x4c472c]
lea eax, [esi*4]
push eax
push 0x4c31a0
push 0x4c2f80
call fcn.00466150
add dword [esp + 0x1c], 0x20
mov edx, dword [esp + 0x28]
add esp, 0xc
sub dword [esp + 0x18], 1
jne 0x407d20
mov edi, dword [esp + 0x14]
xor ebp, ebp
test esi, esi
jle 0x407ec6
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x34]
shl ebx, 5
add ebx, 0x4c2fc0
sub edx, edi
sub eax, edi
mov dword [esp + 0x14], ebx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], eax
lea esp, [esp]
mov eax, dword [esp + 0x14]
mov ebx, dword [eax]
movzx edx, byte [ebp*4 + 0x4c2f83]
mov eax, ebx
sar eax, 0x18
xor al, byte [edx + 0x4a3ef0]
mov edx, dword [esp + 0x2c]
mov byte [ecx], al
lea eax, [edx + edi]
cdq
idiv esi
inc ecx
inc ecx
add dword [esp + 0x14], 4
inc ecx
inc ebp
inc ecx
movsx eax, word [edx*4 + 0x4c2f82]
and eax, 0xff
mov edx, ebx
sar edx, 0x10
xor dl, byte [eax + 0x4a3ef0]
mov eax, edi
mov byte [ecx - 3], dl
cdq
idiv esi
mov eax, dword [edx*4 + 0x4c2f80]
sar eax, 8
and eax, 0xff
mov edx, ebx
sar edx, 8
xor dl, byte [eax + 0x4a3ef0]
mov eax, dword [esp + 0x28]
mov byte [ecx - 2], dl
add eax, edi
cdq
idiv esi
inc edi
mov edx, dword [edx*4 + 0x4c2f80]
and edx, 0xff
mov al, byte [edx + 0x4a3ef0]
xor al, bl
cmp ebp, esi
mov byte [ecx - 1], al
jl 0x407e30
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x20
ret