0
Take a look at the code of the hacker process that’s on github : https://github.com/processhacker/processhacker
There’s the file called thread. c with quite complex content as it interacts with the Windows Kernel in order to do exactly what you want, get the Thread stack. But the code is well covered, so I hope it helps you. Remembering that you may need to read other project files to better understand how the program works.
Yes, I downloaded the complete source of Process Hacker to understand how it gets the Stack thread, but the code was so big and complete that I gave up, but I’ll try harder, looking at this thread. c
– Ph4nton