Function at 0x40ca04
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffd2c
mov eax, 0x4c90b4
push ebx
push esi
push edi
call fcn.0049fef4
mov dword [ebp - 0x28], 0xffffffff
mov dword [ebp - 0x2c], 2
mov word [ebp - 0x14], 8
lea edx, [ebp - 0x25c]
push edx
call fcn.004476e8
pop ecx
lea eax, [ebp - 0x25c]
mov dword [ebp - 0x34], 0x37a
add dword [ebp - 0x34], 8
xor ecx, ecx
mov edx, eax
mov eax, edx
mov edx, dword [eax]
add eax, 4
xor dword [ebp - 0x34], edx
inc ecx
cmp ecx, 6
jl 0x40ca52
lea eax, [ebp - 0x34]
mov dword [ebp - 0x30], eax
push 0x50
mov ecx, dword [ebp + 8]
add ecx, 0x1f54
push ecx
lea eax, [ebp - 0x2ac]
push eax
call fcn.0049fa50
mov edx, dword [ebp - 0x288]
add esp, 0xc
add edx, 0xffffff30
xor esi, esi
mov dword [ebp - 0x38], edx
xor ecx, ecx
mov edx, dword [ebp - 0x278]
mov eax, dword [ebp - 0x27c]
add edx, 0xfffffbbe
add eax, 0xffffff93
add eax, 2
mov dword [ebp - 0x3c], edx
xor edx, edx
inc ecx
mov dl, byte [eax]
add eax, 4
mov ebx, edx
lea edx, [ebx + edx*4]
lea edx, [ebx + edx*2]
lea edx, [ebx + edx*8]
lea edx, [ebx + edx*2]
add esi, edx
cmp ecx, 0x14
jl 0x40caaf
xor ecx, ecx
lea ebx, [ebp - 0x140]
test esi, esi
jl 0x40cafd
mov eax, esi
mov edi, 0xa
cdq
idiv edi
add dl, 0x30
mov eax, esi
mov byte [ebx], dl
mov esi, 0xa
cdq
idiv esi
mov esi, eax
inc ebx
inc ecx
test esi, esi
je 0x40cafd
test esi, esi
jge 0x40cad8
mov byte [ebp + ecx - 0x140], 0
mov esi, ecx
xor ecx, ecx
lea eax, [ebp - 0x140]
jmp 0x40cb2f
lea edx, [esi - 1]
mov bl, byte [eax]
sub edx, ecx
mov dl, byte [ebp + edx - 0x140]
mov byte [eax], dl
lea edx, [esi - 1]
sub edx, ecx
inc ecx
inc eax
mov byte [ebp + edx - 0x140], bl
mov edx, esi
sar edx, 1
jns 0x40cb38
adc edx, 0
cmp ecx, edx
jl 0x40cb11
xor eax, eax
mov dword [ebp - 0x28], eax
mov ecx, dword [ebp - 0x38]
movsx eax, byte [ecx]
cmp eax, 0x30
jne 0x40cb52
mov edx, dword [ebp - 0x38]
mov byte [edx], 0x39
xor ecx, ecx
mov eax, dword [ebp - 0x30]
lea edi, [eax - 0xa]
mov eax, dword [ebp - 0x38]
mov esi, eax
mov bl, byte [esi]
cmp ecx, 0xa
jl 0x40cb7e
cmp ecx, 0xe
jge 0x40cb7e
xor bl, byte [edi]
movsx eax, bl
mov ebx, 0xa
xor edx, edx
div ebx
add dl, 0x30
mov ebx, edx
xor eax, eax
mov al, bl
lea edx, [ecx + 1]
imul edx
add dword [ebp - 0x28], eax
inc ecx
inc edi
add esi, 3
cmp ecx, 0x14
jl 0x40cb5f
lea ecx, [ebp - 0x140]
push ecx
call fcn.0049fbf4
pop ecx
mov edx, eax
xor ecx, ecx
lea eax, [ebp - 0x140]
cmp edx, ecx
jle 0x40cbc2
xor ebx, ebx
lea esi, [ecx + 0x15]
mov bl, byte [eax]
inc eax
imul ebx, esi
add dword [ebp - 0x28], ebx
inc ecx
cmp edx, ecx
jg 0x40cbaf
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x3dc]
xor eax, eax
mov ecx, edx
lea edx, [ecx + edx*2]
shl edx, 4
add edx, ecx
lea edx, [ecx + edx*2]
add dword [ebp - 0x28], edx
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x3c]
xor ecx, ecx
lea eax, [edx + 3]
mov ebx, dword [ebp - 0x2c]
mov dl, byte [eax]
add ebx, ebx
add dl, 0xd0
and edx, 0xff
add eax, 4
lea ebx, [ebx + ebx*4]
inc ecx
add edx, ebx
cmp ecx, 5
mov dword [ebp - 0x2c], edx
jl 0x40cbe8
push 0x28
mov eax, dword [ebp + 8]
add eax, 0x7d0
push eax
lea edx, [ebp - 0x2d4]
push edx
call fcn.0049fa50
add esp, 0xc
mov ecx, dword [ebp - 0x2c8]
shl ecx, 3
add dword [ebp - 0x28], ecx
mov ecx, dword [ebp - 0x2c]
sub ecx, dword [ebp - 0x28]
test ecx, ecx
jle 0x40cc44
cmp ecx, 7
jg 0x40cc44
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x28], eax
mov word [ebp - 0x14], 0
jmp 0x40cc57
mov edx, dword [ebp - 0x2c]
sub edx, dword [ebp - 0x28]
setne al
and eax, 1
xor ecx, ecx
mov esi, eax
lea eax, [ebp - 0x40]
shl esi, 3
mov edx, eax
mov eax, edx
lea esi, [esi + esi*4]
lea esi, [esi + esi*4]
lea esi, [esi + esi*4]
cmp esi, ecx
jle 0x40cc8a
xor edx, edx
inc ecx
mov dword [eax], edx
add eax, 4
cmp esi, ecx
jg 0x40cc7e
mov eax, dword [ebp - 0x24]
mov dword fs:[0], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret