Function at 0x5ba038
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x9e4
push ebx
push esi
lea esi, [ebp - 0x9e4]
call fcn.0049b413
mov ecx, dword [edi]
mov eax, ecx
sar eax, 2
lea edx, [eax + eax]
sub ecx, edx
mov edx, dword [ebp + 0xc]
imul ecx, dword [ebp + 0x10]
sub edx, 0xffffff80
and edx, 0x1ff
mov ebx, dword [edx*4 + 0x6f03e0]
mov edx, dword [ebp + 0x14]
imul ebx, eax
and dword [ebp + 0x10], 0
sar ebx, 0x10
add ebx, eax
mov eax, dword [edi + 4]
sar ecx, 7
dec eax
dec eax
imul eax, edx
add eax, dword [ebp + 8]
cmp dword [edi], 0
mov dword [ebp - 8], ecx
jle 0x5ba178
lea esi, [eax + 1]
mov eax, dword [ebp + 0x18]
sub eax, 0
je 0x5ba120
dec eax
je 0x5ba0f2
dec eax
jne 0x5ba167
cmp ebx, dword [ebp + 0x10]
jg 0x5ba0c9
lea eax, [ebx + ecx]
cmp dword [ebp + 0x10], eax
jge 0x5ba0c9
mov byte [esi + 1], 0
mov byte [esi], 0x80
mov byte [esi - 1], 0x80
jmp 0x5ba138
lea edx, [ebp - 0x9e4]
call fcn.0049b44d
xor edx, edx
push 3
pop ecx
div ecx
mov ecx, dword [ebp - 8]
test edx, edx
mov edx, dword [ebp + 0x14]
jne 0x5ba163
mov byte [esi], 0xff
mov byte [esi + 1], 0
mov byte [esi - 1], 0xff
jmp 0x5ba138
cmp ebx, dword [ebp + 0x10]
jg 0x5ba0ff
lea eax, [ebx + ecx]
cmp dword [ebp + 0x10], eax
jl 0x5ba0bc
lea edx, [ebp - 0x9e4]
call fcn.0049b44d
xor edx, edx
push 3
pop ecx
div ecx
mov ecx, dword [ebp - 8]
test edx, edx
mov edx, dword [ebp + 0x14]
jne 0x5ba163
mov byte [esi], 0x80
jmp 0x5ba0e8
cmp ebx, dword [ebp + 0x10]
jg 0x5ba13e
lea eax, [ebx + ecx]
cmp dword [ebp + 0x10], eax
jge 0x5ba13e
mov byte [esi + 1], 0x80
mov byte [esi], 0x80
mov byte [esi - 1], 0
mov byte [esi + 2], 0xff
jmp 0x5ba167
lea edx, [ebp - 0x9e4]
call fcn.0049b44d
xor edx, edx
push 3
pop ecx
div ecx
mov ecx, dword [ebp - 8]
test edx, edx
mov edx, dword [ebp + 0x14]
jne 0x5ba163
mov byte [esi + 1], 0xff
mov byte [esi], 0xff
jmp 0x5ba134
and dword [esi - 1], 0
inc dword [ebp + 0x10]
mov eax, dword [ebp + 0x10]
add esi, 4
cmp eax, dword [edi]
jl 0x5ba09d
mov eax, dword [ebp + 0x18]
sub eax, 0
je 0x5ba378
dec eax
je 0x5ba279
dec eax
jne 0x5ba45d
mov eax, dword [ebp + 8]
mov esi, dword [edi + 4]
lea ecx, [eax + edx]
xor eax, eax
inc eax
dec esi
cmp esi, eax
mov dword [ebp - 8], ecx
mov dword [ebp - 0xc], eax
jle 0x5ba45d
mov esi, dword [edi]
mov dword [ebp + 8], 2
sub dword [ebp + 8], edx
mov dword [ebp + 0x10], 0xfffffffb
dec esi
sub dword [ebp + 0x10], edx
jmp 0x5ba1c9
xor eax, eax
inc eax
cmp esi, eax
mov dword [ebp + 0x14], eax
jle 0x5ba25f
mov eax, dword [ebp + 8]
lea eax, [eax + ecx + 5]
lea esi, [edx + ecx]
mov dword [ebp + 0x18], esi
sub dword [ebp + 0x18], ecx
mov dword [ebp + 0xc], eax
lea eax, [ecx + 5]
mov esi, dword [ebp + 0x18]
movzx ebx, byte [eax + esi]
movzx esi, byte [eax - 4]
add ebx, esi
movzx esi, byte [eax + 4]
add ebx, esi
movzx esi, byte [eax]
add ebx, esi
mov esi, dword [ebp + 0x14]
add ecx, edx
movzx ecx, byte [ecx + esi*4]
movzx esi, byte [eax - 1]
and esi, 0xf9
and ecx, 0xf2
add ecx, esi
movzx esi, byte [eax - 5]
add ecx, esi
movzx esi, byte [eax + 3]
add ecx, esi
mov esi, dword [ebp + 0xc]
mov byte [esi - 1], 0
mov esi, dword [ebp + 0x10]
sar ebx, 2
mov byte [eax + esi + 5], bl
mov esi, dword [ebp + 0xc]
sar ecx, 2
inc dword [ebp + 0x14]
mov byte [esi - 3], cl
mov byte [esi], 0xff
mov ecx, dword [edi]
add esi, 4
mov dword [ebp + 0xc], esi
lea esi, [ecx - 1]
mov ecx, dword [ebp - 8]
add eax, 4
cmp dword [ebp + 0x14], esi
jl 0x5ba1ea
mov eax, dword [edi + 4]
add ecx, edx
inc dword [ebp - 0xc]
dec eax
cmp dword [ebp - 0xc], eax
mov dword [ebp - 8], ecx
jl 0x5ba1c6
jmp 0x5ba45d
mov eax, dword [ebp + 8]
mov ecx, dword [edi + 4]
lea esi, [eax + edx]
xor eax, eax
inc eax
dec ecx
cmp ecx, eax
mov dword [ebp - 8], esi
mov dword [ebp - 0x10], eax
jle 0x5ba45d
mov ebx, dword [edi]
mov ecx, esi
sub ecx, edx
add esi, edx
mov dword [ebp + 0x10], eax
sub dword [ebp + 0x10], edx
mov dword [ebp + 0x18], 4
dec ebx
sub dword [ebp + 0x18], edx
mov dword [ebp - 0x14], ecx
mov dword [ebp + 8], esi
jmp 0x5ba2b8
xor eax, eax
inc eax
cmp ebx, eax
mov dword [ebp - 0xc], eax
jle 0x5ba358
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0x18]
mov ebx, dword [ebp - 8]
add eax, edx
mov edx, dword [ebp + 0x10]
lea esi, [eax + edx]
mov edx, dword [ebp + 8]
sub edx, ebx
mov dword [ebp - 0x18], edx
mov edx, dword [ebp + 8]
mov dword [ebp + 0xc], ecx
sub dword [ebp + 0xc], ebx
sub edx, ecx
mov dword [ebp - 0x1c], edx
jmp 0x5ba2ef
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
movzx ebx, byte [eax + ecx]
movzx ecx, byte [eax - 4]
add ebx, ecx
movzx ecx, byte [eax + 4]
add ebx, ecx
movzx ecx, byte [eax]
add ebx, ecx
movzx ecx, byte [esi + edx]
movzx edx, byte [eax + 1]
and ecx, 0xf2
and edx, 0xf9
add ecx, edx
movzx edx, byte [eax + 5]
add ecx, edx
movzx edx, byte [eax - 3]
add ecx, edx
sar ecx, 2
sar ebx, 2
inc dword [ebp - 0xc]
mov byte [esi], cl
mov ecx, dword [ebp + 0xc]
mov byte [eax + ecx], bl
mov byte [esi + 1], 0
mov byte [esi + 2], 0xff
mov ecx, dword [edi]
lea ebx, [ecx - 1]
add eax, 4
add esi, 4
cmp dword [ebp - 0xc], ebx
jl 0x5ba2ec
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp - 0x14]
add dword [ebp - 8], edx
add dword [ebp + 8], edx
mov eax, dword [edi + 4]
add ecx, edx
inc dword [ebp - 0x10]
dec eax
cmp dword [ebp - 0x10], eax
mov dword [ebp - 0x14], ecx
jl 0x5ba2b5
jmp 0x5ba45d
mov ecx, dword [edi + 4]
mov eax, dword [ebp + 8]
xor esi, esi
inc esi
dec ecx
cmp ecx, esi
lea eax, [eax + edx*2]
mov dword [ebp + 0xc], eax
mov dword [ebp - 0x10], esi
jle 0x5ba45d
mov ecx, dword [edi]
sub eax, edx
add eax, 9
mov dword [ebp + 8], 0xfffffffe
sub dword [ebp + 8], edx
mov dword [ebp + 0x18], 0xfffffff7
dec ecx
sub dword [ebp + 0x18], edx
mov dword [ebp - 0xc], eax
jmp 0x5ba3b7
xor esi, esi
inc esi
cmp ecx, esi
mov dword [ebp + 0x10], esi
jle 0x5ba445
mov ecx, dword [ebp + 8]
add ecx, eax
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x18]
sub ecx, dword [ebp + 0xc]
lea esi, [edx + eax - 3]
add ecx, eax
mov dword [ebp - 0x18], ecx
movzx ecx, byte [eax - 4]
movzx edx, byte [esi - 1]
movzx ebx, byte [eax - 3]
and edx, 0xf2
and ecx, 0xf9
add ecx, edx
movzx edx, byte [eax - 8]
add ecx, edx
movzx edx, byte [eax]
add ecx, edx
movzx edx, byte [eax - 7]
add edx, ebx
movzx ebx, byte [eax + 1]
add edx, ebx
movzx ebx, byte [esi]
add edx, ebx
mov ebx, dword [ebp - 0x18]
sar edx, 2
sar ecx, 2
inc dword [ebp + 0x10]
mov byte [esi + ebx], dl
mov edx, dword [ebp - 0x14]
mov byte [edx - 2], cl
mov byte [edx - 3], 0
mov byte [edx], 0xff
mov ecx, dword [edi]
add edx, 4
add eax, 4
add esi, 4
dec ecx
cmp dword [ebp + 0x10], ecx
mov dword [ebp - 0x14], edx
jl 0x5ba3d9
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp + 0x14]
add dword [ebp + 0xc], edx
mov esi, dword [edi + 4]
add eax, edx
inc dword [ebp - 0x10]
dec esi
cmp dword [ebp - 0x10], esi
mov dword [ebp - 0xc], eax
jl 0x5ba3b4
pop esi
pop ebx
leave
ret