Пример #1
0
        public IActionResult Interactive(string bundleId, string dumpId, string cmd)
        {
            var bundleInfo = superDumpRepo.GetBundle(bundleId);

            if (bundleInfo == null)
            {
                logger.LogNotFound("Interactive Mode: Bundle not found", HttpContext, "BundleId", bundleId);
                return(View(null));
            }

            logger.LogDumpAccess("Start Interactive Mode", HttpContext, bundleInfo, dumpId);
            return(View(new InteractiveViewModel()
            {
                BundleId = bundleId, DumpId = dumpId, DumpInfo = dumpRepo.Get(bundleId, dumpId), Command = cmd
            }));
        }
Пример #2
0
        public IActionResult Report(string bundleId, string dumpId)
        {
            ViewData["Message"] = "Get Report";

            var bundleInfo = superDumpRepo.GetBundle(bundleId);

            if (bundleInfo == null)
            {
                return(View(null));
            }

            var dumpInfo = superDumpRepo.GetDump(bundleId, dumpId);

            if (dumpInfo == null)
            {
                return(View(null));
            }

            SDResult res = superDumpRepo.GetResult(bundleId, dumpId);

            return(base.View(new ReportViewModel(bundleId, dumpId)
            {
                BundleFileName = bundleInfo.BundleFileName,
                DumpFileName = dumpInfo.DumpFileName,
                Result = res,
                CustomProperties = Utility.Sanitize(bundleInfo.CustomProperties),
                HasAnalysisFailed = dumpInfo.Status == DumpStatus.Failed,
                TimeStamp = dumpInfo.Created,
                Files = dumpRepo.GetFileNames(bundleId, dumpId),
                AnalysisError = dumpInfo.ErrorMessage,
                ThreadTags = res != null ? res.GetThreadTags() : new HashSet <SDTag>(),
                PointerSize = res == null ? 8 : (res.SystemContext.ProcessArchitecture == "X86" ? 8 : 12),
                CustomTextResult = ReadCustomTextResult(dumpInfo)
            }));
        }
Пример #3
0
        public IActionResult Interactive(string bundleId, string dumpId, string cmd)
        {
            var bundleInfo = superDumpRepo.GetBundle(bundleId);

            if (bundleInfo == null)
            {
                logger.LogNotFound("Interactive Mode: Bundle not found", HttpContext, "BundleId", bundleId);
                return(View(null));
            }

            logger.LogDumpAccess("Start Interactive Mode", HttpContext, bundleInfo, dumpId);
            var id = DumpIdentifier.Create(bundleId, dumpId);

            return(View(new InteractiveViewModel()
            {
                Id = id, DumpInfo = dumpRepo.Get(id), Command = cmd,
                HelpLinks = settings.InteractiveHelpLinks ?? new Dictionary <string, string>()
            }));
        }
Пример #4
0
        public async Task <IActionResult> Get(string bundleId)
        {
            // check if it is a bundle
            var bundleInfo = superDumpRepo.GetBundle(bundleId);

            if (bundleInfo == null)
            {
                return(NotFound("Resource not found"));
            }

            var resultList = new List <SDResult>();

            foreach (var dumpInfo in dumpRepo.Get(bundleId))
            {
                resultList.Add(await superDumpRepo.GetResult(bundleId, dumpInfo.DumpId));
            }
            return(Content(JsonConvert.SerializeObject(resultList, Formatting.Indented, new JsonSerializerSettings {
                ReferenceLoopHandling = ReferenceLoopHandling.Ignore
            }), "application/json"));
        }
Пример #5
0
        public async Task <IActionResult> Report(string bundleId, string dumpId)
        {
            ViewData["Message"] = "Get Report";

            var bundleInfo = superDumpRepo.GetBundle(bundleId);

            if (bundleInfo == null)
            {
                return(View(null));
            }

            var dumpInfo = superDumpRepo.GetDump(bundleId, dumpId);

            if (dumpInfo == null)
            {
                return(View(null));
            }

            SDResult res = await superDumpRepo.GetResult(bundleId, dumpId);

            return(base.View(new ReportViewModel(bundleId, dumpId)
            {
                BundleFileName = bundleInfo.BundleFileName,
                DumpFileName = dumpInfo.DumpFileName,
                Result = res,
                CustomProperties = Utility.Sanitize(bundleInfo.CustomProperties),
                HasAnalysisFailed = dumpInfo.Status == DumpStatus.Failed,
                TimeStamp = dumpInfo.Created,
                Files = dumpRepo.GetFileNames(bundleId, dumpId),
                AnalysisError = dumpInfo.ErrorMessage,
                ThreadTags = res != null ? res.GetThreadTags() : new HashSet <SDTag>(),
                PointerSize = res == null ? 8 : (res.SystemContext?.ProcessArchitecture == "X86" ? 8 : 12),
                CustomTextResult = await ReadCustomTextResult(dumpInfo),
                SDResultReadError = string.Empty,
                DumpType = dumpInfo.DumpType,
                RepositoryUrl = settings.RepositoryUrl,
                InteractiveGdbHost = settings.InteractiveGdbHost,
                Similarities = (await relationshipRepo.GetRelationShips(new DumpIdentifier(bundleId, dumpId)))
                               .Select(x => new KeyValuePair <DumpMetainfo, double>(dumpRepo.Get(x.Key), x.Value))
            }));
        }