View previous topic :: View next topic |
Author |
Message |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Thu Jan 28, 2010 6:20 pm Post subject: Noob Question, Write Memory etc. |
|
|
Hi, i found an adress in cheatengine.
Now i want to code a trainer.
So i need this in the theory:
- Find program
- let the user enter a value
- write value to the adress
The problem is, i only find tutorials that do not help me.
For example this:
Quote: | BYTE Bytestopatch[3] = { 0x90, 0x90, 0x90}; |
I dont have 3 arrays, i have 6 and i dont now what to enter after that. BECAUSE i do NOT want to nop this and i only find tutorials how to nop.
Oh my english is bad as hell, i would be happy if someone can give me a tutorial or a sourecode that is very easy to understand.
I not want to learn the hole c++ language. I know you guys hate me for that, but i just want to change window titel + adress.
Hm difficult to explain, but maybe you can help me.
The adress is: 009CA46C
Type: Float
Value: xxxx
For you guys its very easy to do, cause you know what you are doing ^^
You can show me or explain me how to, but please no "here is a tutorial for the whole c++ language". This doesnt help me. |
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Thu Jan 28, 2010 7:06 pm Post subject: |
|
|
Code: | - Find program
- let the user enter a value
- write value to the adress
|
If you want the user to pick from a list of windows in a listbox, use EnumWindows() and obtain the window titles and place them in the listbox. Then get the hwnd, pid, and handle with that window title the user picked.
Use WriteProcessMemory() to edit the address to the value the user specified.
Pretty simple. |
|
Back to top |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Thu Jan 28, 2010 7:35 pm Post subject: |
|
|
Not a listbox, i want to have a console.
Now i have something done, but the value it should change... there is a error in the code or something like that.
Code: | int v1 = 5000;
DWORD new_v1 = sizeof(v1);
if(WriteProcessMemory(hProcess, (LPVOID)0x009CA46C, &v1, new_v1, NULL)) |
int v1 is the value i want to have.
Also i add some "cout" but they wont appear. The console window just close and the value is f*cked up in the game.
What is the error?
//Edit: hm i think is better if you can see the full code to help me.
Code: | #include <windows.h>
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
HWND cheat = FindWindow(0, "Warcraft III");
if(cheat == 0)
{
cout <<" Game not running!\n";
}
else
{
DWORD ID;
GetWindowThreadProcessId(cheat, &ID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, ID);
if(!hProcess)
{
cout <<" Game not running!\n";
}
else
{
int v1 = 5000;
DWORD new_v1 = sizeof(v1);
if(WriteProcessMemory(hProcess, (LPVOID)0x009CA46C, &v1, new_v1, NULL))
{
cout <<" Hack successful injected!\n";
}
}
}
}
|
|
|
Back to top |
|
 |
rooski Master Cheater
Reputation: 0
Joined: 31 Oct 2007 Posts: 340 Location: Siberia
|
Posted: Thu Jan 28, 2010 10:38 pm Post subject: |
|
|
put a return 0 at the end of you program.
dont see anything wrong , but im on my phone so half of code isnt showing
and is the gold value in WC3 4 BYTE? thought it was double.
also to keep the console window open add
system ("pause")
right before the last return 0 |
|
Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Thu Jan 28, 2010 11:53 pm Post subject: |
|
|
int v1[] = {5000}; |
|
Back to top |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Fri Jan 29, 2010 7:30 am Post subject: |
|
|
It doesnt work. This hack is for the camera distance.
But the changed value is in CE correct, but in this code here is too high oO |
|
Back to top |
|
 |
iPromise Grandmaster Cheater
Reputation: -1
Joined: 27 Jun 2009 Posts: 529 Location: Canada
|
Posted: Sat Jan 30, 2010 10:12 am Post subject: |
|
|
Then if your coding it in a console, let the user type the window name of the target window, so you can just use findwindow() to get the hWnd of what the user inputted. OR, the user can enter the Process name of the target, and you can use createtoolhelp32snapshot() to get the pid of the target, from there you can just get its handle and then start writing. |
|
Back to top |
|
 |
rooski Master Cheater
Reputation: 0
Joined: 31 Oct 2007 Posts: 340 Location: Siberia
|
Posted: Sat Jan 30, 2010 1:32 pm Post subject: |
|
|
do this
L"Warcraft III"
instead of just
"Waracraft II" |
|
Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Sat Jan 30, 2010 3:25 pm Post subject: |
|
|
rooski wrote: | do this
L"Warcraft III"
instead of just
"Waracraft II" |
Why? .....
FindWindow is working, his WriteProcessMemory ain't. |
|
Back to top |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Sat Feb 06, 2010 1:00 pm Post subject: |
|
|
Guys, the problem is:
I change the value to 5000, its the camera distance. But ingame its too high, that means i get a black screen ingame. If i change the camera distance by scrolling the wheele, it goes back to normal.
The problem isnt: finding the window, or the offset.
The Problem is the value.
With CE i can change the value to 5000 with no problem, but in my c++ code there must be something wrong.
The code is this here:
Code: | int v1[] = {4000};
DWORD new_v1 = sizeof(v1);
if(WriteProcessMemory(hProcess, (LPVOID)0x009D5518, &v1, new_v1, NULL)) |
Any ideas? |
|
Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25796 Location: The netherlands
|
Posted: Sat Feb 06, 2010 3:56 pm Post subject: |
|
|
try
besides that, not sure _________________
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 |
|
 |
Hatschi Master Cheater
Reputation: 2
Joined: 28 Jan 2010 Posts: 327
|
Posted: Sat Feb 06, 2010 4:31 pm Post subject: |
|
|
Dark Byte wrote: | try
besides that, not sure |
Thanks, that works! |
|
Back to top |
|
 |
|