Glatrix / MonoPipeSharp

C# Implimentation of Cheat Engine's MonoDataCollector
3 stars 1 forks source link

can not get class type #2

Open Fractal-Idea opened 1 year ago

Fractal-Idea commented 1 year ago

i try to get Instances of Class, but get class type id failed.

follow this repository, i add some code to get mono class type & mono class reflection type, but failed.

public static UInt64 pipe_class_type(UInt64 classId)
{
   // from [cheat-engine] / [Cheat Engine] / [bin] / [autorun] / monoscript.lua
   // MONOCMD_GETCLASSTYPE = 55
    WriteByte(MONOCMD_GETCLASSTYPE);
    WriteQword(classId);

    return (UInt64)ReadQword();
}
public UInt64 pipe_class_reflection_type(UInt64 classTypeId)
{
   // from [cheat-engine] / [Cheat Engine] / [bin] / [autorun] / monoscript.lua
   // MONOCMD_GETREFLECTIONTYPEOFCLASSTYPE = 58
    WriteByte(MONOCMD_GETREFLECTIONTYPEOFCLASSTYPE );
    WriteQword(classTypeId);

    return (UInt64)ReadQword();
}

when classId of "UnityEngine.UnityResources" , return 0 when classId of "UnityEngine.UnityObject" , return an int64 number

i try CheatEngine , it can get the special class's instance address. i can't find out what's wrong.

Glatrix commented 1 year ago

I'm not too sure. I just made some basic ports from lua to C#. Might be better to make a custom data collector dll to make things easier. Could also be documented that way.