Giter Site home page Giter Site logo

plaguevrc / antirip Goto Github PK

View Code? Open in Web Editor NEW
144.0 0.0 13.0 1.47 MB

AntiRip (Kanna Protecc) - Free and insanely strong VRChat Anti Rip. Let us rid of rippers, together.

Home Page: https://discord.gg/SyZcuTPXZA

License: Other

C# 99.59% ShaderLab 0.41%
anti-rip avatar avatars protect protection vrchat vrcsdk3-avatar antirip kanna protecc unity

antirip's Introduction

Fuck Rippers! This project was previously owned by rygo6. It has been passed on for me to own and work on. This is the official repository for this project. I plan to maintain this for the long-term foreseeable future.

This is free. Actually read all of this.

NOTE: Rather pathetically, some are spreading the false rumor this has been bypassed. It has not been bypassed. This is from the malicious scene to try to stop this becoming too common.

Kanna Protecc

This is a rather invasive anti-avatar-ripping system to be used for VRChat. It will protect against your avatar being ripped, extracted and edited. It will also protect against your avatar being ripped and re-uploaded without edits.

This system will randomize all the vertices of your avatar's mesh, then write that to disk. Then rely on a custom shader with a 32 bit key to un-randomize the vertex positions in game. This is not done through blend shapes. Rather this will copy, and destructively edit, the 'Basis' layer of your mesh. It will also obfuscate pretty much everything else on your avatar to confusing as a extra middle finger for the ripper.

Tutorial Video (Click The Image!)

Contents

  1. Caveats of this System

  2. Supported Shaders

  3. Simple Usage Instructions

  4. Testing in Unity

  5. FAQs

  6. How secure is this?

  7. Support

  8. Roadmap

Caveats of this System

  1. For a user to see your avatar properly in VRChat, they must have your avatar fully shown. Shaders, animations and all. You are invisible otherwise.

  2. This synchronizes the key with Avatar 3.0 parameters and does take up 32 bits. So this system can only work with avatars that use the VRChat Avatar 3.0 SDK.

  3. Only a shader from Supported Shaders will work with this. To request another shader to be supported, feel free to ask in the discussions tab here, or in the discord, seen in the Support section.

  4. Proper integration with VRCFury is currently in development.

Supported Shaders

Supported Shader Name Download
Poiyomi https://github.com/poiyomi/PoiyomiToonShader
Unity-Chan Toon Shader (UTS) https://unity-chan.com/download/releaseNote.php?id=UTS2_0&lang=en
Sunao Shader https://booth.pm/ja/items/1723985
XSToon https://github.com/Xiexe/Xiexes-Unity-Shaders
GTAvaToon https://github.com/rygo6/GTAvaToon

Quick Start Guide

Click me!

Backup your project before running these operations in case it doesn't work properly and causes difficult to fix, or impossible to fix, changes in your project.

Really do it. Close Unity, and make a full clean copy of your entire Unity Project folder. A small percentage of avatars did have odd things in their mesh that just wouldn't work, or could cause errors, and the script could leave some assets in the project in a rather messed up state.


Install Kanna Protecc and a supported shader

  1. Ensure you are using latest VRChat Avatars SDK.
  2. Download the supported shader of your choice from Supported Shaders, and import it into your Unity project.
  3. Click (Download). Once downloaded, extract it. Once you have the folder, put that into your assets folder of your unity project.

Prep Your FBX's.

Be sure all of this is set correctly on your FBX's. (Legacy blend shape normals and read/write on too!)

Model


Setup Kanna Protecc Component.

  1. Add the KannaProteccRoot component onto the root GameObject of your avatar, next to the VRCAvatarDescriptor component.

Steps 1

Materials Settings

Materials

Additional Materials is intended for materials used in animations. DO NOT PUT NORMAL NON-ADDITIONAL MATERIALS IN HERE.

The Auto Detect button tries to find material references in all animations! If you have material swaps setup on your avatar it should be a one click solution!

Ignored Materials allows you to use a material with a supported shader on a part of your avatar you don't want encrypted. Materials in this list will not be encrypted. Do not add materials to this list that are on parts of your avatar you want to protect.

Custom Bit Key Length

You can change the 'BitKeys Length' under 'Debug' settings. This allows users with fewer parameters to spare to still use Kanna Protecc. However know that using a shorter bit key reduces the security of the encryption. Its recommended that you use as large of a 'BitKeys Length' as possible.

Obfuscator Settings

By default Kanna Protecc Obfuscates all objects, parameter names, and animator layers on a user's avatar. Features of VRChat that users may want to take advantage of. Such as contact senders, OSC integrations, etc, often require specific names to be unaltered to maintain functionality.

Obfuscator

Kanna Protecc allows for exceptions to be added for renaming. For maximum security only add exceptions for parameters that are required to be unaltered. Note that contact parameter names not intended to interact with other avatars will function perfectly fine obfuscated. Physbone parameters also function perfectly obfuscated. Neither need to be added to exceptions.

The Auto Detect buttons try and detect common setups like face tracking or gogoloco that require exclusions! Its a good idea to click them!

Examples for Face tracking and GoGoLoco.

Link Animator

  1. Ensure your VRCAvatarDescriptor has an AnimatorController specified in the 'FX Playable Layer' slot. Ensure there is also an Animator component on this root GameObject, and that its 'Controller' slot points to the same AnimatorController in the 'FX Playable Layer' slot on the VRCAvatarDescriptor.

Steps 2

The AnimatorController you specify should not be shared between multiple avatars, Kanna Protecc is going to write states into the controller which will need to be different for different avatars.

  1. In the 'Parameters' slot of your VRCAvatarDescriptor ensure you have an 'Expression Parameters' object.

Step 3


Delete your old Un-Encrypted Avatar from VRC Backend!

VRC API stores old uploads of your avatar! So if you start uploading an encrypted avatar with an ID that you previously uploaded non-encrypted, it may entirely negate any benefit this provides as rippers can just download an older version that was not encrypted.

  1. Go into the VRChat SDK Inspector in the Unity Editor, then under 'Content Manager' find the avatar you wish to protect and delete it entirely from the VRC backend.
  2. Go to your current avatar's Pipeline Manager component and click the Detach (Optional) button so it will generate a new avatar id on upload.

Encrypting and Uploading

  1. Ensure any meshes you wish to have encrypted are using a compatible shader, such as Poiyomi.
  2. On the KannaProteccRoot component click the 'Protecc Avatar' button. This will produce a garbled version of your avatar with '_KannaProteccted' appended to the name. Step 4 The mesh appearing scrambled is intended behavior.
  3. Go to the VRChat SDK Menu then 'Build and Publish' your avatar which has '_KannaProteccted' appended to the name.

I found some Poi 8/8.1 materials get into a weird state with Lock/Unlock and Kanna Protecc can't lock them. If you get errors that say something like 'Trying to Inject not-locked shader?!' go to the Poi 8/8.1 material it is complaining about and manually click the Lock/Unlock button to get it out of its weird state.


Writing Keys

Ensure VRChat is closed! Otherwise when you write keys VRChat may prevent writing!

  1. This is important. After upload completes, go to the GameObject of your encrypted avatar. Find the Pipeline Manager component and copy it's blueprint ID. Then paste the blueprint ID into the Pipeline Manager on the un-encrypted avatar and click 'Attach'.
  2. Now on the KannaProteccRoot component click the 'Write Keys' button. This will actually read in and alter the saved 3.0 parameters from your VRChat folder to include the new key so you don't have to enter them in-game.
  3. Ensure no errors came up!. It should popup a success dialogue if it did it correctly. If there were issues make sure the 'Vrc Saved Params Path' actually points to your LocalAvatarData folder.

You only need to run 'Write Keys' once on first setup, or when you change keys.

If you "Reset Avatar" in game through the 3.0 menu, it will reset your keys and you will need to re-export them with the 'Write Keys' button!


Un-Encrypting, Editing and Re-uploading Your Avatar

If you wish to see your avatar again as normal and not encrypted, or make changes to your avatar:

  1. Click on your original un-encrypted avatar, where "Encrypted" is not in the name; then select Un-Protecc Avatar.

You should now be able to edit your avatar as normal.

Do not upload the avatar without encrypting it!

  1. Click 'Protecc Avatar' again. Follow the steps in Encrypting and uploading
  2. Writing keys should not be necessary unless you genereated new keys.

Testing the Avatar

Entering play mode will not decrypt the protected avatar on its own. Click here for how to test your avatar in play mode.


Back to Contents


How secure is this?

I will keep transparent here without guiding rippers on how to attack your works. This is not foolproof, but the best you can get at this time. Rip wise, this cannot be currently ripped without a insane amount of work, as ripping compiled shadercode, reversing it back to unity compatible code and also getting hold of the keys would be hell. Hotswap wise, a dedicated enough ripper with experience with mods could hotswap your avatar. This is not immune to that. (Soon to be countered with traps making even that extremely harder to do) You can however put a watermark on your avatar to drive hotswappers into being banned which they wont be able to remove, as the meshes will be encrypted, regardless of hotswap. A hotswap done with the high amount of work i have mentioned here would only get the avatar working normally in game; not in unity.

A typical hotswap will not bypass this. It would take a specialized one.

Support

