• 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
  • Page 1 of 2 12 LastLast
    Results 1 to 10 of 11
    1. #1
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      j3b's Avatar
      Join Date
      Dec 2012
      Posts
      67
      Thanks (-->)
      2
      Thanks (<--)
      2

      Dll injection, fail to read memory

      Silent VPN
      Hello. Donno if this is the right section to post....BUT!

      Been doing external cheats for CSGO. And now i wanted to try something new, dll injection.
      I want to read the games memory, and since im "inside" the games memory, i just read as :.




      clientDll = (DWORD)GetModuleHandle("client.dll");
      Local = clientDll + Player_base; //Player_base = 0x....
      LocalPlayer = *(DWORD*)Local;

      myHealth = (DWORD*)(LocalPlayer + dwHealth);
      cout<<*myHealth;


      This works very well, it prints out my health and soo on.

      Problem is that when im not on a server, the game crashes..
      And i dont really know why? myHealth must get some value that isnt a int?
      Is there a way to "bypass" this, so it does not crash?

      Been also reading the same way, but for the other players on the server. It works, prints out every enemys health 1 time, but then it crashes.

    2. #2
      The Angel Of Verdun
      Always More To Code!
       
      Lurking
       
      Nether's Avatar
      Join Date
      Dec 2013
      Location
      England, SW
      Posts
      299
      Thanks (-->)
      54
      Thanks (<--)
      188
      perhaps your health is loaded into a different module if your on a different server than localhost, or if your reffering to it not working when not in game then its not likley not initizalied and your reading a NULL Pointer.

      to solve null pointer.


      if(myHealth)
      cout << *myHealth << endl;


      i would also recomend writing your local like this:

      CLocalPlayer *Player = *(CLocalPlayer**)((DWORD)GetModuleHandleA("client.dll") + 0x7A4DF0);


      replace my random offset with your correct one (CLocalPlayer Is My Class, I would also REcommend using Re-Class If you havent yet)

      then you can just use this example if your using re-class or any sort of class that holds your offsets.


      if (Player)
      cout << Player->myHealth << endl;
      Last edited by Nether; 01-27-2014 at 08:40 PM.
      No Need For Anything Extravagant, Your Blood As A Present Shall Suffice.

    3. #3
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      j3b's Avatar
      Join Date
      Dec 2012
      Posts
      67
      Thanks (-->)
      2
      Thanks (<--)
      2
      Quote Originally Posted by Nether View Post
      perhaps your health is loaded into a different module if your on a different server than localhost, or if your reffering to it not working when not in game then its not likley not initizalied and your reading a NULL Pointer.

      to solve null pointer.


      if(myHealth)
      cout << *myHealth << endl;


      i would also recomend writing your local liek this:

      CLocalPlayer *Player = *(CLocalPlayer**)((DWORD)GetModuleHandleA("client.dll") + 0x7A4DF0);


      replace my random offset with your correct one (CLocalPlayer Is My Class, I would also REcommend using Re-Class If you havent yet)

      then you can just use this example if your using re-class or any sort of class that holds your offsets.


      if (Player-myHealth)
      cout << *Player->myHealth << endl;
      I will try this one. Yes, ive heard of Reclass, but i just want to try this way.
      I will be back if this still crashes the game :<

      Edit : Its crashing when im just in the lobby in CSGO.
      Last edited by j3b; 01-27-2014 at 11:05 AM.

    4. #4
      The Angel Of Verdun
      Always More To Code!
       
      Lurking
       
      Nether's Avatar
      Join Date
      Dec 2013
      Location
      England, SW
      Posts
      299
      Thanks (-->)
      54
      Thanks (<--)
      188
      Quote Originally Posted by j3b View Post
      I will try this one. Yes, ive heard of Reclass, but i just want to try this way.
      I will be back if this still crashes the game :<

      Edit : Its crashing when im just in the lobby in CSGO.
      sorry i failed with editing on that last post the forum wasnt working correctly when i tried to edit it, ive updated my previous post, please let met know if you have errors still.
      No Need For Anything Extravagant, Your Blood As A Present Shall Suffice.

    5. #5
      Respected Hacker
      Learning to hack games!
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      As Nether already said, it could be that another entity pointer or just pointer to your playerbase which is being used in multiplayer..

      Just put out the value that the pointer holds, if it's 0 just add a

      if (pointer != 0)
      {
      ....
      }

      Or find the correct multiplayer pointer..

    6. #6
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      j3b's Avatar
      Join Date
      Dec 2012
      Posts
      67
      Thanks (-->)
      2
      Thanks (<--)
      2
      nvm... still not working.
      Last edited by j3b; 01-27-2014 at 12:13 PM.

    7. #7
      Hacker
      Working, University, Coding ..
       
      Drinking
       
      GAFO666's Avatar
      Join Date
      Aug 2012
      Location
      if(PlayerBase << 16) return IdontKnow("yolo");
      Posts
      531
      Thanks (-->)
      33
      Thanks (<--)
      103
      Quote Originally Posted by j3b View Post
      nvm... still not working.
      Code:
      if(!IsBadReadPtr ( (DWORD*) LocalPlayer, sizeof ( (DWORD*) LocalPlayer )))
      {
      	//your code
      }

      Leave a rep+ if I helped you with my answer
      Dont tell me to google something, first thing I do before asking is searching on my own.

    8. #8
      Respected Hacker
      Learning to hack games!
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      People say that IsBadReadPtr wouldn't be so good so rather go for a not outdated function

    9. #9
      Jr.Hacker
      Haze-Productions
       
      Coding
       
      rN''s Avatar
      Join Date
      Jan 2014
      Posts
      340
      Thanks (-->)
      20
      Thanks (<--)
      126
      Code:
      int CBaseEntity::m_iHealth( void )
      {
      	return *reinterpret_case<int>*( dwEntity + 0x90 );
      }
      works for meeeh

    10. #10
      Learning to hack games!
       
      Feeling Normal
       
      's Avatar
      Join Date
      Jan 1970
      Posts
      0
      Thanks (-->)
      294
      Thanks (<--)
      328
      Silent VPN
      Quote Originally Posted by GAFO666 View Post
      Code:
      if(!IsBadReadPtr ( (DWORD*) LocalPlayer, sizeof ( (DWORD*) LocalPlayer )))
      {
          //your code
      }
      Straight from MSDN:

      Quote Originally Posted by MSDN
      IsBadReadPtr function

      Verifies that the calling process has read access to the specified range of memory.

      Important This function is obsolete and should not be used. Despite its name, it does not guarantee that the pointer is valid or that the memory pointed to is safe to use. For more information, see Remarks on this page.

      Remarks

      This function is typically used when working with pointers returned from third-party libraries, where you cannot determine the memory management behavior in the third-party DLL.
      Threads in a process are expected to cooperate in such a way that one will not free memory that the other needs. Use of this function does not negate the need to do this. If this is not done, the application may fail in an unpredictable manner.
      Dereferencing potentially invalid pointers can disable stack expansion in other threads. A thread exhausting its stack, when stack expansion has been disabled, results in the immediate termination of the parent process, with no pop-up error window or diagnostic information.
      If the calling process has read access to some, but not all, of the bytes in the specified memory range, the return value is nonzero.
      In a preemptive multitasking environment, it is possible for some other thread to change the process's access to the memory being tested. Even when the function indicates that the process has read access to the specified memory, you should use structured exception handling when attempting to access the memory. Use of structured exception handling enables the system to notify the process if an access violation exception occurs, giving the process an opportunity to handle the exception.
      Or as most people say, they should really call it " CrashProgramRandomly "
      Last edited by Spock; 01-27-2014 at 04:43 PM.

    11. Thanks Nether thanked for this post
    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [Help] C++ Read Write Memory
      By fx705HUJX0 in forum C/C++
      Replies: 7
      Last Post: 03-31-2016, 01:43 PM
    2. [Help] Memory injection fail 1/2
      By LoudyPanda in forum Hacking Help
      Replies: 3
      Last Post: 12-18-2014, 02:37 PM
    3. [Help] DLL injection read/write memory
      By BDKPlayer in forum Hacking Help
      Replies: 12
      Last Post: 07-16-2014, 11:29 AM
    4. [Help] Read Memory Problem
      By Chri907 in forum GH Tutorials Help
      Replies: 5
      Last Post: 05-17-2014, 11:31 AM
    5. Replies: 31
      Last Post: 05-29-2013, 06:48 AM

    Tags for this Thread