PostHow to make a hacked client (Terraria 1.3.5.3)

Posts 111 of 11 · Page 1 of 1
How to make a hacked client (Terraria 1.3.5.3)
How to make a hacked client with DNSpy (By: Hunter101)

Hello terrarians, and welcome to an updated thread on how to make a modified client in terraria. This thread will only cover how to modify the executable and inject code at startup. It will not cover how to make commands, or do anything really, but it will put you on the right track. If this post gets enough attention and likes, I will do a second part with more info (Hooking chat, adding commands).

Part 1 (Download DNSPY and open the Terraria executable) :
To download DNSpy, please visit this link. https://github.com/0xd4d/dnSpy/releases DNSpy is .Net debugger and assembly editor, which will allow you to modify the Terraria executable. Once you have opened the link, click DNSpy.zip, and wait for it to download. Once it is finished, open the .zip file with a archive extracting program (7-zip or WinRAR), and then scroll down and open dnSpy-x86.exe. Once in the program, click on File>Open..., then find and select Terraria.exe (from your steamapps folder.).

Part 2 (Patch the Terraria executable to hook startup code)
Great, you got it open. I'm proud of you for making it this far. Okay, now this is where it may get a little harder. Try to keep up. First, look to the Assembly Explorer. It's on the far left and it is very noticeably blue. Found it? Great. Now scroll through the list until you find "Terraria". Press the drop-down triangle, again, look for "Terraria" except now in yellow, drop-down it again, and find "Program", now in green, once again press the arrow to drop-down. Now, right click "LaunchGame(...", and click "Edit Method". Now, a box will open. Delete these lines.
Code:
if (Platform.IsOSX)
{
	Main.OnEngineLoad += delegate
	{
			Main.instance.IsMouseVisible = false;
	};
}
Now tap "Compile". Okay, you still with me? No? Once you are back in the Assembly Explorer, move up back towards the yellow "Terraria", and right click it. Click "Add Class". Once it shows the blank box, paste this in.
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
namespace Terraria
{
	public class Mods
	{
                public static void Main()
		{
			Terraria.Main.OnTick += Mods.OnUpdate;
		}
                 static Mods()
		{
                }
                public static void OnUpdate()
		{
                 //code in here will run every frame
                }
                public Mods()
		{
		}
        }
}
Then, press "Compile". Great, you should probably now save your client. Go to File>Save Module and click "OK". You can now start it by pressing Debug>Start Debugging... To make sure it worked, add this code inside the brackets of "public static void OnUpdate()" to your Mods code (under yellow Terraria).
Code:
Terraria.Main.NewText("Hello World!");
(Then File>Save Module, obviously.) If it worked, Hello World! will spam your chat really fast whenever you are in game. Feel free to remove this after.
wtf, how did I miss that OnTick event. Thanks lol
I just realized that I really messed up this tutorial. Unfortunately it's too late to edit this so I will be re-writing it, with pictures, tommorow.
Are you the one that hacked on Jupiter, vindictus and Pedguin?
Nah just wondering nice tutorial btw
Huh. I never knew this event was a thing either. Probably won't ever use it, but nice to know it's there.
Quote Originally Posted by IDontReallyKnowEither View Post
Huh. I never knew this event was a thing either. Probably won't ever use it, but nice to know it's there.
Here is the correction, as I see you didn't post it
Edit LaunchGame as per: https://i.imgur.com/5bPVFpW.png
Your method is as per: https://i.imgur.com/DxCZnN3.png

Note: 1.4.0.5 now uses
Main.OnTickForThirdPartySoftwareOnly += Mods.OnUpdate;
not
Main.OnTick += Mods.OnUpdate;
.
i have a bug: "The type or namespace name 'ReLogic' could not be found" when i edit LaunchGame method, how to fix this.
Quote Originally Posted by hero0393 View Post
i have a bug: "The type or namespace name 'ReLogic' could not be found" when i edit LaunchGame method, how to fix this.
Export "Terraria.Libraries.ReLogic.ReLogic.dll‎" from Terraria's EXE Resources to the game directory named "ReLogic.dll" and try again.
Posts 111 of 11 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?