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

Disassembly:
sub esp, 0x34
push esi
mov esi, ecx
cmp byte [esi + 4], 0
je 0x408756
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x4084a7
push dword [esp + 0x40]
push dword [esp + 0x40]
call fcn.0042fdb8
jmp 0x40874f
cdq
xor ecx, ecx
and edx, 3
push ebx
push ebp
push edi
lea edi, [edx + eax]
sar edi, 2
lea ebx, [esi + 0x454]
cmp edi, 6
mov dword [esp + 0x30], edi
mov dword [esp + 0x1c], ebx
mov ebp, ebx
setne cl
xor eax, eax
inc ecx
cmp edi, 4
cmove ecx, eax
shl ecx, 5
mov eax, dword [ecx + 0x4c254c]
mov edx, dword [ecx + 0x4c2554]
mov ecx, dword [ecx + 0x4c255c]
mov dword [esp + 0x18], eax
mov dword [esp + 0x10], edx
mov dword [esp + 0x14], ecx
test edi, edi
jle 0x40855a
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x20], edi
lea edi, [esi + 0x1e8]
movzx eax, byte [ebx]
mov edx, ebp
shl eax, 0x18
lea ebx, [ebx + 4]
mov dword [ebp], eax
movzx ecx, byte [ebx - 3]
shl ecx, 0x10
or ecx, eax
mov dword [ebp], ecx
movzx eax, byte [ebx - 2]
shl eax, 8
or eax, ecx
mov dword [ebp], eax
movzx ecx, byte [ebx - 1]
or ecx, eax
mov dword [ebp], ecx
add ebp, 4
mov eax, dword [edi]
lea edi, [edi + 4]
xor eax, ecx
sub dword [esp + 0x20], 1
mov dword [edx], eax
jne 0x408508
mov edi, dword [esp + 0x30]
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
xor ebx, ebx
inc ebx
mov dword [esp + 0x2c], ebx
cmp dword [esi + 0x3d0], ebx
jle 0x408668
lea ebp, [esi + 0x208]
mov dword [esp + 0x30], ebp
test edi, edi
jle 0x408628
lea ebx, [esi + 0x434]
mov dword [esp + 0x20], ebp
mov dword [esp + 0x24], ebx
mov ebx, edx
sub ebx, eax
mov dword [esp + 0x48], eax
sub ecx, eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x34], ecx
mov ebp, ecx
add eax, ebx
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
sar eax, 8
movzx ecx, al
mov eax, dword [esp + 0x48]
add eax, ebp
cdq
idiv edi
mov ecx, dword [ecx*4 + 0x4c0d20]
movzx eax, byte [esi + edx*4 + 0x454]
xor ecx, dword [eax*4 + 0x4c1120]
mov eax, dword [esp + 0x48]
cdq
idiv edi
movsx eax, word [esi + edx*4 + 0x456]
mov edx, dword [esp + 0x24]
movzx eax, al
xor ecx, dword [eax*4 + 0x4c0920]
movzx eax, byte [edx + 0x23]
xor ecx, dword [eax*4 + 0x4c0520]
mov eax, dword [esp + 0x20]
xor ecx, dword [eax]
add eax, 4
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x48]
mov dword [edx], ecx
add edx, 4
inc eax
mov dword [esp + 0x24], edx
sub dword [esp + 0x28], 1
mov dword [esp + 0x48], eax
jne 0x4085a1
mov ebx, dword [esp + 0x2c]
mov ebp, dword [esp + 0x30]
mov eax, edi
shl eax, 2
push eax
lea eax, [esi + 0x434]
push eax
lea eax, [esi + 0x454]
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x24]
add esp, 0xc
mov edx, dword [esp + 0x10]
inc ebx
mov ecx, dword [esp + 0x14]
add ebp, 0x20
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebp
cmp ebx, dword [esi + 0x3d0]
jl 0x408577
xor ecx, ecx
mov dword [esp + 0x30], ecx
test edi, edi
jle 0x40874c
mov ebp, dword [esp + 0x18]
mov edx, dword [esp + 0x10]
sub ebp, edx
mov eax, dword [esp + 0x4c]
sub dword [esp + 0x14], edx
mov dword [esp + 0x48], eax
mov eax, dword [esi + 0x3d0]
lea eax, [ecx + eax*8]
mov ebx, dword [esi + eax*4 + 0x1e8]
mov ecx, ebx
mov eax, dword [esp + 0x1c]
sar ecx, 0x18
add dword [esp + 0x1c], 4
movzx eax, byte [eax + 3]
xor cl, byte [eax + 0x4bf420]
mov eax, dword [esp + 0x48]
mov byte [eax], cl
inc eax
mov dword [esp + 0x48], eax
mov ecx, ebx
lea eax, [edx + ebp]
sar ecx, 0x10
cdq
idiv edi
movsx eax, word [esi + edx*4 + 0x456]
movzx eax, al
xor cl, byte [eax + 0x4bf420]
mov eax, dword [esp + 0x48]
mov byte [eax], cl
inc eax
mov dword [esp + 0x48], eax
mov ecx, ebx
mov eax, dword [esp + 0x10]
cdq
idiv edi
sar ecx, 8
mov eax, dword [esi + edx*4 + 0x454]
sar eax, 8
movzx eax, al
xor cl, byte [eax + 0x4bf420]
mov eax, dword [esp + 0x48]
mov byte [eax], cl
mov ecx, eax
mov eax, dword [esp + 0x10]
add eax, dword [esp + 0x14]
cdq
idiv edi
movzx eax, byte [esi + edx*4 + 0x454]
mov edx, dword [esp + 0x10]
mov al, byte [eax + 0x4bf420]
xor al, bl
mov byte [ecx + 1], al
add ecx, 2
mov dword [esp + 0x48], ecx
mov ecx, dword [esp + 0x30]
inc ecx
inc edx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x10], edx
cmp ecx, edi
jl 0x40868c
pop edi
pop ebp
pop ebx
pop esi
add esp, 0x34
ret 8
push dword [0x500910]
lea ecx, [esp + 0x30]
call fcn.0044f808
push 0x4ed3e8
lea eax, [esp + 0x30]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
int3