Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h>
- #pragma warning(disable:4996)
- void ProtectedExit()
- {
- MessageBoxA(NULL, "Protected Exit Was Called!", NULL, NULL);
- if (*(BYTE*)&exit == 0xC3)
- {
- ExitProcess(0);
- ExitThread(0);
- }
- else
- {
- ExitProcess(0);
- exit(0);
- }
- }
- BOOL getAuthKey(DWORD* Varib)
- {
- DWORD n = 0;
- if (GetVolumeInformationA(NULL, NULL, NULL, &n, NULL, NULL, NULL, NULL))
- {
- *Varib = n;
- return false;
- }
- else
- {
- MessageBoxA(NULL, "Protected Exit Was Called! IN GetAuth", NULL, NULL);
- ProtectedExit();
- return true;
- }
- }
- void Protect(void* Function, BYTE orgOP)
- {
- /* First Check */
- DWORD old;
- VirtualProtect((void*)Function, 1, PAGE_READONLY, &old);
- if (old != PAGE_READONLY)
- {
- MessageBoxA(NULL, "Error At PagePro", NULL, NULL);
- ProtectedExit();
- }
- else
- return;
- /* Second Check*/
- if (*(BYTE*)Function != orgOP)
- {
- MessageBoxA(NULL, "Error At Cop check", NULL, NULL);
- ProtectedExit();
- }
- else
- return;
- }
- int main()
- {
- WriteProcessMemory(GetCurrentProcess(), (void*)&FreeConsole, "\xC3", 1, nullptr);
- AllocConsole();
- freopen("CONIN$", "r", stdin);
- freopen("CONOUT$", "w", stdout);
- std::cout << "If you get a message saying \"U beat it\" Then You Cracked This! Else You Get \"FAIL!\"\n";
- DWORD Auth = 0;
- DWORD old;
- bool Start_End = false;
- bool status = getAuthKey(&Auth);
- BYTE cAuth(*(BYTE*)&Auth), cStartEnd(*(BYTE*)&Start_End), cStatus(*(BYTE*)&status);
- if (status == true)
- {
- MessageBoxA(NULL, "Error At Cop check", NULL, NULL);
- ProtectedExit();
- }
- for(int x = 0; x < 10; x++)
- {
- Protect(&Auth, cAuth);
- Protect(&Start_End, cStartEnd);
- Protect(&status, cStatus);
- std::cout << "Works\n";
- }
- /* Getting Authentication is ok*/
- /* Connection */
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement