How to use methods in AssemblyCsharp?

Posts 1–4 of 4 · Page 1 of 1
How to use methods in AssemblyCsharp?
So I'm completely new to this and I'm trying to hack a game called mini guns on steam. I opened up the Assembly-CSharp.dll in dnSpy and under a class called "CheatControl" there are literally hacks already made lol - there are methods that modify your manpower or give you gold (I assume these were made for debug purposes). But how do I use those methods? When I try to create an OnGUI() method it always makes it public extern void OnGUI(), which doesn't let me add anything to it. I can't find a way to get rid of the extern. Also sorry if this is a stupid question but where are the classes actually initialized (i.e. a new object is created)?
Could you record a video of your process? I don't work with dnSpy often and don't have access to the game you're working with. But I might be able to help after seeing how you're adding the new method.
Quote Originally Posted by Hell_Demon View Post
Could you record a video of your process? I don't work with dnSpy often and don't have access to the game you're working with. But I might be able to help after seeing how you're adding the new method.
Idk why but suddenly it lets me remove the extern and still compiles without errors... weird. Anyways now I have the problem of the actual button not showing up in game, so I guess I gotta figure out which classes to create the OnGUI method for so that it actually shows up in game. Also is there a way to call a method from another class in the method of a class (e.g. Class A has method A1, can Class B's method B1 call A1 in C#)?
Quote Originally Posted by InnovationTT View Post
Idk why but suddenly it lets me remove the extern and still compiles without errors... weird. Anyways now I have the problem of the actual button not showing up in game, so I guess I gotta figure out which classes to create the OnGUI method for so that it actually shows up in game. Also is there a way to call a method from another class in the method of a class (e.g. Class A has method A1, can Class B's method B1 call A1 in C#)?
If it is a static method then yes, it's simply A.A1();
If it's not a static method then you will need a reference to an instance of A
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us