Reply To: retrieving full process image path name in kernel mode

Home Forums Discussions General retrieving full process image path name in kernel mode Reply To: retrieving full process image path name in kernel mode

#5884
Vadim Smirnov
Keymaster

    Yes there is last field EPROCESS block which points to a UNICODE_STRING which gives me the FullPathName , but still I am not able to get the Drive Letters form there.

    You have not explained in what form you get full path name here and I supposed you have got volume device name instead drive letter. Seems I got wrong 😳

    Anyways, why won’t you use the approach I posted above in this thread:

    1. Obtain EPROCESS pointer through IoGetCurrentProcess().
    2. For NT 4.0 and 5.0 take section handle from EPROCESS(SectionHandle) and using ObReferenceObjectByHandle() we obtain SectionObject; for NT 5.1 we can take SectionObject from EPROCESS directly.
    3. From SectionObject we obtain SegmentObject.
    4. From SegmentObject we obtain ControlArea.
    5. From ControlArea we obtain FilePointer (this is FileObject pointer).
    6. Using ObQueryNameString() we obtain full process name
    All operations should be performed on PASSIVE_LEVEL and in the context of the process we obtain full path for.

    This one is proved to work.