Update GetTEB.c

This commit is contained in:
vxunderground 2021-02-20 20:35:44 -06:00 committed by GitHub
parent ea8321bced
commit 6dfaeb4475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}
}