[Autogenerated] there are quite a few APIs available in
using road to working with threads.
I'd like to briefly describe some of them first.
We want to create threads and for that purpose we have a few functions.
The simplest one which is the most common to use is called create thread.
And then if you want to create threads in different processes,
we can use the create remote threat or the extended version of that function.
So this is for example used by the buggers when they want to
forcefully break into a target process,
they inject the thread into that process using create remote
threat and then issue a breakpoint within and gain control and
then in order to manipulate threats.
Once they exist, we get a proper handle to the threats.
We can do certain things such as change or read their priority.
We've seen an example of that in the previous module,
we can suspend the thread um and then resume it later on this again sometimes
is useful but in most cases it's better to have the thread weight on certain
objects in well known locations rather than try to suspend or resume it in in
some random time of their execution.
And there's the simple sleep function which allows the threat to
suspend itself for a specified amount of time.
We can also manipulate or read the affinity mask.
That's the affinity we discussed in the previous module,
we can get lots of information related to threads.
Here are a few examples,
one of them is get exit code thread which is
available once a thread is terminated, we can get the exit code of the thread.
Every thread has an exit code very similar to processes that
return a value from their main function.
Get threat times is a way to get timing information about
the threat when the thread was created, when the thread was terminated.
If it was terminated and the amount of time it spent
running code in user mode and kernel mode,
then there's the option to set or get a threat description.
This is just a textual description that is used by the buggers,
so it's easier to identify threats of our choosing.
It's not a name that we can look up.
A thread by threats, have ideas and that's the only way to look up a threat.
If we need it.
Let's look at some of these API S in a few examples.