Esempio n. 1
0
        public KeyValuePair <string, int> GetFileAndLine(ulong addr)
        {
            IntPtr          displacement    = new IntPtr();
            IMAGEHLP_LINE64 lineNumberIdent = new IMAGEHLP_LINE64();

            lineNumberIdent.Initialize();
            if (DbgHelp.SymGetLineFromAddr64
                    (hProcess, addr, out displacement, ref lineNumberIdent))
            {
                Console.Out.WriteLine("Got File and Line for addr " + addr + ": " + lineNumberIdent.FileName.ToString() + ":" + lineNumberIdent.LineNumber);
                return(new KeyValuePair <string, int>(lineNumberIdent.FileName.ToString(), (int)lineNumberIdent.LineNumber));
            }
            return(new KeyValuePair <string, int>("unknown", 0));
        }
Esempio n. 2
0
 public static extern bool SymGetLineFromAddr64(IntPtr hProcess, ulong Addr, out IntPtr Displacement, ref IMAGEHLP_LINE64 Line);
Esempio n. 3
0
 public KeyValuePair<string, int> GetFileAndLine(ulong addr)
 {
     IntPtr displacement = new IntPtr();
     IMAGEHLP_LINE64 lineNumberIdent = new IMAGEHLP_LINE64();
     lineNumberIdent.Initialize();
     if (DbgHelp.SymGetLineFromAddr64
         (hProcess, addr, out displacement, ref lineNumberIdent))
     {
         Console.Out.WriteLine("Got File and Line for addr " + addr + ": " + lineNumberIdent.FileName.ToString() + ":" + lineNumberIdent.LineNumber);
         return new KeyValuePair<string, int>(lineNumberIdent.FileName.ToString(), (int)lineNumberIdent.LineNumber);
     }
     return new KeyValuePair<string, int>("unknown", 0);
 }
Esempio n. 4
0
 public extern static bool SymGetLineFromAddr64(IntPtr hProcess, ulong Addr, out IntPtr Displacement, ref IMAGEHLP_LINE64 Line);