Skip to content

Instantly share code, notes, and snippets.

View pacas00's full-sized avatar

Peter Cashel pacas00

  • 07:11 (UTC +10:00)
View GitHub Profile
@cgytrus
cgytrus / Uwuifier.cs
Created March 17, 2023 13:01
c# uwuifier
// its not a nuget package yet and it doesnt have a repo so im just putting it into a gist for now
/*
MIT License
Copyright (c) 2023 ConfiG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@pardeike
pardeike / SimpleHarmonyTranspilerTutorial.md
Last active May 22, 2023 04:43
Simple Harmony Transpiler Tutorial

About
A hopefully easy tutorial on how to make a Transpiler with Harmony
Based on patching a method in the game RimWorld

Introduction

Writing transpilers is like writing a book about how to rewrite a cookbook to make it work for the age of microwave even if that cookbook was written before microwave ovens were invented. It requires good knowledge about the language the cookbook is written in and the topics and information models the cookbook author uses.

As such, writing a transpiler is way more complex and low level than writing a simple method that prefixes, postfixes or replaces an existing method. It is required to have good understanding in general C# programming and how to manipulate abstract data structures with respect to references and relative positioning. It also requires to know the language, in this case CIL, so you can manipulate the instructions without it to get into an illegal state.