How to load a hack using the Assembly-CSharp

Posts 17 of 7 · Page 1 of 1
How to load a hack using the Assembly-CSharp
Hello guys! i have a doubt, this is about how to load my hack with a game which has the Assembly-CSharp in the folder "Managed" it's from steam.
Does it have a method to load a hack and make a simple menu that will have my functions? i need to call the functions, read variables and etc...
i would like to make a hack like this:
https: // www . youtube . com/watch?v=yh94ehuvKh0
is it possible with Visual Studio? if so, how can i do that? thanks!
Isn't it unturned :P ?
I have heard from someone that you can merge it with your dll and make a hack but haven't tested it
i wanna make for Warmode do you have an idea how can i do it?
i want to get more knowledge in unity games.
Does your hack contain a hook class?
Definition: A hook class is a class that contains a static method which is called by assembly-csharp.dll the method then creates GameObject and loads the scripts into that GameObject then the hook method exits.

If you have such a thing then it is simple. First you will need to download a tool with the name dnSpy it can be found on github. Once you finished that you will need to open the assembly-csharp using the tool. Make sure you back up your assembly-csharp before opening the it with the tool. Next you have 2 options:

1. You can find a class that extends the MonoBehaviour class and contains a Start method make sure that the class loads when the game starts(those are usually classes which contain no references)
2. You can find a class which has a .cctor method these are static constructors and are the first thing that is ran when the dll is loaded

Once you find one or the other you need to inject a call to your hook method. For this make sure you have your hack dll in the same directory as the assembly-csharp dll then open your hack dll with dnSpy so you have both the assembly-csharp and your hack dll open. Now if you went with the first option you will need to open the Start method and edit the IL, if you went with the second option open the .cctor method and edit the IL. Then at the start of the IL code(the top) you have to add a single instruction. So insert a new instruction to the top and put it as a CALL instruction then under the value select browse to the hook method of your hack. Press OK and under File press Save Module and Save. Congratulations you have just hooked your hack to assembly-csharp. Anything in your hack dll will now run as part of the game.
Thank you for this explanation it helped me a lot, but i have this hook class follow this below:

public class Class1
{
public static GameObject load_object;
public static void Load()
{
load_object = new GameObject();
load_object.GetComponent<Hacks>();
UnityEngine.Object.DontDestroyOnLoad(load_object);
}

it doesnt show any error, i've created this class called "Hacks" and i created the functions Start, Update, OnGUI, but this function called "Update" and the others functions dont make anything, i've called this "Load" function at Assembly-CSharp i put in the Shoot function to make the test, it doesnt work do you know why the values dont change?
Quote Originally Posted by joker1212 View Post
Thank you for this explanation it helped me a lot, but i have this hook class follow this below:

public class Class1
{
public static GameObject load_object;
public static void Load()
{
load_object = new GameObject();
load_object.GetComponent<Hacks>();
UnityEngine.Object.DontDestroyOnLoad(load_object);
}

it doesnt show any error, i've created this class called "Hacks" and i created the functions Start, Update, OnGUI, but this function called "Update" and the others functions dont make anything, i've called this "Load" function at Assembly-CSharp i put in the Shoot function to make the test, it doesnt work do you know why the values dont change?
Because you used GetComponent

Try the following:
Code:
public class Class1
{
public static GameObject load_object;
public static Hacks hacks;
public static void Load()
{
load_object = new GameObject();
hacks = load_object.AddComponent<Hacks>();
UnityEngine.Object.DontDestroyOnLoad(load_object);
}
ITS SOLVED!!! THANK YOU SO MUCH!!!!!!!! YOU'RE AWESOME!!!
FIRST OFF I WANT TO SAY I'M SORRY FOR BAD ENGLISH CAUSE IT'S NOT MY MAIN LANGUAGE
Posts 17 of 7 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?