コード例 #1
0
        public override bool CanLoad(AnELF elf)
        {
            Log.Debug($"Checking if {elf.FilePath} is a Release DSO");

            xapp = null;
            ulong format_tag = 0;

            if (elf.HasSymbol(FormatTag))
            {
                format_tag = elf.GetUInt64(FormatTag);
            }

            XamarinAppReleaseDSO_Version?reader = null;

            switch (format_tag)
            {
            case 0:
            case FormatTag_V1:
                format_tag = 1;
                reader     = new XamarinAppReleaseDSO_V1(ManagedResolver, elf);
                break;

            default:
                Log.Error($"{elf.FilePath} format ({format_tag}) is not supported by this version of TMT");
                return(false);
            }

            if (reader == null || !reader.CanLoad(elf))
            {
                return(false);
            }

            xapp = reader;
            return(true);
        }
コード例 #2
0
 public override bool CanLoad(AnELF elf)
 {
     return
         (HasSymbol(elf, MapModulesSymbolName) &&
          HasSymbol(elf, ModuleCountSymbolName) &&
          HasSymbol(elf, JavaTypeCountSymbolName) &&
          HasSymbol(elf, JavaNameWidthSymbolName) &&
          HasSymbol(elf, MapJavaSymbolName));
 }
コード例 #3
0
        protected bool HasSymbol(AnELF elf, string symbolName)
        {
            bool ret = elf.HasSymbol(symbolName);

            if (!ret)
            {
                Log.Debug($"{elf.FilePath} is missing symbol '{symbolName}'");
            }
            return(ret);
        }
コード例 #4
0
        public bool CanLoad(Stream stream, string filePath)
        {
            stream.Seek(0, SeekOrigin.Begin);
            if (!AnELF.TryLoad(stream, filePath, out AnELF? elf) || elf == null)
            {
                Log.Debug($"AnELF.TryLoad failed (elf == {elf})");
                return(false);
            }

            if (!CanLoad(elf))
            {
                Log.Debug($"Cannot load {elf} in {this}");
                return(false);
            }

            this.elf = elf;
            return(true);
        }
コード例 #5
0
 public abstract bool CanLoad(AnELF elf);
コード例 #6
0
 protected XamarinAppDSO(ManagedTypeResolver managedResolver, AnELF elf)
     : this(managedResolver, Path.GetFullPath(elf.FilePath))
 {
     this.elf = elf;
 }
コード例 #7
0
 protected XamarinAppReleaseDSO_Version(ManagedTypeResolver managedResolver, AnELF elf)
     : base(managedResolver, elf)
 {
 }
コード例 #8
0
 public XamarinAppReleaseDSO_V1(ManagedTypeResolver managedResolver, AnELF elf)
     : base(managedResolver, elf)
 {
 }
コード例 #9
0
 public override bool CanLoad(AnELF elf)
 {
     return(HasSymbol(elf, TypeMapSymbolName));
 }