Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <Windows.h> // For Sleep & data types
- #include "ProcessModder.h"
- using namespace std;
- const char windowName[] = "Brood War";
- void ZeroScTimer(ProcessModder &process);
- int main()
- {
- ProcessModder process;
- while ( true )
- {
- cout << "Waiting for process..." << endl;
- while ( !process.isOpen() ) // While process isn't open
- // Try to open the process
- {
- if ( process.openWithWindowName(windowName) )
- cout << "Process opened successfully." << endl;
- else
- Sleep(500);
- // Sleep a fair amount of time upon failure to prevent notable CPU usage.
- }
- while ( process.isOpen() ) // While process is open
- // Do w/e you want to it
- {
- ZeroScTimer(process);
- }
- cout << "Process closed." << endl;
- Sleep(1000); // Aesthetics
- }
- return 0;
- }
- void ZeroScTimer(ProcessModder &process)
- {
- UINT countdown = 0;
- if ( process.readMem<UINT>(0x0066FBFC, countdown) && countdown > 1 ) // Check if start game countdown timer > 1
- {
- if ( process.writeMem<UINT>(0x0066FBFC, 1) ) // Set it to 1 if it's above that
- cout << "Timer zero'd successfully." << endl;
- else
- cout << "Timer could not be zero'd." << endl;
- }
- Sleep(1); // Sleep a little to prevent notable CPU usage
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement