943,865 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 5302
  • C++ RSS
You are currently viewing page 2 of this multi-page discussion thread; Jump to the first page
Aug 5th, 2008
2

Re: C++ trainer coding

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:

C++ Syntax (Toggle Plain Text)
  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.

C++ Syntax (Toggle Plain Text)
  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. }
Reputation Points: 79
Solved Threads: 6
Posting Whiz in Training
TheBeast32 is offline Offline
236 posts
since Dec 2007
Aug 5th, 2008
0

Re: C++ trainer coding

Also, TSearch is way better than ArtMoney. You can inject asm code into a program with it! =)
Reputation Points: 79
Solved Threads: 6
Posting Whiz in Training
TheBeast32 is offline Offline
236 posts
since Dec 2007
Aug 5th, 2008
0

Re: C++ trainer coding

I have to give the credit to the guy who posted this though: http://otfans.net/archive/index.php?t-21886.html.
Reputation Points: 79
Solved Threads: 6
Posting Whiz in Training
TheBeast32 is offline Offline
236 posts
since Dec 2007
Aug 5th, 2008
0

Re: C++ trainer coding

Dragon thanks for the links ... I would never thought searching that.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hdan is offline Offline
7 posts
since Jul 2008
Aug 5th, 2008
0

Re: C++ trainer coding

Thank you but I'll really appreciate if you would explain. Sorry if I disturb you too much
Reputation Points: 10
Solved Threads: 0
Newbie Poster
hdan is offline Offline
7 posts
since Jul 2008
Aug 5th, 2008
0

Re: C++ trainer coding

so if you have address of int - you can try this
cpp Syntax (Toggle Plain Text)
  1. int * money = (int*)0x7ffd8000;
  2. *money = 666;
Reputation Points: 21
Solved Threads: 22
Junior Poster
ivailosp is offline Offline
129 posts
since Apr 2008
Aug 5th, 2008
0

Re: C++ trainer coding

Click to Expand / Collapse  Quote originally posted by ivailosp ...
so if you have address of int - you can try this
cpp Syntax (Toggle Plain Text)
  1. int * money = (int*)0x7ffd8000;
  2. *money = 666;
Read threads before opening mouth and inserting foot
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,951 posts
since Aug 2005
Sep 19th, 2011
0
Re: C++ trainer coding
when he says trainer I do Beleive he means like a flash game trainer.

Its a whole lot easier in VB but like he means to take the variable in a game such as health; take its original value of 100 and change it to something like 1000.

Im pretty sure thats what he means....again its alot easier in VB so i would think about doing a trainer there first
Reputation Points: 10
Solved Threads: 0
Newbie Poster
chochang262 is offline Offline
1 posts
since Sep 2011

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: handling a text file input
Next Thread in C++ Forum Timeline: HELP! Compiling Error Message





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC