Ejemplo n.º 1
0
 public IntPtr FindPointer(Process program, string asmName)
 {
     if (Decompiler == null)
     {
         return(IntPtr.Zero);
     }
     return(ProgramPointer.DerefPointer(program, GetPointer(program, asmName), AutoDeref));
 }
        public IntPtr FindPointer(Process program, string asmName)
        {
            if (il2Cpp == null || lastPID != program.Id)
            {
                lastPID = program.Id;
                BasePtr = IntPtr.Zero;

                string programPath = Path.GetDirectoryName(program.MainModule.FileName);
                string metaFile    = Path.Combine(programPath, @"oriwotw_Data\il2cpp_data\Metadata\global-metadata.dat");
                string ilFile      = Path.Combine(programPath, @"GameAssembly.dll");
                if (!File.Exists(metaFile) || !File.Exists(ilFile))
                {
                    return(IntPtr.Zero);
                }

                byte[] metaDataBytes = File.ReadAllBytes(metaFile);
                byte[] il2CppBytes   = File.ReadAllBytes(ilFile);
                Il2CppReader.Init(il2CppBytes, metaDataBytes, out metaData, out il2Cpp);
                executor   = new Il2CppExecutor(metaData, il2Cpp);
                decompiler = new Il2CppDecompiler(executor);
            }

            return(ProgramPointer.DerefPointer(program, GetPointer(program, asmName), AutoDeref));
        }
Ejemplo n.º 3
0
 public IntPtr FindPointer(Process program, string asmName) => ProgramPointer.DerefPointer(program, GetPointer(program, asmName), AutoDeref);