得到全路径

lkd> dt _EPROCESS 85f6a020
nt!_EPROCESS
   +0x000 Pcb              : _KPROCESS
   +0x06c ProcessLock      : _EX_PUSH_LOCK
   +0x070 CreateTime       : _LARGE_INTEGER 0x1c84d06`aa4a24ec
   +0x078 ExitTime         : _LARGE_INTEGER 0x0
   +0x080 RundownProtect   : _EX_RUNDOWN_REF
   +0x084 UniqueProcessId  : 0x000000f8 
   +0x088 ActiveProcessLinks : _LIST_ENTRY [ 0x8055a258 - 0x85f12430 ]
   +0x090 QuotaUsage       : [3] 0xe38
   +0x09c QuotaPeak        : [3] 0xe38
   +0x0a8 CommitCharge     : 0x675
   +0x0ac PeakVirtualSize  : 0x3240000
   +0x0b0 VirtualSize      : 0x3219000
   +0x0b4 SessionProcessLinks : _LIST_ENTRY [ 0xf7a86014 - 0x85f1245c ]
   +0x0bc DebugPort        : (null) 
   +0x0c0 ExceptionPort    : 0xe1865368 
   +0x0c4 ObjectTable      : 0xe1c2cb60 _HANDLE_TABLE
   +0x0c8 Token            : _EX_FAST_REF
   +0x0cc WorkingSetLock   : _FAST_MUTEX
   +0x0ec WorkingSetPage   : 0x2eabc
   +0x0f0 AddressCreationLock : _FAST_MUTEX
   +0x110 HyperSpaceLock   : 0
   +0x114 ForkInProgress   : (null) 
   +0x118 HardwareTrigger  : 0
   +0x11c VadRoot          : 0x85ec5b60 
   +0x120 VadHint          : 0x85ede6f8 
   +0x124 CloneRoot        : (null) 
   +0x128 NumberOfPrivatePages : 0x475
   +0x12c NumberOfLockedPages : 1
   +0x130 Win32Process     : 0xe2158a50 
   +0x134 Job              : (null) 
   +0x138 SectionObject    : 0xe1b528f8 
   +0x13c SectionBaseAddress : 0x01000000 
   +0x140 QuotaBlock       : 0x860d3cb8 _EPROCESS_QUOTA_BLOCK
   +0x144 WorkingSetWatch  : (null) 
   +0x148 Win32WindowStation : 0x0000002c 
   +0x14c InheritedFromUniqueProcessId : 0x00000630 
   +0x150 LdtInformation   : (null) 
   +0x154 VadFreeHint      : (null) 
   +0x158 VdmObjects       : (null) 
   +0x15c DeviceMap        : 0xe18c80b0 
   +0x160 PhysicalVadList  : _LIST_ENTRY [ 0x85f6a180 - 0x85f6a180 ]
   +0x168 PageDirectoryPte : _HARDWARE_PTE
   +0x168 Filler           : 0
   +0x170 Session          : 0xf7a86000 
   +0x174 ImageFileName    : [16]  "windbg.exe"
   +0x184 JobLinks         : _LIST_ENTRY [ 0x0 - 0x0 ]
   +0x18c LockedPagesList  : (null) 
   +0x190 ThreadListHead   : _LIST_ENTRY [ 0x85ecdebc - 0x85ebafd4 ]
   +0x198 SecurityPort     : (null) 
   +0x19c PaeTop           : 0xf7c5b320 
   +0x1a0 ActiveThreads    : 5
   +0x1a4 GrantedAccess    : 0x1f0fff
   +0x1a8 DefaultHardErrorProcessing : 0
   +0x1ac LastThreadExitStatus : 0
   +0x1b0 Peb              : 0x7ffde000 _PEB                   //Peb偏移 0x1b0
   +0x1b4 PrefetchTrace    : _EX_FAST_REF
   +0x1b8 ReadOperationCount : _LARGE_INTEGER 0xf1
   +0x1c0 WriteOperationCount : _LARGE_INTEGER 0x2
   +0x1c8 OtherOperationCount : _LARGE_INTEGER 0x222
   +0x1d0 ReadTransferCount : _LARGE_INTEGER 0x12f828
   +0x1d8 WriteTransferCount : _LARGE_INTEGER 0x90
   +0x1e0 OtherTransferCount : _LARGE_INTEGER 0x1654
   +0x1e8 CommitChargeLimit : 0
   +0x1ec CommitChargePeak : 0x696
   +0x1f0 AweInfo          : (null) 
   +0x1f4 SeAuditProcessCreationInfo : _SE_AUDIT_PROCESS_CREATION_INFO
   +0x1f8 Vm               : _MMSUPPORT
   +0x238 LastFaultCount   : 0
   +0x23c ModifiedPageCount : 0x2c0
   +0x240 NumberOfVads     : 0x58
   +0x244 JobStatus        : 0
   +0x248 Flags            : 0xd0800
   +0x248 CreateReported   : 0y0
   +0x248 NoDebugInherit   : 0y0
   +0x248 ProcessExiting   : 0y0
   +0x248 ProcessDelete    : 0y0
   +0x248 Wow64SplitPages  : 0y0
   +0x248 VmDeleted        : 0y0
   +0x248 OutswapEnabled   : 0y0
   +0x248 Outswapped       : 0y0
   +0x248 ForkFailed       : 0y0
   +0x248 HasPhysicalVad   : 0y0
   +0x248 AddressSpaceInitialized : 0y10
   +0x248 SetTimerResolution : 0y0
   +0x248 BreakOnTermination : 0y0
   +0x248 SessionCreationUnderway : 0y0
   +0x248 WriteWatch       : 0y0
   +0x248 ProcessInSession : 0y1
   +0x248 OverrideAddressSpace : 0y0
   +0x248 HasAddressSpace  : 0y1
   +0x248 LaunchPrefetched : 0y1
   +0x248 InjectInpageErrors : 0y0
   +0x248 VmTopDown        : 0y0
   +0x248 Unused3          : 0y0
   +0x248 Unused4          : 0y0
   +0x248 VdmAllowed       : 0y0
   +0x248 Unused           : 0y00000 (0)
   +0x248 Unused1          : 0y0
   +0x248 Unused2          : 0y0
   +0x24c ExitStatus       : 259
   +0x250 NextPageColor    : 0x6cf5
   +0x252 SubSystemMinorVersion : 0 ''
   +0x253 SubSystemMajorVersion : 0x4 ''
   +0x252 SubSystemVersion : 0x400
   +0x254 PriorityClass    : 0x2 ''
   +0x255 WorkingSetAcquiredUnsafe : 0 ''
   +0x258 Cookie           : 0xab4d4e95

lkd> dt _PEB 0x7ffde000
nt!_PEB
   +0x000 InheritedAddressSpace : 0 ''
   +0x001 ReadImageFileExecOptions : 0 ''
   +0x002 BeingDebugged    : 0 ''
   +0x003 SpareBool        : 0 ''
   +0x004 Mutant           : 0xffffffff 
   +0x008 ImageBaseAddress : 0x01000000 
   +0x00c Ldr              : 0x001a1e90 _PEB_LDR_DATA
   +0x010 ProcessParameters : 0x00020000 _RTL_USER_PROCESS_PARAMETERS       //ProcessParameters偏移 0x010
   +0x014 SubSystemData    : (null) 
   +0x018 ProcessHeap      : 0x000a0000 
   +0x01c FastPebLock      : 0x7c99e4c0 _RTL_CRITICAL_SECTION
   +0x020 FastPebLockRoutine : 0x7c921005 
   +0x024 FastPebUnlockRoutine : 0x7c9210ed 
   +0x028 EnvironmentUpdateCount : 1
   +0x02c KernelCallbackTable : 0x77d12970 
   +0x030 SystemReserved   : [1] 0
   +0x034 AtlThunkSListPtr32 : 0
   +0x038 FreeList         : (null) 
   +0x03c TlsExpansionCounter : 0
   +0x040 TlsBitmap        : 0x7c99e480 
   +0x044 TlsBitmapBits    : [2] 0x7fff
   +0x04c ReadOnlySharedMemoryBase : 0x7f6f0000 
   +0x050 ReadOnlySharedMemoryHeap : 0x7f6f0000 
   +0x054 ReadOnlyStaticServerData : 0x7f6f0688  -> (null) 
   +0x058 AnsiCodePageData : 0x7ffa0000 
   +0x05c OemCodePageData  : 0x7ffa0000 
   +0x060 UnicodeCaseTableData : 0x7ffd1000 
   +0x064 NumberOfProcessors : 1
   +0x068 NtGlobalFlag     : 0
   +0x070 CriticalSectionTimeout : _LARGE_INTEGER 0xffffe86d`079b8000
   +0x078 HeapSegmentReserve : 0x100000
   +0x07c HeapSegmentCommit : 0x2000
   +0x080 HeapDeCommitTotalFreeThreshold : 0x10000
   +0x084 HeapDeCommitFreeBlockThreshold : 0x1000
   +0x088 NumberOfHeaps    : 8
   +0x08c MaximumNumberOfHeaps : 0x10
   +0x090 ProcessHeaps     : 0x7c99de80  -> 0x000a0000 
   +0x094 GdiSharedHandleTable : 0x003a0000 
   +0x098 ProcessStarterHelper : (null) 
   +0x09c GdiDCAttributeList : 0x14
   +0x0a0 LoaderLock       : 0x7c99c0d8 
   +0x0a4 OSMajorVersion   : 5
   +0x0a8 OSMinorVersion   : 1
   +0x0ac OSBuildNumber    : 0xa28
   +0x0ae OSCSDVersion     : 0x200
   +0x0b0 OSPlatformId     : 2
   +0x0b4 ImageSubsystem   : 2
   +0x0b8 ImageSubsystemMajorVersion : 4
   +0x0bc ImageSubsystemMinorVersion : 0
   +0x0c0 ImageProcessAffinityMask : 0
   +0x0c4 GdiHandleBuffer  : [34] 0
   +0x14c PostProcessInitRoutine : (null) 
   +0x150 TlsExpansionBitmap : 0x7c99e478 
   +0x154 TlsExpansionBitmapBits : [32] 0
   +0x1d4 SessionId        : 0
   +0x1d8 AppCompatFlags   : _ULARGE_INTEGER 0x0
   +0x1e0 AppCompatFlagsUser : _ULARGE_INTEGER 0x0
   +0x1e8 pShimData        : (null) 
   +0x1ec AppCompatInfo    : (null) 
   +0x1f0 CSDVersion       : _UNICODE_STRING "Service Pack 2"
   +0x1f8 ActivationContextData : 0x00090000 
   +0x1fc ProcessAssemblyStorageMap : 0x000a3498 
   +0x200 SystemDefaultActivationContextData : 0x00080000 
   +0x204 SystemAssemblyStorageMap : (null) 
   +0x208 MinimumStackCommit : 0