If you have any more questions, or suggestions, feel free to join the Kanna Protecc discord: https://discord.gg/SyZcuTPXZA

Roadmap

This will let you keep up to date with major features that will take time to implement. This does not act as a changelog, nor will it have every upcoming feature listed. Only time-consuming ones. https://trello.com/b/k88bNBvd/kanna-protecc

Soy boy

image

antirip's People

Contributors

arcxingye avatar blizzyfox avatar dathuss avatar gonsodany avatar imaether avatar mistressplague avatar raphap3 avatar zrodevkaan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

antirip's Issues

Suggestion: Experimentation with using Normal values for Public Key

Hashing vertices is genius. However, I am curious, what about if you use Normals on a model to decrypt the avatar. What do you think the output and issues with this would be? And the upsides compared to shaders and/or vertices. If not for decrypting, what other ways could it be used to improve usability while offering little to no compromise?

If this hasn't already been tried, I'd love to see the results, and if it is anymore efficient. If it is redundant or not a good idea for reasons outside of my expertise, then let me know.

Fallback system

For a user to see your avatar properly in VRChat, they must have your avatar fully shown. Shaders, animations and all. You are invisible otherwise.

A fallback system might help here. Thanks.

Would it be possible to write the encryption key over osc instead of htrough unity?

Im assuming here, that the encryption key is in a parameter. If so, it should be possible in theory, to just use a small osc program, to set your encryption key, so in case you reset or something like that, you dont have to open unity and restart your vrchat.

I could be totally wrong in how this works, but i think it might be a good idea to look into it.

Why is this not a Fork?

Since it was GTAvaCrypt why didn't you fork it?
That's not very OSS of you

Also calling it AntiRip is misleading as it only increases the difficulty to rip

Add a mappings from non-obfuscated to obfuscated names

For use with OSC you currently have the Obfuscator settings that allow you to not rename a couple things.
For advanced Users it might be possible to just lookup a mapping from an Obfuscated name to the un-obfuscated name in a custom program.

Then as an advanced user you do not need to exclude really any names manually, because even if you use OSC, you can just use the provided mappings.

I've worked with ProGuard (Java obfuscator) before and they also provide the mappings. It is immensely helpful to have the mappings from non-obfuscated to obfuscated or reverse for the creator.
E.g.: I made a mistake in my controller and want some more information. So I go open the Debug Overlay and look at my parameters/Animators with the help of the mappings. Without the mappings the Debug Overlay is of no use.

Only actively equipped materials are properly encrypted

I have a lot of materials on my avatar.
I updated to 1179df2 recently from a really old version.

And now I found out, that my main mesh is finally encrypted.
But only materials actively equipped at the time I press Protect Avatar work properly.
All other materials don't work, even though they are in the Additional Materials list (which also doesn't properly auto-detect my material swaps).
My material swaps are controlled by a direct blend tree, which operates on type mismatched parameters (float in animation controller and bool in VRC Avatar Parameter descriptor)

Swapping the materials works fine, but the mesh is just an exploded mess.

Poiyomi shaders don't like Water

Encrypted Poiyomi shaders will blur Water waves on maps with water present according to where the obfuscated mesh would be (this is with the person as a friend even).
This effect is most pronounced on avatars with high Distortion Ratios and Maps with Water.
I've had multiple people report this to me now.

Pictures pending. Too drunk and late for me right now.

Undisposed RNGCryptoServiceProvider

Hey as a programmer myself I saw a few little bumps in the code which I think could be improved and/or made more secure. I was looking over what was in it and noticed these things.

In the KannaProteccData class an RNGCryptoServiceProvider is used, but it doesn't get disposed of. This will lead to underlying resources which it uses to not be disposed. Luckily it can be easily fixed by wrapping the RNGCryptoServiceProvider in a using statement.

void Shuffle<T>(IList<T> list)
{
    using (var provider = new RNGCryptoServiceProvider())
    {
        var n = list.Count;
        while (n > 1)
        {
            ...
        }
    }
}

It may be a good idea to use the RNGCryptoServiceProvider to generate the random encryption key inside the KannaProteccRoot.GenerateNewKey method like this:

public void GenerateNewKey()
{
    using (var rng = new RNGCryptoServiceProvider())
    {
        byte[] randomBytes = new byte[4];
        rng.GetBytes(randomBytes);

        for (int i = 0; i < 4; i++)
        {
            for (int j = 0; j < 8; j++)
            {
                _bitKeys[i * 8 + j] = ((randomBytes[i] & (1 << j)) != 0);
            }
        }
    }
}

You don't have to make these changes, I just thought it would make the code a little higher quality and more secure.
Either way I hope you have an amazing day and I believe you are an amazing person for making this project!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.