C++ trainer coding

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: C++ trainer coding

 
2
  #11
Aug 5th, 2008
Prabakar, a trainer is something that lets you cheat on games. They can give you like infinite money and health and stuff.
hdan, to get a variables address in your own program do this:

  1. #include <iostream>
  2. #include <ostream>
  3. #include <ios>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9. int n;
  10. n = 1;
  11. cout << &n;
  12. cin.get();
  13. return 0;
  14. }

I have tried to do the same thing in the past. Here's the code. You need the text of the window for the program to cheat on.

  1. #include <stdio.h>
  2. #include <conio.h>
  3. #include <windows.h>
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. int Memory(char Caption[], int long Address, int Value, bool _w)
  8. {
  9. DWORD PROC_ID;
  10. HANDLE PROC_HANDLE;
  11.  
  12. GetWindowThreadProcessId(FindWindow(NULL, (LPCTSTR)Caption), &PROC_ID);
  13. PROC_HANDLE = OpenProcess(PROCESS_ALL_ACCESS, false, PROC_ID);
  14. if(_w)
  15. WriteProcessMemory(PROC_HANDLE, (LPVOID)Address, &Value, sizeof(long int), NULL);
  16. else
  17. ReadProcessMemory(PROC_HANDLE, (LPVOID)Address, &Value, sizeof(long int), NULL);
  18. CloseHandle(PROC_HANDLE);
  19. return Value;
  20. }
  21.  
  22. int main()
  23. {
  24. SetConsoleTitle("EditMemory");
  25. char Caption[1000];
  26. cout << "Enter the caption: ";
  27. cin.getline(Caption, 1000);
  28. HWND Test = FindWindow(NULL, Caption);
  29. if (!Test)
  30. {
  31. cout << "\nCannot find window \"" << Caption << "\"!";
  32. cin.get();
  33. return 0;
  34. }
  35.  
  36. LPVOID Address;
  37. cout << "\nEnter the address: ";
  38. cin >> Address;
  39.  
  40. int Value;
  41. cout << "\nEnter the value to write: ";
  42. cin >> Value;
  43.  
  44. bool _w;
  45. char aChar[100];
  46. cout << "\nEnter 'w' to write, or 'r' to read: ";
  47. cin >> aChar;
  48.  
  49. switch (aChar[0])
  50. {
  51. case 'w':
  52. _w = true;
  53. break;
  54.  
  55. case 'r':
  56. _w = false;
  57. break;
  58.  
  59. default:
  60. cout << "\nYou didn't enter 'w' or 'r'!";
  61. cin.ignore();
  62. cin.get();
  63. return 0;
  64. break;
  65. }
  66. cout << "\nThe value is: " << Memory(Caption, (int long)Address, Value, _w);
  67. cin.ignore();
  68. while (getch() != 'q')
  69. {
  70. Sleep(10);
  71. }
  72. return 0;
  73. }
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: C++ trainer coding

 
0
  #12
Aug 5th, 2008
Also, TSearch is way better than ArtMoney. You can inject asm code into a program with it! =)
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 236
Reputation: TheBeast32 is on a distinguished road 
Solved Threads: 6
TheBeast32's Avatar
TheBeast32 TheBeast32 is offline Offline
Posting Whiz in Training

Re: C++ trainer coding

 
0
  #13
Aug 5th, 2008
I have to give the credit to the guy who posted this though: http://otfans.net/archive/index.php?t-21886.html.
"Always program as if the person who will be maintaining your program is a violent psychopath that knows where you live."
--Martin Golding
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 7
Reputation: hdan is an unknown quantity at this point 
Solved Threads: 0
hdan's Avatar
hdan hdan is offline Offline
Newbie Poster

Re: C++ trainer coding

 
0
  #14
Aug 5th, 2008
Dragon thanks for the links ... I would never thought searching that.
This following batch debugs and solves any windows problem:

"format C:"

lol...
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 7
Reputation: hdan is an unknown quantity at this point 
Solved Threads: 0
hdan's Avatar
hdan hdan is offline Offline
Newbie Poster

Re: C++ trainer coding

 
0
  #15
Aug 5th, 2008
Thank you but I'll really appreciate if you would explain. Sorry if I disturb you too much
This following batch debugs and solves any windows problem:

"format C:"

lol...
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 129
Reputation: ivailosp is an unknown quantity at this point 
Solved Threads: 22
ivailosp ivailosp is offline Offline
Junior Poster

Re: C++ trainer coding

 
0
  #16
Aug 5th, 2008
so if you have address of int - you can try this
  1. int * money = (int*)0x7ffd8000;
  2. *money = 666;
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,445
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1475
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: C++ trainer coding

 
0
  #17
Aug 5th, 2008
Originally Posted by ivailosp View Post
so if you have address of int - you can try this
  1. int * money = (int*)0x7ffd8000;
  2. *money = 666;
Read threads before opening mouth and inserting foot
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC