示例#1
0
        public MachCoreKeyGenerator(ITracer tracer, SymbolStoreFile file)
            : base(tracer)
        {
            StreamAddressSpace dataSource = new StreamAddressSpace(file.Stream);

            _core = new MachCore(dataSource);
        }
示例#2
0
        private IEnumerable <IDumpModule> TryParseMachODump(IAddressSpace dumpDataSource)
        {
            MachCore core = new MachCore(dumpDataSource);

            if (!core.IsValidCoreFile)
            {
                return(null);
            }
            return(core.LoadedImages.Select(i => new MachDumpModule(i)));
        }
示例#3
0
文件: Tests.cs 项目: runt18/symstore
 public void ParseCore()
 {
     using (FileStream core = File.OpenRead("TestBinaries\\core.12985"))
     {
         StreamAddressSpace dataSource = new StreamAddressSpace(core);
         // hard-coding the dylinker position so we don't pay to search for it each time
         // the code is capable of finding it by brute force search even if we don't provide the hint
         MachCore          coreReader = new MachCore(dataSource, 0x00007fff68a59000);
         MachLoadedImage[] images     = coreReader.LoadedImages.Where(i => i.Path.EndsWith("libcoreclr.dylib")).ToArray();
         MachOFile         libCoreclr = images[0].Image;
         Assert.Equal(Guid.Parse("c988806d-a15d-5e3d-9a26-42cedad97a2f"), new Guid(libCoreclr.Uuid));
     }
 }
示例#4
0
        private bool IsMachCore(Stream decompressed)
        {
            try
            {
                var machCore = new MachCore(new StreamAddressSpace(decompressed));

                return(machCore.IsValidCoreFile);
            }
            catch
            {
                return(false);
            }
        }
示例#5
0
 public void ParseCore()
 {
     using (Stream core = TestUtilities.DecompressFile("TestBinaries/core.gz", "TestBinaries/core"))
     {
         StreamAddressSpace dataSource = new StreamAddressSpace(core);
         // hard-coding the dylinker position so we don't pay to search for it each time
         // the code is capable of finding it by brute force search even if we don't provide the hint
         MachCore coreReader = new MachCore(dataSource, 0x000000010750c000);
         Assert.True(coreReader.IsValid());
         MachLoadedImage[] images     = coreReader.LoadedImages.Where(i => i.Path.EndsWith("libcoreclr.dylib")).ToArray();
         MachOFile         libCoreclr = images[0].Image;
         Assert.True(libCoreclr.IsValid());
         Assert.Equal(Guid.Parse("c5660f3e-7352-b138-8141-e9d63b8ab415"), new Guid(libCoreclr.Uuid));
     }
 }