1

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

konrad.kruczynski
  • 46,413
  • 6
  • 36
  • 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,579
  • 1
  • 23
  • 33