Exemplo n.º 1
0
 public PlusSearch(Il2CppData il2Cpp, int methodCount, int typeDefinitionsCount, long maxMetadataUsages)
 {
     this.il2Cpp               = il2Cpp;
     this.methodCount          = methodCount;
     this.typeDefinitionsCount = typeDefinitionsCount;
     this.maxMetadataUsages    = maxMetadataUsages;
 }
Exemplo n.º 2
0
 public Il2CppExecutor(Metadata metadata, Il2CppData il2Cpp)
 {
     this.metadata = metadata;
     this.il2Cpp   = il2Cpp;
 }
Exemplo n.º 3
0
 public Il2CppDecompiler(Il2CppExecutor il2CppExecutor)
 {
     executor = il2CppExecutor;
     metadata = il2CppExecutor.metadata;
     il2Cpp   = il2CppExecutor.il2Cpp;
 }
Exemplo n.º 4
0
        public static bool Init(byte[] il2cppBytes, byte[] metadataBytes, out Metadata metadata, out Il2CppData il2Cpp)
        {
            var sanity = BitConverter.ToUInt32(metadataBytes, 0);

            if (sanity != 0xFAB11BAF)
            {
                throw new Exception("ERROR: Metadata file supplied is not valid metadata file.");
            }
            metadata = new Metadata(new MemoryStream(metadataBytes));

            var il2cppMagic  = BitConverter.ToUInt32(il2cppBytes, 0);
            var version      = metadata.Version;
            var il2CppMemory = new MemoryStream(il2cppBytes);

            il2Cpp = new PE(il2CppMemory, version, metadata.maxMetadataUsages);
            var flag = il2Cpp.PlusSearch(metadata.methodDefs.Count(x => x.methodIndex >= 0), metadata.typeDefs.Length);

            if (!flag)
            {
                flag = il2Cpp.Search();
            }
            if (!flag)
            {
                flag = il2Cpp.SymbolSearch();
            }
            return(flag);
        }