Coder Social home page Coder Social logo

userr00t / universalunityhooks Goto Github PK

View Code? Open in Web Editor NEW
84.0 8.0 8.0 1.18 MB

A framework designed to hook into and modify methods in unity games via dlls

License: MIT License

C# 100.00%
dlls hooks dll injection injector assembly-modification patcher unity mono dotnet

universalunityhooks's Introduction

UniversalUnityHooks

Warning: Unstable release

This branch is currently used for the experimental version of UUH, v3.0. If you are looking for a production ready build of UUH, please visit the v2 branch.

Download

You can download UniversalUnityHooks v3 using the produced artifacts from Github Actions. Do note you need a github account for this. In the future, I'd like to also release the build files to the "releases" section.

Executing

Running UniversalUnityHooks is very easy. On windows, you can use the dotnet tool on the UniversalUnityHooks.Core.dll. On unix based systems, you can just use ./UniversalUnityHooks.Core. Hopefully I can build a windows executable (.exe) and bundle it with in the future.
After running UniversalUnityHooks with no arguments, you should see a help screen with arguments you can use. If you just want to inject plugins, you should use the execute command. Type UniversalUnityHooks.Core execute --help for more information.

Building

Run the dotnet build tool on the project UniversalUnityHooks.Core. This project will be the entry point of the application. An example command would be:
dotnet build UniversalUnityHooks.Core/UniversalUnityHooks.Core.csproj --configuration Release. Make sure your current working directory is set to the git repository.

universalunityhooks's People

Contributors

lewisdoesstuff avatar userr00t 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

universalunityhooks's Issues

Are you able to inject with common Mono injection methods?

Say I wanted to make a library for use with something like MonoInjector or SharpMonoInjector. Can I include my UUH code inside the same project as my main injected library? Like if I were to just include the game's DLL and Assembly files as well as the UUH ddl as references, would it still work when Injected into the game when the game has already started?

Unsure how to use exe flags [v2]

I'm pretty confused on what the 3 inputs the UniversalUnityHooks.exe is looking for: my command is

.\UniversalUnityHooks.exe -t "C:\Program Files\Wizards of the Coast\MTGA\MTGA_Data\Managed\Assembly-CSharp.dll" -i "C:\Program Files\Wizards of the Coast\MTGA\MTGA_Data\Plugins\logger.dll" -o "C:\Program Files\Wizards of the Coast\MTGA\MTGA_Data\Managed\Assembly-CSharp-New.dll"

but it's giving me Cannot create "C:\Program Files\Wizards of the Coast\MTGA\MTGA_Data\Plugins\logger.dll" because a file or directory with the same name already exists., which makes me think I've incorrectly interpreted the -i, -o, and -t flags

How can i use UniversalUnityHooks

Hi, I am backend coder, I want Hook a Unity Game on windows. I find this project, it cool, but I don't understand how to use it.

I download the universalUnityHooks exe, and use --help, but I don't know what next I should do.

image

Thanks!

Issue with settings.json

Hi, i'm having an issue with my server using BP-Essentials (2.6.6)

I configured the settings.json inside the "Essentials" folder, it worked fine until now, every time that i open my server, the settings.json file gets renamed to "settings.json.2019_46_24_04_46_39.OLD" and a new files replaces it, which is the default one. I didn't change any config, it broke itself... i think?

It's very frustrating because, i can't configure my server, the configuration just resets :(
Thanks in advice!
Cheers!

NullReferenceException in UniversalUnityHooks.AssemblyHelper.FetchAndLoadAll() when more than one dlls in Plugins folder

I tried to make a plugin for Broke Protocol but UUH throws exception when I'm trying to run it with my plugin and BP-Essentials. If I use only one of them everything is ok.

Console output:

 WAIT     Loading in assembly BP_Essentials.dll..
 WAIT     No add method attributes were found. (63ms)
 INFO     Attributes found of type HookAttributes: 20 (65ms)
 SUCCESS  Loaded in assembly and 20 attribute(s) in 65ms

 WAIT     Loading in assembly NoApartmentsHiding.dll..
 WAIT     No add method attributes were found. (0ms)
 INFO     Attributes found of type HookAttributes: 2 (0ms)
 ERROR    Ссылка на объект не указывает на экземпляр объекта.
StackTrace:   в UniversalUnityHooks.AssemblyHelper.FetchAndLoadAll()

 SUCCESS  Total of 20 attribute(s) have been loaded in.

My code (there is also Variables.cs but it is just some globals):

using UniversalUnityHooks;

namespace NoApartmentsHiding
{
    public static class Hooks
    {
        [Hook("SvPlayer.SvEnterPlace")]
        public static bool SvEnterPlace(SvPlayer svPlayer, ref int door, ref ShPlayer shPlayer)
        {
            if (shPlayer.wantedLevel > Variables.MaxWantedLevel && svPlayer.entity.manager.FindByID<ShDoor>(door) is ShApartment)
            {
                svPlayer.SendMessage($"<color={Variables.MessageColor}>{Variables.CantEnterMessage}</color>");
                return true;
            }
            return false;
        }

        [Hook("SvPlayer.SvInvite")]
        public static bool SvInvite(SvPlayer svPlayer, ref int targetId)
        {
            var target = svPlayer.entity.manager.FindByID<ShPlayer>(targetId);
            if (target.wantedLevel > Variables.MaxWantedLevel)
            {
                svPlayer.SendMessage($"<color={Variables.MessageColor}>{string.Format(Variables.CantInviteMessage, target.username)}</color>");
                return true;
            }
            return false;
        }
    }
}

Useful info:

  • I'm using .NET Framework 4.7.2
  • Latest version of UUH and BPE

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.