Beispiel #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));
        }
 public static extern bool SymGetLineFromAddr64(IntPtr hProcess, ulong Addr, out IntPtr Displacement, ref IMAGEHLP_LINE64 Line);
 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);
 }
Beispiel #4
0
 public extern static bool SymGetLineFromAddr64(IntPtr hProcess, ulong Addr, out IntPtr Displacement, ref IMAGEHLP_LINE64 Line);