I've got an old 2015 rust branch that i want to host a server on, but i need someone with a basic understanding of c# and assembly editing to help me patch the craft.add command exploit. It's server sided so i've heard its simple to patch up in the server's files. Im 99% sure its in Assembly-CSharp.dll.
I'd do it myself if i was better at writing code lmao
Solved Patching craft.add on an old branch
Discussion in 'Rust Discussion' started by sCrub, Jun 19, 2017.
-
You can accomplish this in a plugin, I helped make it for another BP server a while ago.
Code:using System;namespace Oxide.Plugins { [Info("CraftFix", "Ryan", "1.0.0")] class CraftFix : RustPlugin { object OnServerCommand(ConsoleSystem.Arg arg) { if (arg.connection != null && arg.cmd.namefull == "craft.add") { int amount; if (arg.GetString(1) != null && int.TryParse(arg.GetString(1), out amount) && amount > 999) { var player = arg.connection.player as BasePlayer; PrintToChat(player, "You're not allowed to craft that many"); ConVar.Server.Log("/oxide/logs/CraftFix.txt", $"[{DateTime.Now}] {player.displayName} ({player.UserIDString}) is trying to craft {amount}x {ItemManager.CreateByItemID(int.Parse(arg.GetString(0))).info.displayName.english}"); return true; } } return null; } } }
-
Well the thing is, im struggling to find a download for Oxide v2.0.1527 which is needed for that rust version. Let me know if u find it anywhere or have it laying around, or if you would wanna contact me and try do it without oxide lol. Thanks anyways buddy
-
Wulf Community Admin
-
-
Wulf Community Admin
-
My great mate just patched it really simple without oxide lol, anyways much thanks Wulf.
[DOUBLEPOST=1497918835][/DOUBLEPOST]Also Ryan, ThunderZ is better pce l8 -
-
How come you couldn't figure it out but he could? Jk ty anyways
-
-
Wulf Community Admin
-
Alright i got that, but how do i get the Rust.opj for that version of rust tho? May i get your guidance please, lol.
-
Wulf Community Admin
-
Is there some way someone can make a plugin to fix craft.add in the july 2016 branch? If so that would be a great plugin many servers and peoppe want!
-
-
First download dnSpy: Releases · 0xd4d/dnSpy · GitHub <- Its for editing the server assembly file
When you've done that then go to ur server folder. Then go to RustDedicated_Data > Managed and open Assembly-CSharp.dll with dnSpy. Hit the little arrow thing next to the assembly-csharp and then hit the arrow on "-".
After that navigate down to "ItemCrafter". Click on that. Then rightclick the void called "CanCraft(ItemBlueprint)" thing and hit edit method. Just delete everything from in there and paste my code:
Code:using System; using System.Collections.Generic; using ProtoBuf;// Token: 0x02000318 RID: 792 public partial class ItemCrafter : EntityComponent<global::BasePlayer> { // Token: 0x06000E17 RID: 3607 RVA: 0x0004DA04 File Offset: 0x0004BC04 public bool CanCraft(ItemBlueprint bp, int amount = 1) { if (amount < 1 || amount > 9000) { return false; } foreach (ItemAmount current in bp.ingredients) { if (!this.DoesHaveUsableItem(current.itemid, (int)current.amount * amount)) { return false; } } return true; } }
if (amount < 1 || amount > 9000)
{
return false;
}
-And this exploit was in the game forever, gj facepunch LUL -
Yo @sCrub Can you give me a hand i am trying to fix this and i am trouble with the dnspy part and changing the itemcrafter. Would mean alot!
ADD MY STEAM:using System; Thank's! -
remember to do edit method not edit class. if my code doesnt work or the code for ur branch is different than mine just add in
Code:if (amount < 1 || amount > 9000) { return false; }