vxug-WinAPI-Tricks/GetTEB.c

21 lines
279 B
C
Raw Normal View History

2021-02-21 01:23:18 +00:00
#include <windows.h>
#include "TEB.h"
2021-02-21 02:35:44 +00:00
PTEB GetTeb(VOID)
2021-02-21 01:23:18 +00:00
{
#if defined(_WIN64)
2021-02-21 02:35:44 +00:00
return (PTEB)__readgsqword(0x30);
2021-02-21 01:23:18 +00:00
#elif define(_WIN32)
2021-02-21 02:35:44 +00:00
return (PTEB)__readfsdword(0x18);
2021-02-21 01:23:18 +00:00
#endif
2021-02-21 02:35:44 +00:00
}
INT main(VOID)
{
PTEB Teb;
Teb = (PTEB)GetTeb();
2021-02-21 01:23:18 +00:00
return ERROR_SUCCESS;
2021-02-21 02:35:44 +00:00
}