| View previous topic :: View next topic |
| Author |
Message |
Travis13 Expert Cheater
Reputation: 0
Joined: 17 Feb 2007 Posts: 199
|
Posted: Mon Aug 18, 2008 6:07 pm Post subject: How to go about making my first c++ hack |
|
|
Hey helpful people of cheatengine (that was only a bit sarcastic since some of u guys do help me) lol ANYWAYS. So I am in the process in learning c++ and I just finished clearing up functions and how they work and all that crap and i have basic knowledge of c++. So I want to go about making a little hack for msn the infinite nudge hack.
I already have the pointer to freeze and i already made a trainer in cheat engine trainer maker and i will attach it, but I want to know how to make my program made fully in c++ freeze and unfreeze a pointer with user input. I heard u can also make simple gui's by simple making a header file or source file (one of the two or both) and i dont really know how those work and how to make a gui for your program with them.
Anyways I need some direction going about making a c++ program (cmd line or not) that turns a pointer on and off from user input and that can attach to a process (msn). THanks guys and i have faiht in u that u will help me
cout << "Later!" << endl;
Travis13 _________________
Learning C++, trying, failing, never gonna give up tho  |
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Mon Aug 18, 2008 6:24 pm Post subject: |
|
|
if u made one in Cheat engine that exe won't help anyone..
u should post the source of the trainer what pointer u used etc...
anyways in C++ u just use
WriteProcessMemory here is a example to do the things CE does..
here is a example of WriteProcessMemory made for MapleStory
| Code: |
DWORD ptrAddress = 0x5C6600;
BYTE newdata[]={0x72, 0x65, 0x64, 0x70, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
DWORD newdatasize = sizeof(newdata);
|
| Code: |
void HackMapleStory() {
HWND hWnd = FindWindow(0, "MapleStory");
if(hWnd == 0) {
MessageBox(0, "Error cannot find window!", "Error!", MB_OK + MB_ICONERROR);
} else {
DWORD proc_id;
GetWindowThreadProcessId(hWnd, &proc_id);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id);
if(!hProcess) {
MessageBox(NULL, "Cannot open process!", "Error!", MB_OK + MB_ICONERROR);
} else {
if(WriteProcessMemory(hProcess, (LPVOID)ptrAddress, &newdata, newdatasize, NULL)) {
MessageBox(NULL, "WriteProcessMemory is a success!", "Success!", MB_OK + MB_ICONINFORMATION);
} else {
MessageBox(NULL, "Error cannot WriteProcessMemory!", "Error!", MB_OK + MB_ICONERROR);
}
}
}
}
|
BYTE newdata[]={0x72, 0x65, 0x64, 0x70, 0x6F, 0x74, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
is the data you want to put into the pointer
at ptrAddress change 0x5C6600 is the pointer change it to your pointer
Last edited by pkedpker on Mon Aug 18, 2008 6:38 pm; edited 5 times in total |
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Mon Aug 18, 2008 6:29 pm Post subject: |
|
|
won't work. you need to loop if its a pointer. _________________
|
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Mon Aug 18, 2008 6:33 pm Post subject: |
|
|
why loop pointer i dont get it ?
yah u could loop writeprocessmemory to keep overwriting it over and over again if it changes. |
|
| Back to top |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Mon Aug 18, 2008 6:34 pm Post subject: |
|
|
because the pointer will change. the best way to do it is to find out waht writes to the pointer and change it. _________________
|
|
| Back to top |
|
 |
&Vage Grandmaster Cheater Supreme
Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Mon Aug 18, 2008 6:40 pm Post subject: |
|
|
| sponge wrote: | | because the pointer will change. the best way to do it is to find out waht writes to the pointer and change it. |
I thought he changed the bytes at the memory address rather then the value :S |
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Mon Aug 18, 2008 6:40 pm Post subject: |
|
|
| sponge wrote: | | because the pointer will change. the best way to do it is to find out waht writes to the pointer and change it. |
well yah.. then alter the assembly of it with this function I posted!  |
|
| Back to top |
|
 |
Travis13 Expert Cheater
Reputation: 0
Joined: 17 Feb 2007 Posts: 199
|
Posted: Mon Aug 18, 2008 6:46 pm Post subject: |
|
|
im sorry but i dont really get how to attach it to a process still and i guess an explanation or a tutorial would be better off for me.
One second im gonna find the pointer and wat writes to it in a second brb!
please keep this thread alive _________________
Learning C++, trying, failing, never gonna give up tho  |
|
| Back to top |
|
 |
pkedpker Master Cheater
Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Mon Aug 18, 2008 6:52 pm Post subject: |
|
|
replace "MapleStory" with your msn title.....
your tool probably detects msn by exe filename.. but this one works of title of MSN.
I don't use MSN 7.0 so I don't know
but for me it would be..
HWND hWnd = FindWindow(0, "Windows Messager");
also well.. if u can't see caption of your program use Spy++ comes with 6.0 packet of vb/c++ dunno if u got it.. but it gives you much information you need.
or u could also use classname it detects by classname too.. but for that u really need spy++ or any tool like it.
All I know if you want to do it that way here..
you gotta get processList of all filenames and based on your loop to find handle attached to it's structure. (i dont know code for it) something with Process32First and Next and some stuff like that |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Aug 18, 2008 10:27 pm Post subject: |
|
|
| pkedpker wrote: | | your tool probably detects msn by exe filename.. but this one works of title of MSN. |
which is the superior way, imo, just do something like:
| Code: | PROCESSENTRY32 pe;
HANDLE snapshot;
HANDLE handle;
pe.dwSize = sizeof(PROCESSENTRY32);
void CheckProcess(LPCSTR target){
snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
Process32First(snapshot, &pe);
while(lstrcmpi(pe.szExeFile, target) != 0){
if(Process32Next(snapshot, &pe) == FALSE){
break;
}
}
CloseHandle(snapshot);
handle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe.th32ProcessID);
} |
|
|
| Back to top |
|
 |
Drops Advanced Cheater
Reputation: 0
Joined: 22 Feb 2008 Posts: 62
|
Posted: Tue Aug 19, 2008 12:55 am Post subject: |
|
|
| If your trying to alter the value of a pointer, don't you have to read the value of the base address, add the offset and change the value of the new address? |
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Tue Aug 19, 2008 2:35 am Post subject: |
|
|
| Drops wrote: | | If your trying to alter the value of a pointer, don't you have to read the value of the base address, add the offset and change the value of the new address? |
Sure, or you can just change the instructions that make up the function itself |
|
| Back to top |
|
 |
Drops Advanced Cheater
Reputation: 0
Joined: 22 Feb 2008 Posts: 62
|
Posted: Tue Aug 19, 2008 6:59 am Post subject: |
|
|
| slovach wrote: | | Drops wrote: | | If your trying to alter the value of a pointer, don't you have to read the value of the base address, add the offset and change the value of the new address? |
Sure, or you can just change the instructions that make up the function itself |
Yea, I know that, but a couple posts up pkedpker posted code that would change the bytes at a pointer. I think what he meant to write was that he was changing the address that wrote to the pointer. (??) |
|
| Back to top |
|
 |
|