Update GetTEB.c
This commit is contained in:
parent
ea8321bced
commit
6dfaeb4475
18
GetTEB.c
18
GetTEB.c
|
@ -1,14 +1,20 @@
|
|||
#include <windows.h>
|
||||
#include "TEB.h"
|
||||
|
||||
INT main(VOID)
|
||||
PTEB GetTeb(VOID)
|
||||
{
|
||||
#if defined(_WIN64)
|
||||
//64bit
|
||||
PTEB Teb = (PTEB)__readgsqword(0x30);
|
||||
return (PTEB)__readgsqword(0x30);
|
||||
#elif define(_WIN32)
|
||||
//32bit
|
||||
PTEB Teb = (PTEB)__readfsdword(0x18);
|
||||
return (PTEB)__readfsdword(0x18);
|
||||
#endif
|
||||
}
|
||||
|
||||
INT main(VOID)
|
||||
{
|
||||
PTEB Teb;
|
||||
|
||||
Teb = (PTEB)GetTeb();
|
||||
|
||||
return ERROR_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue