Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How get file path by handle in windbg?

How I can obtain file path from handle with windbg/kd in kernel mode?

like image 369
user694655 Avatar asked Feb 13 '13 16:02

user694655


1 Answers

Use !handle <handle_num> 7 <proc_id> to display detailed information for that handle where <handle_num> is the handle value and <proc_id> is the process id value (both hex based) see this msdn link for further information.

You can gleam your process id from a user mode session, this is the easiest method, just attach in user mode and enter the pipe command | and it will output like so:

. 0 id: 1680 attach name: D:\test\MyApp.exe

so 1680 would be the proc id, then list the handles using !handle and then in kernel mode enter:

!handle <handle_num> 7 1680

will display what you want, there is a useful blog entry on this here.

like image 150
EdChum Avatar answered Sep 22 '22 17:09

EdChum