Log in to reply

How to edit .net with dnSpy?

  • I've seen a few post down dnSpy used to edit a .net mod.

    Since Guadmaz doesn't appear to be active here anymore, can dnSpy be used to remove the annoying always active "B" key in his otherwise awesome trucking mod?

    I've downloaded the software and will attempt to edit the dll myself (for personal use) in no one else can help, but I don't really know what I'm doing in there yet.

    This mod

  • I removed the B key handling, which apparently handles buying property? Not exactly sure that's what you wanted removed. Here is the edited version: https://mega.nz/file/5HYggSrB#4gWG7uwXe3Cv6ed-qqJz6kq6hqNODVNErlH8mJNC0Og

    I take no credit for this mod. Guadmaz, if you are not okay with me editing/sharing your mod, please let me or the moderators know.

  • And to answer your question on how to edit the mod:

    1. Open the .dll in dnSpy.
    2. Expand TruckingMissions (grey), then TruckingMissions.dll (purple), then "-" (without quotes) (grey).
    3. Expand TruckingMissions (green).
    4. Click ProcessKey (orange)
    5. Find this line: if ((Game.IsKeyPressed(Keys.B) ...
    6. Right-click that line and click "Edit IL Instructions..."
    7. Press N. Or, right-click the highlighted rows and click "NOP Instructions"
    8. After that, highlight the rows from Index 364 to Index 375.
    9. Press N. Or, right-click the highlighted rows and click "NOP Instructions"
    10. Click OK.
    11. In the toolbar, click File, then click "Save Module..."
    12. Change the filename if you want, then click OK.

  • @Jitnaught

    Thanks, mate. That's exactly what I wanted, and thanks for the clear instructions as well.

Log in to reply

Looks like your connection to GTA5-Mods.com Forums was lost, please wait while we try to reconnect.