ILHookHelperAPI

⭐ — (3 endorsements) 📥 902 downloads 📌 v1.0.1 📅 4/1/2021
⚪ Last updated 2021

By Rein · Libraries

⬇ Download Mod Source: Thunderstore ↗ 📅 Updated: 4/4/2021 📅 Created: 4/1/2021

🔍 Analysis

  • 👍 0.3% endorsement rate
  • 🏆 #6 of 9 Libraries mods in this game by downloads

📋 About This Mod

Figured I might as well release some of my tooling so others can benefit from it. Summary This is a library that adds a functional-style DSL for writing IL hooks. Wtf is a DSL? DSL = Domain Specific (programming) Language In this case, its a fancy term for a set of functions that enable a specific style of programming within your C# code. Wtf does functional-style mean? Don't worry about it if you don't know. All you really need to know is that this style makes your IL hooks much, much, much easier to read and write. Example code Simple value swap static void MyILHook(ILContext il) => new ILCursor(il) .Goto(x => x.MatchLdcR4(2.65f)) .Delete() .Op_LdConst(3.5f); Swap add for custom function static void MyILHook(ILContext il) => new ILCursor(il) .Goto(x => x.MatchAdd()) .Delete() .OP_Call<Func<int,int,int>>((lhs, rhs) => lhs * rhs + 14); Store value from one place, reuse it in another static void MyILHook(ILContext il) => new ILCursor(il) .Goto(MoveType.After, x => x.MatchLdfld<Cheese>(nameof(Cheese.goodLevel))) .OP_Dup() .AddLocal<int>(out var index) .OP_StLocal(index) .Goto(MoveType.After, x => x.MatchLdfld<NotCheese>(nameof(NotCheese.badLevel))) .OP_LdLocal(index) .OP_Sub(); Spam console with useless text to confuse users private void MyILHook(ILContext il) => new ILCursor(il) .Log(base.Logger.LogError) .LogContext(base.Logger.LogFatal); Why? Initially I told myself I was releasing this to make life easier for some other people but then I spent 2 hours in paint making this horrible icon. Now I actually have no idea why I released this and am instead left with a profound feeling of self-doubt, confusion, and emptiness. Changelog 1.0.1 -Fixed nullability of a few cursor functions

Implements a functional-styled DSL for working with ILHooks inside C# syntax.

📊 Mod Details

Game
Thunderstore Mods
Author
Rein
Version
1.0.1
Downloads
902
Endorsements
3
Category
Libraries
Created
4/1/2021
Updated
4/4/2021
Tags
Libraries

🔧 How to Install Thunderstore Mods

Use r2modman/Thunderstore Mod Manager. Or manual: install BepInEx, drop mods into plugins folder.

📖 Full step-by-step install guide for Thunderstore →

Visit the official mod page for specific installation instructions for this mod.

🎮 Need cheat codes or console commands? Check ur gaming wiki for Thunderstore commands, item IDs, and more.

Keep browsing — more Thunderstore mods await

📋 All Thunderstore Mods 🏆 Top 25 📂 More Libraries 👤 More by Rein 🔎 Similar Mods 🌐 Best Libraries (All Games) 🔀 Check Compatibility ⚖️ Compare Mods 🆕 New Mods