Redefine methods that classes have on Unity

Upload *YOUR* gamehacking tools/helpers here
Post Reply
User avatar
DhaosCollider
Table Makers
Table Makers
Posts: 106
Joined: Sat Mar 23, 2019 6:59 pm
Reputation: 940

Redefine methods that classes have on Unity

Post by DhaosCollider »

Intro:
  • I ran into a problem where for some reason some classes on Unity game could not be reverse referenced.
    mono_findClass/mono_findMethod methods did not work and did not even allow code injection.
    It took days of sleepless nights to identify all possible causes, fainally I succeeded in making code injection onto method abominable class.
    This contribution is a by-product of that.
  • The cause appears to be when the data reference source is other than Assembly-CSharp.dll.
    If no referent is specified, Cheat Engine may not be able to reverse reference the image.
    It doesnt seem to matter whether its Mono-compiled or IL2CPP-compiled.
Download:
  • Confirmed working on CE 7.4/7.5/7.52.
    No licence, and you are free to use them without any credit to me.
    Have a nice summer break 8-)
Notes:
  • mono_findClassByImage("imageName", "className")
    Return class id using image name, class name. Assign "Assembly-CSharp" if the image name is "".
  • mono_findMethodByImage("imageName", "className", "methodName")
    Return method id using image name, class name, method name.
  • mono_outputMethodSignatures("imageName", "className", "methodName")
    Image
  • mono_findMethodBySignature("imageName", "className", "methodName", "signature")
    1st argument is the image name. Functionally identical to this.
  • mono_registerMethodSignatures(classId)
    Registers the methods of given class with signature.
    Symbol is classname_methodname_signature to distinguish it from existing mono symbols and to avoid problems with AA script syntax.
    CombatEvent.ApplyMultipliers(damage: DamageMultiplier; flatMultiplier: single&):System.Void would look like:


    Image

    Code: Select all

    define(address, CombatEvent_ApplyMultipliers_DamageMultiplier_single&)
    aobscanregion(SymbolName, CombatEvent_ApplyMultipliers_DamageMultiplier_single&, CombatEvent_ApplyMultipliers_DamageMultiplier_single&+100, AOBString)
    Use either of the above codes, everyone doesn't suffer from method overloading.
  • mono_unregisterMethodSignatures(classId)
    Undo registered symbols.
  • mono_registerMethodSignaturesByImage("imageName")
    Registers all methods of all classes the image has with signature symbol.
    Operation is terribly slow, so not recommended for use.
  • mono_unregisterMethodSignaturesByImage("imageName")
    Not recommended for use.
  • mono_symbolsFullyLoaded
    Wait until monoSymbolList is fully loaded. Requires Cheat Engine 7.4/later.
  • mono_FunctionsHighlight
    Highlight global mono_functions on AA Editor and Lua Engine.

    Image
Links to references:

Post Reply

Who is online

Users browsing this forum: No registered users