Runtime code injection is a technique often used for legitimate purposes such as debugging or extending functionality, but it is also associated with malicious activities like creating cheats for games or implementing malware behavior.
As for Superfighters Deluxe, which is built using the .NET framework, there are several techniques and tools that can be used for runtime code injection. Here are some general methods, but please note that these should only be used for ethical reasons, such as modding games with the permission of the developers or for educational purposes:
1. Reflection: This is a feature of .NET that allows for runtime type inspection and code execution. Using reflection, it is possible to load types, read and write fields, properties, and call methods dynamically.
2. Harmony: Harmony is a library that allows for runtime patching of .NET methods. It can be used to hook into existing code and alter its behavior at runtime.
3. Mono.Cecil or dnlib: These libraries allow for reading and manipulating .NET assemblies in a more detailed way than reflection. You can modify the IL code within a method and perform more in-depth changes.
4. Profiling APIs / Detours: By using the profiling APIs provided by the .NET framework or function hooking libraries like EasyHook or Detours, you can intercept function calls and redirect them to your code.
5. Memory manipulation: External tools like Cheat Engine use memory manipulation to change the values within a process's memory space. You could, in principle, change function pointers or inject jump instructions to redirect code flow.
It's important to remember that:
- Injecting code into a running executable may violate the game's terms of service or end-user license agreement.
- Writing or using cheats can get you banned from online play.
- Modifying executable files or memory can cause instability in the program, leading to crashes or unintended behavior.
- Runtime code injection can be detected by anti-cheat software, and there may be legal and moral implications depending on what you're trying to achieve.
For any modifications to games or executables, you should always have explicit permission from the copyright owner.
With all that said, if you're simply interested in understanding how these techniques work for the sake of learning and experimentation in a controlled environment (like your own projects), you can find plenty of resources on topics like reflection, IL manipulation, and the aforementioned tools and libraries.
If your intention is to mod Superfighters Deluxe for personal use or you're working on something that is permitted by the developers, then you'll want to do so with caution, making sure that you are not breaking any laws or terms of service.