windbg学习----.process

.process 命令指定要用作进程上下文的进程(Set Process Context)

.process显示当前进程的EPROCESS,这里显示当前进程为test.exe
kd> .process
Implicit process is now 821f5da0
kd> ? @$proc
Evaluate expression: -2111873632 = 821f5da0
kd> !process 821f5da0 0
PROCESS 821f5da0  SessionId: 0  Cid: 06e8    Peb: 7ffde000  ParentCid: 0620
    DirBase: 02b40380  ObjectTable: e1112818  HandleCount:  20.
    Image: test.exe

可以通过/r /p来切换进程上下文,意味着接下的命令都使用新的进程上下文,比如内存,但这没有改变目标系统,只是影响了windbg的输出
kd> .process /r /p 81e74b58  
Implicit process is now 81e74b58
.cache forcedecodeuser done
Loading User Symbols
PEB is paged out (Peb.Ldr = 7ffdc00c).  Type ".hh dbgerr001" for details
kd> db 1000000
01000000  4d 5a 90 00 03 00 00 00-04 00 00 00 ff ff 00 00  MZ..............
01000010  b8 00 00 00 00 00 00 00-40 00 00 00 00 00 00 00  ........@.......
01000020  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00  ................
01000030  00 00 00 00 00 00 00 00-00 00 00 00 e0 00 00 00  ................
01000040  0e 1f ba 0e 00 b4 09 cd-21 b8 01 4c cd 21 54 68  ........!..L.!Th
01000050  69 73 20 70 72 6f 67 72-61 6d 20 63 61 6e 6e 6f  is program canno
01000060  74 20 62 65 20 72 75 6e-20 69 6e 20 44 4f 53 20  t be run in DOS 
01000070  6d 6f 64 65 2e 0d 0d 0a-24 00 00 00 00 00 00 00  mode....$.......
kd> .process /r /p 821f5da0  
Implicit process is now 821f5da0
.cache forcedecodeuser done
Loading User Symbols
.........
kd> db 1000000
01000000  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000010  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000020  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000030  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000040  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000050  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000060  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
01000070  ?? ?? ?? ?? ?? ?? ?? ??-?? ?? ?? ?? ?? ?? ?? ??  ????????????????
可以用/i来切换,它会进行实际的进程切换,所以执行后先g一下,如果使用了 /i,必须使用g (Go)命令来执行目标。数秒之后,目标会再次中断到调试器中,并且指定的 Process 被激活并用作当前进程上下文。 


原文地址:https://www.cnblogs.com/hgy413/p/3693349.html