1

Is it possible (and how) to access Thread Information Block of a thread of some another process?

konrad.kruczynski
  • 44,990
  • 6
  • 37
  • 47

1 Answers1

3

It is possible.

The first step is to get the adress of the Thread Information Block by using the NtQueryInformationThread function with ThreadInformationClass set to ThreadBasicInformation. The THREAD_BASIC_INFORMATION structure contains a pointer to the TEB of the thread. Then you can use ReadProcessMemory and WriteProcessMemory in order to read or modify the content of the TEB.

Norbert Willhelm
  • 2,513
  • 1
  • 20
  • 28