Function at 0x40478d
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 ebx
push esi
mov esi, ecx
push edi
cmp byte [esi + 4], 0
jne 0x4047b9
push 0x422a74
lea ecx, [ebp - 0x34]
call fcn.0040ddbc
lea eax, [ebp - 0x34]
push 0x420c48
push eax
call fcn.0040de66
mov eax, dword [esi + 0x3cc]
cmp eax, 0x10
jne 0x4047d6
push dword [ebp + 0xc]
mov ecx, esi
push dword [ebp + 8]
call fcn.004041b4
jmp 0x404a16
push 4
cdq
pop ecx
idiv ecx
mov edi, eax
sub eax, ecx
xor ecx, ecx
cmp edi, 6
setne cl
inc ecx
neg eax
sbb eax, eax
and eax, ecx
shl eax, 5
test edi, edi
mov ecx, dword [eax + 0x41cc24]
mov dword [ebp - 0x18], ecx
mov ecx, dword [eax + 0x41cc2c]
mov eax, dword [eax + 0x41cc34]
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], eax
lea eax, [esi + 0x454]
jle 0x40485a
lea ecx, [esi + 0x1e8]
mov dword [ebp - 0xc], edi
mov dword [ebp - 4], ecx
mov ecx, dword [ebp + 8]
movzx edx, byte [ecx]
shl edx, 0x18
inc ecx
mov dword [eax], edx
movzx edx, byte [ecx]
shl edx, 0x10
or dword [eax], edx
inc ecx
xor edx, edx
mov dh, byte [ecx]
or dword [eax], edx
inc ecx
mov edx, eax
movzx ebx, byte [ecx]
or dword [eax], ebx
mov ebx, dword [ebp - 4]
add dword [ebp - 4], 4
inc ecx
mov ebx, dword [ebx]
add eax, 4
xor dword [edx], ebx
dec dword [ebp - 0xc]
jne 0x404826
push 1
pop eax
cmp dword [esi + 0x3d0], eax
mov dword [ebp - 0xc], eax
jle 0x40494a
lea eax, [esi + 0x208]
mov dword [ebp - 8], eax
test edi, edi
jle 0x404918
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x18]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 0x14]
sub eax, edx
mov dword [ebp + 8], edx
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
sub eax, edx
lea ecx, [esi + 0x434]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x10], edi
mov eax, dword [ebp - 0x20]
mov ebx, dword [ebp + 8]
add eax, ebx
cdq
idiv edi
mov eax, edx
xor edx, edx
mov dl, byte [esi + eax*4 + 0x455]
mov eax, dword [ebp - 0x24]
add eax, ebx
mov dword [ebp - 0x28], edx
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
mov edx, dword [ebp - 0x28]
and eax, 0xff
mov ebx, dword [edx*4 + 0x41b3f8]
xor ebx, dword [eax*4 + 0x41b7f8]
mov eax, dword [ebp + 8]
cdq
idiv edi
xor eax, eax
mov al, byte [esi + edx*4 + 0x456]
xor ebx, dword [eax*4 + 0x41aff8]
xor eax, eax
mov al, byte [ecx + 0x23]
xor ebx, dword [eax*4 + 0x41abf8]
mov eax, dword [ebp - 4]
add dword [ebp - 4], 4
xor ebx, dword [eax]
mov dword [ecx], ebx
add ecx, 4
inc dword [ebp + 8]
dec dword [ebp - 0x10]
jne 0x4048a2
mov eax, edi
shl eax, 2
push eax
lea eax, [esi + 0x434]
push eax
lea eax, [esi + 0x454]
push eax
call fcn.0040cff0
add dword [ebp - 8], 0x20
add esp, 0xc
inc dword [ebp - 0xc]
mov eax, dword [ebp - 0xc]
cmp eax, dword [esi + 0x3d0]
jl 0x404875
and dword [ebp - 4], 0
test edi, edi
jle 0x404a16
mov ecx, dword [ebp + 0xc]
mov ebx, dword [ebp - 0x14]
lea eax, [esi + 0x454]
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 0x18]
sub eax, ebx
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x1c]
sub eax, ebx
mov dword [ebp - 0x24], eax
mov eax, dword [esi + 0x3d0]
mov edx, dword [ebp - 4]
lea eax, [edx + eax*8]
mov edx, dword [ebp + 0xc]
add dword [ebp + 0xc], 4
mov eax, dword [esi + eax*4 + 0x1e8]
mov dword [ebp + 8], eax
xor eax, eax
mov al, byte [edx + 3]
mov edx, dword [ebp + 8]
sar edx, 0x18
mov al, byte [eax + 0x419af8]
xor al, dl
mov byte [ecx], al
mov eax, dword [ebp - 0x28]
add eax, ebx
inc ecx
cdq
idiv edi
xor eax, eax
mov al, byte [esi + edx*4 + 0x456]
mov edx, dword [ebp + 8]
sar edx, 0x10
mov al, byte [eax + 0x419af8]
xor al, dl
mov byte [ecx], al
mov eax, ebx
cdq
idiv edi
xor eax, eax
inc ecx
mov al, byte [esi + edx*4 + 0x455]
mov edx, dword [ebp + 8]
sar edx, 8
mov al, byte [eax + 0x419af8]
xor al, dl
mov byte [ecx], al
mov eax, dword [ebp - 0x24]
add eax, ebx
inc ecx
cdq
idiv edi
mov eax, dword [esi + edx*4 + 0x454]
and eax, 0xff
mov al, byte [eax + 0x419af8]
xor al, byte [ebp + 8]
mov byte [ecx], al
inc ecx
inc dword [ebp - 4]
inc ebx
cmp dword [ebp - 4], edi
jl 0x404975
pop edi
pop esi
pop ebx
leave
ret 8