You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generic instance method (e.g. callvirt on a GenericInstanceMethod)
Generic instance type (e.g. used in newobj, isinst)
Generic parameter (references to a generic parameter)
Type reference (e.g. newobj, castclass, ldtoken)
Method reference (external & intra‑type calls)
Field reference (external & intra‑type fields)
Instruction target (operand is another Instruction)
Instruction array (e.g. array of targets for ldtoken)
CallSite operand (function‑pointer call sites)
Lambdas (e.g. in Linq)
dynamic types
Function pointers
Delegates
In addition to aforementioned unsupported changes, AssemblyPatcher will fail to update in any of the following cases:
Any sort of yield statements that would result in the creation of internal state machine. This includes any coroutines and other enumerators. In case an IEnumerable is being updated, you can modify the method successfully to return the whole IEnumerable at once instead of using yield.
Any types that pass reference to self (even if it happens outside of methods being edited). This happens because of reference clash between the original assembly loaded for references and the working copy with merged original code and patched methods.
Any references to nested types within the methods will end up being mapped to the nested copy in the working assembly.
Any circular dependencies as classes are added into the assembly one by one
Currently, P2ModLoader can do following modifications to the assemblies:
Namespaces:
Classes:
Structs:
Interfaces:
Enums:
Methods:
inparametersoutparametersrefparametersparamsparametersyieldmethods (state machines)Constructors:
Properties:
Fields:
Events:
Generics:
Nested Types:
Constructors:
Instructions:
nop,ret,ldnull)ldstr "hello")ldc.i4,ldc.i8,ldc.r4,ldc.r8)ldloc,stloc)ldarg,starg)br,brtrue,beq)switch)callvirton aGenericInstanceMethod)newobj,isinst)newobj,castclass,ldtoken)Instruction)ldtoken)dynamictypesIn addition to aforementioned unsupported changes, AssemblyPatcher will fail to update in any of the following cases:
yieldstatements that would result in the creation of internal state machine. This includes any coroutines and other enumerators. In case an IEnumerable is being updated, you can modify the method successfully to return the whole IEnumerable at once instead of usingyield.