Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <string>
- using namespace std;
- // FindWindow();
- // GetWindowsThreadProcessId();
- // OpenProcess();
- // WriteProcessMemory();
- // CloseHandle();
- int main()
- {
- HWND hWnd = FindWindowA(0, "Alliance of Valiant Arms");
- if(hWnd == 0)
- {
- cerr << "Unable to find the window" << endl << endl;
- }
- else{
- clog << "Found Window" << endl << endl;;
- DWORD PId;
- GetWindowThreadProcessId(hWnd, &PId);
- HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, PId);
- if (!hProcess){
- cerr << "Unable to Open Process" << endl << endl;;
- }
- else{
- clog << "Opened Process" << endl << endl;;
- string newvalue;
- cout << "Enter the new nickname: " << endl;
- cin >> newvalue;
- cout << endl << endl;
- int isSuccessful = WriteProcessMemory(hProcess, (LPVOID)0x00000, &newvalue , sizeof(newvalue), NULL);
- if(isSuccessful > 0){
- clog << "Process Memory Written" << endl << endl;;
- }else{
- cerr << "Cannot write process memory." << endl << endl;;
- }
- }
- }
- system("PAUSE");
- system("CLS");
- return main();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement