Don't crash if ran on unsupported windows

This commit is contained in:
barrybingo
2019-03-22 22:38:59 +00:00
parent d4c8fd4004
commit c0bc9e446f
3 changed files with 14 additions and 8 deletions
+7 -5
View File
@@ -31,7 +31,7 @@ public:
static uint64_t objecttable;
static uint64_t vadroot;
static void init()
static bool init()
{
windows_version win_ver = get_windows_version();
@@ -40,16 +40,18 @@ public:
{
case WINDOWS7:
init_win7();
break;
return true;
case WINDOWS8:
init_win8();
break;
return true;
case WINDOWS81:
init_win81();
break;
return true;
case WINDOWS10:
init_win10();
break;
return true;
default:
return false;
}
}
+3 -1
View File
@@ -6,9 +6,11 @@ using namespace native::structs;
bool elevate_ppl()
{
if (!kernel_offsets::init()) return false;
if (!init_exploit()) return false;
kernel_offsets::init();
execute_in_kernel([](MmGetSystemRoutineAddress_t _MmGetSystemRoutineAddress)
{
+4 -2
View File
@@ -3,7 +3,9 @@
int main()
{
elevate_ppl();
MessageBoxA(NULL, "Use ProcessHacker to check PPL status", "Paused", NULL);
if (elevate_ppl())
MessageBoxA(NULL, "Use ProcessHacker to check PPL status", "Paused", NULL);
else
MessageBoxA(NULL, "Something went wrong - probably unsuported windows version", "Error", MB_ICONERROR);
return 0;
}