• Amused
  • Angry
  • Annoyed
  • Awesome
  • Bemused
  • Cocky
  • Cool
  • Crazy
  • Crying
  • Down
  • Drunk
  • Embarrased
  • Enraged
  • Friendly
  • Geeky
  • Godly
  • Happy
  • Hateful
  • Hungry
  • Innocent
  • Meh
  • Piratey
  • Poorly
  • Sad
  • Secret
  • Shy
  • Sneaky
  • Tired
  • Wtf
  • At Work
  • CodenzHub
  • Coding
  • Deejaying
  • Donating
  • Drinking
  • Eating
  • Editing
  • Hacking
  • Hate Mailing
  • Jamin'
  • Lagging
  • Live Streaming
  • Lurking
  • No Status
  • Pawning
  • PC Gaming
  • PS Gaming
  • Raging
  • Reversing
  • Sleeping
  • Steam Gaming
  • Trolling
  • TwitchStreamer
  • Vodka!
  • Watching TV/Movie
  • Xbox Gaming
  • Youtuber
  • Zombies
  • Results 1 to 5 of 5
    1. #1
      The Angel Of Verdun
      Always More To Code!
      Nether's Avatar
      Join Date
      Dec 2013
      England, SW
      Thanks (-->)
      Thanks (<--)

      Post C++ Memory Class - Progress (Looking To Improve)

      Silent VPN
      Hey Guys,

      I used to watch Fleeps tutorials and made a few things based of the sources he released, and I havent coded in awhile till recently.

      I have been studying basics of C++ just so I can understand the language abit better (Have Previously coded in VB ALOT),
      and well Ive made a simple read memory function for a console.

      I know there is the ReadProcessMemory Function but I tried to make it shorter to use but would like some tips/hints on what I could improove on,
      I do plan to make it so you can read/write all data types and hex/string addresses (game.exe+1234) < like that .

      #include "stdafx.h"

      using namespace std;

      #pragma region Storage

      DWORD Game_ID;
      HANDLE hProcess;
      HWND Game;

      #pragma endregion Storage For Varibles

      mem::mem()// GetProc
      //wchar_t Pname[20];//Window Name Varible (wide character - LPCSTR [.c_str] / LPCWSTR [wchar_t]
      //cout << "Enter Process Window Name: ";
      //wcin >> Pname;

      Game = FindWindow(NULL, L"Solitaire");//find the Process Via Its Window Name

      if(Game)// If The Process Is Running
      GetWindowThreadProcessId(Game, &Game_ID);//Gets The Process ID From The Process Window
      hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, Game_ID);//Declare hProcess As The Process/Handle And Give It Full Access
      cout << "\nProcess Running!" << endl;
      cout << "\nProcess Is Not Running!" << endl;

      void mem::MemRead(string Address, int nBytes){

      DWORD _Address = strtol(Address.c_str(), 0, 0);


      case 4:
      int DataTypeI;
      ReadProcessMemory(hProcess, (LPVOID)_Address, &DataTypeI, sizeof(DataTypeI), NULL);
      cout << "The Address " << Address << " Stores An Integer Value ( " << DataTypeI << " )" << endl;

      case 16:
      float DataTypeF;
      ReadProcessMemory(hProcess, (LPVOID)_Address, &DataTypeF, sizeof(DataTypeF), NULL);
      cout << "The Address " << Address << " Stores A Float Value ( " << DataTypeF << " )" << endl;

      case 32:
      double DataTypeD;
      ReadProcessMemory(hProcess, (LPVOID)_Address, &DataTypeD, sizeof(DataTypeD), NULL);
      cout << "The Address " << Address << " Stores A Double Value ( " << DataTypeD << " )" << endl;

      cout << "Invalid Selection, [Integer = 4 | Float = 16 | Double = 32]" << endl;


      void mem::Read(string Address, string Data){

      if(Data == "Integer"){
      MemRead(Address, 4);

      if(Data == "Float"){
      MemRead(Address, 16);

      if(Data == "Double"){
      MemRead(Address, 32);


      #include "stdafx.h"
      using namespace std;

      int main()

      mem OB;
      OB.MemRead("0x6B02808", 32);
      OB.Read("0x6B02808", "Double");
      return 0;

      So you can read memory by either:

      Read("Address As String", "Data Type")
      MemRead("Address As String", Data In Bytes) < its just a switch

      What I want to do is make one function with only one ReadProcessMemory, and you dont need all that code and have something like this mem.read("addy", Type(float))

      I will continue reading books and online tutorials for general C++ programming as i want to understand more about programming with C++ not just focused around hacks, so when
      I get into situations like this ill know exactly what to do or atleast have an idea of where im going and what is possible .

      The Idea for this came to me when i saw other sources on here and it had tons of read/write process memory in peoples code, i just wanted to make a class for it so it can be called in
      a small line of code and in the end bring the overall ammount of code down, although this may be pointless its helping me play around with classes and learn more about the language
      Last edited by Nether; 12-11-2013 at 10:42 PM.

    2. #2
      Learning to hack games!
      Fleep's Avatar
      Join Date
      May 2012
      Thanks (-->)
      Thanks (<--)
      This is very cool, if you happen to complete it and decide to share that class many of us would appreciate it

      Good work


    3. Thanks Nether thanked for this post
    4. #3
      Creating UE3 x86/x64 tut
      TastyHorror's Avatar
      Join Date
      Oct 2012
      Thanks (-->)
      Thanks (<--)
      You should use the switch statement in your read function to increase performance and efficiency. Also, don't use global variables.
      Last edited by TastyHorror; 12-12-2013 at 03:47 AM.
      Quote Originally Posted by squeenie View Post
      And just like Jesus did on easter Monday, he returns!

    5. #4
      Kim Kong Trasher
      I don't have status.
      c5's Avatar
      Join Date
      Jul 2012
      Mankei Iland
      Thanks (-->)
      Thanks (<--)
      Declare those global vars in the class instead.

      If you have 2 objects of the vlass, the first one will probably lead to unexpected behaviour.

      Rather than outputing the result, return it, and use templates to reduce the size of the class.
      C++ Memory Class - Progress (Looking To Improve)

    6. Thanks Nether thanked for this post
    7. #5
      The Angel Of Verdun
      Always More To Code!
      Nether's Avatar
      Join Date
      Dec 2013
      England, SW
      Thanks (-->)
      Thanks (<--)
      Silent VPN
      Thank you for the information / tips you have provided I will continue to work on this , thank you for the support

    8. Thanks NTvalk thanked for this post

    Similar Game Hacker Threads

    1. [Source Code] Nether's C++ Memory Class V1.6
      By Nether in forum Tutorials and Snippets
      Replies: 71
      Last Post: 06-19-2017, 11:51 AM
    2. [Source Code] Nether's V1.5 C++ Memory Class
      By Nether in forum Tutorials and Snippets
      Replies: 6
      Last Post: 03-05-2014, 12:21 PM
    3. [Source Code] Nether's V1.4 C++ Memory Class
      By Nether in forum Tutorials and Snippets
      Replies: 11
      Last Post: 01-31-2014, 08:27 AM
    4. [Source Code] Nether's VB Memory Class
      By Nether in forum Visual Basic
      Replies: 0
      Last Post: 01-25-2014, 07:24 PM
    5. [Source Code] ProcMem.h C++ Memory Class
      By Nether in forum Tutorials and Snippets
      Replies: 3
      Last Post: 01-12-2014, 05:03 AM

    Tags for this Thread