lkd> dt _RTL_USER_PROCESS_PARAMETERS 0x00020000
nt!_RTL_USER_PROCESS_PARAMETERS
   +0x000 MaximumLength    : 0x1000
   +0x004 Length           : 0x96c
   +0x008 Flags            : 0x2001
   +0x00c DebugFlags       : 0
   +0x010 ConsoleHandle    : (null) 
   +0x014 ConsoleFlags     : 0
   +0x018 StandardInput    : (null) 
   +0x01c StandardOutput   : 0x00010001 
   +0x020 StandardError    : (null) 
   +0x024 CurrentDirectory : _CURDIR
   +0x030 DllPath          : _UNICODE_STRING "C:/Program Files/Debugging Tools for Windows;C:/WINDOWS/system32;C:/WINDOWS/system;C:/WINDOWS;.;C:/WINDOWS/system32;C:/WINDOWS;C:/WINDOWS/System32/Wbem;C:/Program Files/Microsoft SQL Server/90/Tools/binn/;F:/Program Files/Microsoft Visual Studio/Common/Tools/WinNT;F:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin;F:/Program Files/Microsoft Visual Studio/Common/Tools;F:/Program Files/Microsoft Visual Studio/VC98/bin"
   +0x038 ImagePathName    : _UNICODE_STRING "C:/Program Files/Debugging Tools for Windows/windbg.exe"                   //进程全路径在这
   +0x040 CommandLine      : _UNICODE_STRING ""C:/Program Files/Debugging Tools for Windows/windbg.exe" "
   +0x048 Environment      : 0x00010000 
   +0x04c StartingX        : 0
   +0x050 StartingY        : 0
   +0x054 CountX           : 0
   +0x058 CountY           : 0
   +0x05c CountCharsX      : 0
   +0x060 CountCharsY      : 0
   +0x064 FillAttribute    : 0
   +0x068 WindowFlags      : 0xc01
   +0x06c ShowWindowFlags  : 1
   +0x070 WindowTitle      : _UNICODE_STRING "C:/Documents and Settings/Administrator/桌面/WinDbg.lnk"
   +0x078 DesktopInfo      : _UNICODE_STRING "WinSta0/Default"
   +0x080 ShellInfo        : _UNICODE_STRING ""
   +0x088 RuntimeData      : _UNICODE_STRING ""
   +0x090 CurrentDirectores : [32] _RTL_DRIVE_LETTER_CURDIR



VOID GetProcessFullName()
{
    ULONG NameAddress = ( ULONG )PsGetCurrentProcess();

    NameAddress += 0x1b0; //PEB的地址
        NameAddress = *(ULONG*)NameAddress;
    NameAddress += 0x010; //PEB中ProcessParameters的地址
        NameAddress = *(ULONG*)NameAddress;
    NameAddress += 0x03c; //ProcessParameters中ImagePathName的地址
        NameAddress = *(ULONG*)NameAddress;

    DbgPrint("FullName %ws /n",(PWSTR)NameAddress );
                
}

NameAddress += 0x1b0;取得PEB变量在EPROCESS中的偏移
NameAddress = *(ULONG*)NameAddress;取得PEB变量所指向的地址
下同

适用于WinXP

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值