View previous topic :: View next topic |
Author |
Message |
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Sat Dec 17, 2016 11:54 am Post subject: (C++) What's wrong? |
|
|
I can not connect to the process. Because?
Code: |
#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
using namespace std;
int newscore;
int main()
{
HWND windowProgram = FindWindow(0, L"Step 2");
cout<<"Coloque o novo escore: ";
cin>>::newscore;
if(windowProgram==0)
cerr<<"abra o programa"<<endl;
else{
DWORD processID;
GetWindowThreadProcessId(windowProgram, &processID);
HANDLE handleProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, processID);
if(!handleProcess)
cerr<<"Nao foi possivel abrir o processo"<<endl;
else{
int memoryHack = WriteProcessMemory(handleProcess, (LPVOID)0x011B8C80, &newscore, (DWORD)sizeof(newscore), NULL);
if(memoryHack > 0)
clog<<"FOi escrito"<<endl;
else
cerr<<"Não foi escrito"<<endl;
CloseHandle(handleProcess);
}
}
system("PAUSE");
return 0;
} |
_________________
... |
|
Back to top |
|
|
Dark Byte Site Admin Reputation: 458
Joined: 09 May 2003 Posts: 25296 Location: The netherlands
|
Posted: Sat Dec 17, 2016 2:56 pm Post subject: |
|
|
Are you running it as administrator?
and you may first have to obtain SeDebugPrivilege
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
Back to top |
|
|
Kavvman Master Cheater Reputation: 2
Joined: 17 Apr 2004 Posts: 316
|
Posted: Sat Dec 17, 2016 6:43 pm Post subject: |
|
|
Where does it error out(which function)?
_________________
... |
|
Back to top |
|
|
Filipe_Br Master Cheater Reputation: 3
Joined: 07 Jan 2016 Posts: 272 Location: My house
|
Posted: Sun Dec 18, 2016 5:44 am Post subject: |
|
|
Incredibly, I did manage to sort it out. Replaces where "FALSE" is written with "0".
Notice the beginning of the main.
Code: |
HWND windowProgram = FindWindow(0, L"Step 2");
|
Without this "L" does not work, I wanted to store the window name in a variable. But I can not put the name of the variable and this "L" together.
_________________
... |
|
Back to top |
|
|
ulysse31 Master Cheater Reputation: 2
Joined: 19 Mar 2015 Posts: 324 Location: Paris
|
Posted: Sun Dec 18, 2016 6:36 am Post subject: |
|
|
on your project properties change unicode to multibyte character and you should then be able to take the L off.
|
|
Back to top |
|
|
|