Closed yangboyd closed 5 months ago
Are you using Harmony or HarmonyX ?
It's Harmony.dll 2.2.2.0
Are you using Harmony or HarmonyX ?
The parameter name is of course dependent on your source code’s file encoding. You are responsible to use the right string or use the relative parameter position instead. You can also use an annotation that uses a custom name or you can use a parameter array and use the relative position in that array. Many possibilities.
The parameter name is of course dependent on your source code’s file encoding. You are responsible to use the right string or use the relative parameter position instead. You can also use an annotation that uses a custom name or you can use a parameter array and use the relative position in that array. Many possibilities.
Thanks, It seems that HarmonyParameter do the work, but it's removed. Would you please show some example?
Here is the documentation build from the actual source code: https://harmony.pardeike.net/api/HarmonyLib.HarmonyArgument.html
Here is the documentation build from the actual source code: https://harmony.pardeike.net/api/HarmonyLib.HarmonyArgument.html
It's an great annotation. How to manually use this HarmonyArgument? As I call the harmony.patch directly, I need patch the dll manually as it's loaded later sometime.
It’s part of HarmonyMethod which you are using if you are doing manual patching. Edit: what I meant is that it’s part of the patch method which you are using anyway even with manual patching.
It’s part of HarmonyMethod which you are using if you are doing manual patching. Edit: what I meant is that it’s part of the patch method which you are using anyway even with manual patching.
Great!
It’s part of HarmonyMethod which you are using if you are doing manual patching. Edit: what I meant is that it’s part of the patch method which you are using anyway even with manual patching.
It does not work this way: [HarmonyArgument("\u0004\u000F\u0007\u0005\u0006\u0003\u0008\u000C", "obj")] public static bool ObfuscateMethod1Prefix(ref object __result, object obj, MethodBase mb, byte[] param1, byte[] param2, byte[] param3, byte[] param4, int[] param5, int param6) {
What's the proper usage?
You put it on a parameter or the class depending on its function: https://harmony.pardeike.net/api/HarmonyLib.HarmonyArgument.htm - note the annotation usage that are itself annotations. If this version does not work then try one that uses the index for example.
Harmony 2.0 Windows x86 .Net 4..7
The target method has Unicode parameter name, the patch method use ascii parameter name. It seems that harmony require parameter name should be the same.
hook exception: System.Exception: Parameter "obj" not found in method static loader. loader. ::(System.Object , System.Reflection.MethodBase , System.Byte[] , System.Byte[] , System.Byte[] , System.Byte[] , System.Int32[] , System.Int32 ) 在 HarmonyLib.MethodPatcher.EmitCallParameter(MethodInfo patch, Dictionaryb__0(MethodInfo fix)
在 HarmonyLib.CollectionExtensions.Do[T](IEnumerable
2 variables, LocalBuilder runOriginalVariable, Boolean allowFirsParamPassthrough, LocalBuilder& tmpObjectVar, List
1 tmpBoxVars) 在 HarmonyLib.MethodPatcher.<>c__DisplayClass35_0.1 sequence, Action
1 action) 在 HarmonyLib.MethodPatcher.AddPrefixes(Dictionary2 variables, LocalBuilder runOriginalVariable) 在 HarmonyLib.MethodPatcher.CreateReplacement(Dictionary
2& finalInstructions) 在 HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo) 在 HarmonyLib.PatchProcessor.Patch() 在 HarmonyLib.Harmony.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler, HarmonyMethod finalizer)