示例#1
0
 public void EditFind()
 {
     using (ISearchDialog dlg = dlgFactory.CreateSearchDialog())
     {
         if (uiSvc.ShowModalDialog(dlg) == DialogResult.OK)
         {
             Func <int, Program, bool> filter = GetScannedFilter(dlg);
             var re = Scanning.Dfa.Automaton.CreateFromPattern(dlg.Patterns.Text);
             if (re == null)
             {
                 return;
             }
             var hits = this.decompilerSvc.Decompiler.Project.Programs
                        .SelectMany(program =>
                                    re.GetMatches(program.Image.Bytes, 0)
                                    .Where(o => filter(o, program))
                                    .Select(offset => new AddressSearchHit
             {
                 Program = program,
                 Address = program.Image.BaseAddress + offset
             }));
             srSvc.ShowSearchResults(new AddressSearchResult(
                                         this.sc,
                                         hits));
         }
     }
 }
示例#2
0
        public void FindProcedures(ISearchResultService svc)
        {
            var hits = this.decompilerSvc.Decompiler.Project.Programs
                       .SelectMany(program => program.Procedures.Select(proc =>
                                                                        new ProcedureSearchHit(program, proc.Key, proc.Value)))
                       .ToList();

            svc.ShowSearchResults(new ProcedureSearchResult(this.sc, hits));
        }
示例#3
0
 public void FindProcedures(ISearchResultService svc)
 {
     var hits = this.decompilerSvc.Decompiler.Project.Programs
         .SelectMany(program => program.Procedures.Select(proc =>
             new ProcedureSearchHit(program, proc.Key, proc.Value)))
         .ToList();
     svc.ShowSearchResults(new ProcedureSearchResult(this.sc, hits));
 }