Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- extern int ShowForm();
- bool isFormLoaded = false;
- void eFormLoad() {
- memmove(NULL, NULL, sizeof(NULL));
- DWORD Fuck;
- VirtualProtect(NULL, sizeof(NULL), Fuck, &Fuck);
- return;
- }
- void fMClose() {
- ExitProcess(0);
- }
- int hExit() {
- return 0;
- }
- void __declspec(naked) nExit() {
- hExit();
- }
- void _cdecl pCode() {
- if(!isFormLoaded) {
- isFormLoaded = true;
- //FreeLibrary(GetModuleHandleA("BugTrap.dll"));
- ShowForm();
- return;
- }
- return;
- }
- void WriteJMP(byte* location,byte* newFunction){
- DWORD dwOldProtection;
- VirtualProtect(location,5, PAGE_EXECUTE_READWRITE,&dwOldProtection);
- location[0]=0xE9;
- *((int*)(location+1))=(int)(newFunction - location)-5;
- VirtualProtect(location,5, dwOldProtection,&dwOldProtection);
- }
- void WINAPI fHook(LPCSTR nMol, LPCSTR fName, byte* nFunc) {
- WriteJMP((byte*) GetProcAddress(GetModuleHandleA(nMol), fName), nFunc);
- }
- void DoStuff() {
- /*fHook("kernel32.dll", "ExitProcess", (byte*) nExit);
- fHook("kernel32.dll", "TerminateProcess", (byte*) nExit);*/
- // fHook("kernel32.dll", "ExitThread", (byte*) nExit);
- //fHook("kernel32.dll", "GetTickCount", (byte*) pCode);
- /* WriteJMP((byte*)GetProcAddress(GetModuleHandleA("Winmm.dll"), "timeGetTime"), (byte*) UndecCode);
- WriteJMP((byte*)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetPQueryPerformanceCounter"), (byte*) UndecCode);
- */
- }
- BOOL WINAPI DllMain ( HMODULE hModule, DWORD dwReason, LPVOID lpvReserved )
- {
- if ( dwReason == DLL_PROCESS_ATTACH) {
- DisableThreadLibraryCalls(hModule);
- DoStuff();
- }
- return TRUE;
- }
Add Comment
Please, Sign In to add comment