Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "framework.h"
- #include <Windows.h>
- #include <iostream>
- #include "MinHook/include/MinHook.h"
- int DumpBC(int LS, int CN, int Source, int Size)
- {
- printf("luastate - \n", LS);
- printf("Chunk Name - \n", CN);
- printf("Source - \n", Source);
- printf("Size - \n", Size);
- return 1;
- }
- int main() {
- MH_Initialize();
- DWORD nOldProtect;
- if (!VirtualProtect(FreeConsole, 1, PAGE_EXECUTE_READWRITE, &nOldProtect))
- return FALSE;
- *(BYTE*)(FreeConsole) = 0xC3;
- if (!VirtualProtect(FreeConsole, 1, nOldProtect, &nOldProtect))
- return FALSE;
- AllocConsole();
- freopen("CONOUT$", "w", stdout);
- freopen("CONIN$", "r", stdin);
- HWND ConsoleHandle = GetConsoleWindow();
- SetWindowPos(ConsoleHandle, HWND_TOPMOST, 50, 20, 0, 0, SWP_DRAWFRAME | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
- MH_CreateHook((LPVOID)0x8C81B0, (LPVOID)DumpBC, NULL);
- }
- BOOL APIENTRY DllMain(HMODULE Module, DWORD Reason, void* Reserved)
- {
- switch (Reason)
- {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(Module);
- CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)main, NULL, NULL, NULL);
- break;
- case DLL_PROCESS_DETACH:
- break;
- default: break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement