Function at 0x5ba660
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ecx
push ebx
push ebp
push esi
mov esi, dword [esp + 0x14]
mov ebx, ecx
push edi
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x10], 0
movzx ebp, word [esi + 0xe]
cmp ebp, 0x10
je 0x5ba696
cmp ebp, 0x18
je 0x5ba696
cmp ebp, 0x20
je 0x5ba696
xor al, al
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 4
mov ecx, dword [esi + 4]
mov dword [ebx + 4], ecx
mov eax, dword [esi + 8]
cdq
xor eax, edx
sub eax, edx
mov dword [ebx + 8], eax
imul eax, ecx
shl eax, 2
push eax
call fcn.0048fd95
add esp, 4
mov dword [ebx + 0xc], eax
cmp word [esi + 0xe], 8
lea edx, [esi + 0x28]
mov dword [esp + 0x10], eax
mov dword [esp + 0x18], edx
ja 0x5ba6e8
mov ecx, dword [esi + 0x20]
test ecx, ecx
je 0x5ba6d7
lea edx, [edx + ecx*4]
jmp 0x5ba6e4
movzx ecx, word [esi + 0xe]
mov eax, 4
shl eax, cl
add edx, eax
mov dword [esp + 0x18], edx
mov esi, dword [ebx + 4]
mov ecx, ebp
mov edx, dword [ebx + 8]
shr ecx, 3
imul ecx, esi
push ebp
lea edi, [esi*4]
mov eax, ecx
neg eax
push eax
lea eax, [edx - 1]
imul eax, ecx
add eax, dword [esp + 0x20]
push eax
push 0x20
push edi
push dword [esp + 0x24]
push edx
push esi
call fcn.00475b60
mov edx, dword [ebx + 8]
add esp, 0x20
mov ecx, dword [ebx + 0xc]
imul edx, edi
add edx, ecx
cmp ecx, edx
jae 0x5ba82e
movsd xmm4, qword [0x6a1d10]
xorps xmm7, xmm7
nop dword [eax]
movzx eax, byte [ecx + 1]
xorps xmm5, xmm5
xorps xmm2, xmm2
xorps xmm6, xmm6
cvtsi2sd xmm5, eax
movzx eax, byte [ecx + 2]
cvtsi2sd xmm2, eax
movzx eax, byte [ecx]
movaps xmm1, xmm5
mulsd xmm1, qword [0x6a1cf0]
movaps xmm0, xmm2
mulsd xmm0, qword [0x6a1cd0]
cvtsi2sd xmm6, eax
addsd xmm1, xmm0
movaps xmm0, xmm6
mulsd xmm0, qword [0x6a1cb8]
addsd xmm1, xmm0
maxsd xmm1, xmm7
comisd xmm4, xmm1
ja 0x5ba796
movaps xmm1, xmm4
cvttsd2si eax, xmm1
movaps xmm0, xmm5
movaps xmm1, xmm2
mulsd xmm0, qword [0x6a1cd8]
movaps xmm3, xmm6
sub al, 0x80
mulsd xmm1, qword [0x6a1cc0]
mov byte [ecx], al
mulsd xmm3, qword [0x6a1ce8]
addsd xmm1, xmm0
movsd xmm0, qword [0x6a1d08]
subsd xmm3, xmm1
addsd xmm3, xmm0
maxsd xmm3, xmm7
comisd xmm4, xmm3
ja 0x5ba7e0
movaps xmm3, xmm4
mulsd xmm2, qword [0x6a1ce8]
mulsd xmm5, qword [0x6a1ce0]
mulsd xmm6, qword [0x6a1cb0]
cvttsd2si eax, xmm3
subsd xmm2, xmm5
sub al, 0x80
mov byte [ecx + 1], al
subsd xmm2, xmm6
addsd xmm2, xmm0
maxsd xmm2, xmm7
comisd xmm4, xmm2
ja 0x5ba81a
movaps xmm2, xmm4
cvttsd2si eax, xmm2
sub al, 0x80
mov byte [ecx + 2], al
add ecx, 4
cmp ecx, edx
jb 0x5ba740
cmp byte [0x6b3de0], 0x10
jne 0x5ba855
mov ecx, 0x6b3de0
mov edx, 2
xor eax, eax
shr byte [ecx + eax], 2
inc eax
cmp eax, 0x40
jb 0x5ba843
add ecx, 0x40
sub edx, 1
jne 0x5ba841
mov eax, dword [ebx]
mov ecx, ebx
push 0xff
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xd8
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xff
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xdb
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x84
call dword [eax]
xor edi, edi
mov esi, 0x6b3de0
nop dword [eax + eax]
mov eax, dword [ebx]
mov ecx, ebx
push edi
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x40
push esi
call dword [eax + 4]
add esi, 0x40
inc edi
cmp esi, 0x6b3e60
jl 0x5ba8a0
mov eax, dword [ebx]
mov ecx, ebx
push 0xff
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xc0
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x11
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 8
call dword [eax]
mov eax, dword [ebx + 8]
mov ecx, ebx
mov edx, dword [ebx]
sar eax, 8
push eax
call dword [edx]
mov edx, dword [ebx]
mov ecx, ebx
movzx eax, byte [ebx + 8]
push eax
call dword [edx]
mov eax, dword [ebx + 4]
mov ecx, ebx
mov edx, dword [ebx]
sar eax, 8
push eax
call dword [edx]
mov edx, dword [ebx]
mov ecx, ebx
movzx eax, byte [ebx + 4]
push eax
call dword [edx]
mov eax, dword [ebx]
mov ecx, ebx
push 3
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x11
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 2
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x11
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 3
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x11
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xff
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xc4
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xa2
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x10
push 0x6b3e60
call dword [eax + 4]
xor esi, esi
nop dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push esi
call dword [eax]
inc esi
cmp esi, 0xc
jl 0x5ba9b0
mov eax, dword [ebx]
mov ecx, ebx
push 1
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x10
push 0x6b3e70
call dword [eax + 4]
xor esi, esi
mov eax, dword [ebx]
mov ecx, ebx
push esi
call dword [eax]
inc esi
cmp esi, 0xc
jl 0x5ba9d5
mov eax, dword [ebx]
mov ecx, ebx
push 0x10
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x10
push 0x6b3e80
call dword [eax + 4]
mov eax, dword [ebx]
mov ecx, ebx
push 0xa2
push 0x6b3ea0
call dword [eax + 4]
mov eax, dword [ebx]
mov ecx, ebx
push 0x11
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0x10
push 0x6b3e90
call dword [eax + 4]
mov eax, dword [ebx]
mov ecx, ebx
push 0xa2
push 0x6b3f42
call dword [eax + 4]
mov ecx, ebx
call fcn.005baaa0
mov eax, dword [ebx]
mov ecx, ebx
push 0xff
call dword [eax]
mov eax, dword [ebx]
mov ecx, ebx
push 0xd9
call dword [eax]
push dword [ebx + 0xc]
call fcn.0048fd9e
add esp, 4
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
pop ecx
ret 4