Name: UnityHook
Owner: HearthSim
Description: Platform to hook into Unity3D assemblies
Created: 2015-03-27 16:49:43.0
Updated: 2018-05-23 01:27:34.0
Pushed: 2017-12-27 23:29:18.0
Homepage: https://hearthsim.info
Size: 675
Language: C#
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
UnityHook is a simple platform for hooking managed function calls, targeting specifically assemblies compiled for Unity3d games.
Installed hooks allow overriding hooked functions' return values, essentially granting complete control over managed code execution in a targeted game.
Hooker is the project that actually injects code into original game assemblies/libraries (= .dll files).
It can be used to 'hook' and 'restore' assemblies. Run hooker.exe help
for information about the options to pass.
To hook game-assemblies you need to tell it the location of the game folder and the path to a compiled HookRegistry binary.
HookRegistry is the project that contains code to be executed when a hooked method/function has been called while the game is running. The project compiles to 1 binary file that must be passed to Hooker. Currently implemented hooks are following:
Hooker will attempt to copy all referenced (by HookRegistry) library files to the library folder of the game. Make sure to validate all necessary library files are copied by inspecting the Hooker log output.
The file which declares all methods, located inside the game libraries, to be hooked. See /Hooker/example_hooks
for more information about it's syntax. The example_hooks file is used in the next section's example.
NOTE: The hooker will always hook all methods entered in the Hooks file, if found. Hooking a specific method when the HooksRegistry binary has no code to inject will have NO side effect on the game! The game will run a bit slower though..
Visual Studio 2017 has to be installed to build both projects. Required components are C# - and Unity development tools! Visual Studio 2017 Community edition is free to download and capable to perform the build.
/createJunction.bat
;bin
folder of each project.The example expects the example_hooks file to be used as of the latest commit, also the latest HookRegistry binary.
Effects of the example
What you need
Steps
KERPATH}\Hooker.exe hook -d "{GAMEDIR}" -h "{HOOKS}" -l "{REGISTRY}"
To restore, run the command
`{HOOKERPATH}\Hooker.exe restore -d "{GAMEDIR}"
`