コード例 #1
0
        private void OpenPdb(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.Filter = "Program Database (*.pdb)|*.pdb";

            bool?res = ofd.ShowDialog();

            if (res.HasValue && res == true)
            {
                pdb = new PdbParser.PdbParser(ofd.FileName);
                List <Symbol> syms = pdb.DumpAllPublics();

                foreach (Symbol s in syms)
                {
                    UInt32 addr = s.Rva + (uint)state.Pe.GetImageBase();
                    XPeParser.SectionHeader section = state.Pe.GetSectionByAddress(s.Rva);

                    /* Code or Mem_Executable */
                    if ((section.Characteristics & 0x20000020) != 0)
                    {
                        Function f = new Function(state, s.Name, addr);
                        f.Name    = s.Name;
                        f.Address = addr;

                        ListViewFunction lvf = new ListViewFunction(s.Name, addr, f);
                        _FuncCollection.Add(lvf);

                        f.ListViewEntry = lvf;
                        state.Functions.Add(f);
                    }
                }

                state.Functions.Sort(FunctionAddressComparison);
            }
        }
コード例 #2
0
        private void OpenPdb(object sender, RoutedEventArgs e)
        {
            Microsoft.Win32.OpenFileDialog ofd = new Microsoft.Win32.OpenFileDialog();
            ofd.Filter = "Program Database (*.pdb)|*.pdb";

            bool? res = ofd.ShowDialog();
            if (res.HasValue && res == true)
            {
                pdb = new PdbParser.PdbParser(ofd.FileName);
                List<Symbol> syms = pdb.DumpAllPublics();

                foreach (Symbol s in syms)
                {
                    UInt32 addr = s.Rva + (uint) state.Pe.GetImageBase();
                    XPeParser.SectionHeader section = state.Pe.GetSectionByAddress(s.Rva);

                    /* Code or Mem_Executable */
                    if ((section.Characteristics & 0x20000020) != 0)
                    {
                        Function f = new Function(state, s.Name, addr);
                        f.Name = s.Name;
                        f.Address = addr;

                        ListViewFunction lvf = new ListViewFunction(s.Name, addr, f);
                        _FuncCollection.Add(lvf);

                        f.ListViewEntry = lvf;
                        state.Functions.Add(f);
                    }
                }

                state.Functions.Sort(FunctionAddressComparison);
            }
        }