Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- // FindWindow();
- // GetWindowThreadProcessId();
- // OpenProcess();
- // WriteProcessMemory();
- // CloseHandle();
- using namespace std;
- int main()
- {
- HANDLE hToken;
- OpenProcessToken(GetCurrentProcess(),TOKEN_ALL_ACCESS,&hToken);
- TOKEN_PRIVILEGES TP;
- LookupPrivilegeValue(0,"SeDebugPrivilege",&TP.Privileges[0].Luid);
- TP.PrivilegeCount=1;
- TP.Privileges[0].Attributes=SE_PRIVILEGE_ENABLED;
- AdjustTokenPrivileges(hToken,0,&TP,sizeof(TOKEN_PRIVILEGES),0,0);
- {
- int newValue = 500;
- HWND hWnd = FindWindow(0, "MicroVolts");
- if (hWnd == 0)
- {
- cerr << "Cannot find window." << endl;
- }
- else
- {
- DWORD pId;
- GetWindowThreadProcessId(hWnd, &pId);
- HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
- void* pRPM=(void*)ReadProcessMemory;
- WriteProcessMemory(hProc,pRPM,"\xEB\xFE",2,0);
- if (!hProc)
- {
- cerr << "Cannot open process." << endl;
- }
- else
- {
- int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x102BEC8, &newValue, (DWORD)sizeof(newValue), NULL);
- if (isSuccessful > 0)
- {
- clog << "SpeedHack Enabled." << endl;
- }
- else
- {
- cerr << "Cannot write process memory." << endl;
- }
- CloseHandle(hProc);
- }
- }
- system("PAUSE");
- return 0;
- {
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement