Ok so I had this injector executable code in another project Console, is this correct?…
- User
Ok so I had this injector executable code in another project Console, is this correct?
Heres the injector code
using System.Reflection; using System; using System.Linq;
public class Program { public static void Main(string[] args) { ReflectionVerifier.ListAllClassesAndMethods("SFD"); } }
public class ReflectionVerifier { public static void ListAllClassesAndMethods(string namespaceName) { try { Type[] types = Assembly.GetExecutingAssembly().GetTypes() .Where(t => t.Namespace == namespaceName) .ToArray();
bool foundPlayerClass = false; foreach (Type type in types) { if (type.Name == "Player") { foundPlayerClass = true; } } if (!foundPlayerClass) { Console.WriteLine("SFD.Player class not found."); return; } if (types.Length == 0) { Console.WriteLine($"No other classes found in namespace '{namespaceName}'."); return; } foreach (Type type in types) { Console.WriteLine($"Class: {type.Name}"); // ... } } catch (Exception ex) { Console.WriteLine($"Error listing classes and methods: {ex.Message}"); } }}
And heres the classlibrary.dll code
using HarmonyLib; using SFD; // Assuming SFD.Player is the correct namespace for the Player class using System.IO; // Namespace for file input/output
namespace SuperFightersDeluxeCustomJump { public class EntryPoint { // The game (or whatever process you’re injecting into) needs to call this method to start the patching process. public static void Init() { var harmony = new Harmony("com.yourdomain.superfightersdeluxecustomjump"); harmony.PatchAll();
Log("Harmony patches applied."); } // Simple logging method that appends text to a log file. public static void Log(string message) { File.AppendAllText("C:\\Users\\Ninja\\Downloads\\idk", message + "\n"); } } [HarmonyPatch(typeof(SFD.Player))] public static class PlayerJumpPatch { // This HarmonyPrefix will replace the original JumpValue method call. [HarmonyPrefix] [HarmonyPatch("JumpValue")] public static bool PrefixJumpValue(SFD.Player __instance) { // Call the original method with the modified parameter. __instance.Jump(16.55f, false); // Log that the patch method has been called. EntryPoint.Log("PrefixJumpValue method has been called."); // Return false to prevent the original JumpValue method from running after this return false; } }}
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.