Windbg .thread 命令没用?

逆向工程 风袋 核心
2021-07-01 09:04:34

“.thread”命令用于在 Windows 内核调试中更改线程上下文。 MSDN

但我遇到了以下情况:

  1. 连续执行以下两条命令。第一个命令将线程上下文设置为ffffc08213599040,但它实际上仍然是ffffc08229313080。
0: kd> .thread ffffc082`13599040          
Implicit thread is now ffffc082`13599040
0: kd> .thread
Implicit thread is now ffffc082`29313080   

2.连续执行以下两条命令。我想更改线程 ffffc08213599040 的 rip,但是命令“r rip=xxx”失败。

0: kd> .thread ffffc082`13599040
Implicit thread is now ffffc082`13599040
0: kd> r rip = fffff803`3de6341d
Last set context:
                               ^ Bad register error in 'r rip = fffff803`3de6341d'
1个回答

它按预期工作和记录
运行一个普通的 .thread 将上下文重置为 CurrentThread 记录

Quote From Documentation  

Thread 
The address of the thread. If this is omitted or zero,   
the thread context is reset to the current thread.

您不能将@rip 设置为任意值