• 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 7 of 7
    1. #1
      Coder
      System.Threading.Thread.Curren
      tThread.Sleep(10)
       
      Pawning
       
      Syntax Error's Avatar
      Join Date
      Nov 2014
      Location
      Moms basement
      Posts
      242
      Thanks (-->)
      257
      Thanks (<--)
      158

      Visual Representation vs. Real Value

      Cheats-n-Trainers
      So I was making a simple "game" to practice hacking. I made it with the specific intent to be hacked and there's no winning otherwise. I learned a lot by making it and I thought I'd share my experience. Most of you probably knew this but it was a totally mind blowing experience for me. I would always get frustrated when looking for offsets in cheat engine because I would find the "visual" address and become baffled as to why it wouldn't change anything. I had read peoples comment's saying it's just a visual representation of something but I never really understood what they meant or how it worked. My mind set was "if it looks like a duck and it quacks like a duck, then it must be a duck"... I'll get back to this at the end of my little story. Originally this game just had a global variable that stored health. Nothing special but then I got the crazy idea of hey, why don't a I make a pointer to it and that way it wouldn't be so easy to find in cheat engine.

      gHealth = 100;
      *pHealth = &gHealth;

      At the time I thought the pointer would somehow mask the global variable until I read what writes to the address of the pointer. So I fired up cheat engine and searched for 100 hoping only to find the pointer. :/ Nope. They're both just chillin there... mocking me. So then I think to myself, if they're both coming out when I enter in 100. Why don't I set the global one to -100. Ha, I felt so clever. The feeling was short lived as I contemplated the rest of the code.. If pHealth is pointing to gHealth... then... that would mean.. DAMN IT they're both -100. Not to be outdone, I decided I would set *pHealth = gHealth + 200. Ran the code and it broke down. gHealth + 200 isn't a memory address. Go figure. So I changed pHealth to a regular int and I ran the code. This still broke down because I wasn't updating pHealth in the loop. It had just been initialized at the start of the function. Once I fixed that I was pretty happy with myself. I fire up cheat engine and look for 100. It came up and no static address in sight. Could this really be it? Did I finally accomplish my quest? I lower my health and sure enough pHealth changes with it. So I double click it and change it value and I'm about to burst with excitement. I lower my health again and WTF!!! Changing pHealths value didn't do shit!!! Finally, I realized what was happening. IT WAS JUST A VISUAL REPRESENTATION OF MY HEALTH and it wasn't actually modifying my real health which i had masked!! Well, I failed my original goal to make a pointer but needless to say, I understand memory/ cheat engine/ and how my computer works a little better. I'm not really sure if this qualifies under the discussion category but I couldn't really think of a better place for this. I felt that it was worth sharing though.

      The source

      /*
      A game that's meant to be hacked in order to win.
      */
      #include <stdio.h>
      #include <stdlib.h>
      #include <time.h>
      #include <windows.h>

      void death(void);
      void battle(int damage);
      void win(void);

      int playerHealth = -100; /* Static Health Address */

      int main(void)
      {
      int monsterLevel; /* Store the amount of damage the player will take. */
      int pHealth; /* The Visual address of health*/

      pHealth = playerHealth + 200;

      srand(time); /* Seed random numbers else rand() == same everytime.*/

      /* Infinite loop*/
      while(1){
      printf("You have %d health.\n", pHealth);

      monsterLevel = (rand() % 5) + 1; /* Random number between 1 & 5 */

      printf("You've stumbled upon a level %d monster!\n", monsterLevel);
      printf("You are about to go into battle.\n\n\n");
      system("PAUSE");

      battle(monsterLevel); /* Player loses health */
      pHealth = playerHealth + 200; /* Update pHealth */

      /* 1. Is pHealth less than or equal to 0? */
      if (pHealth <= 0){
      death();
      system("PAUSE");
      break;
      } /* 2. Is pHealth greater than or equal to 150? */
      else if (pHealth >= 150){
      win();
      system("PAUSE");
      break;
      }

      /* Continue the looping if questions 1 and 2 are false. */
      Sleep(200);
      system("CLS");
      }

      return 0;
      }

      void battle(int damage)
      {
      playerHealth -= damage;
      }

      /* Called when health goes below 1.*/
      void death(void)
      {
      printf("\n\n\aYou have succumbed to death.\n");
      printf("Your health: %d\n\n", playerHealth + 200);
      }

      /* Called when player hacks the game into giving him more than 149 health. */
      void win(void)
      {
      printf("\n\n\aYou have beat the game!\n");
      printf("Your health: %d\n\n", playerHealth + 200);
      }
      The comments I post are the representation of my actions, thoughts, and/or beliefs. I do aim to help others but I make no guarantee that the code, help, or suggestions I make will work. If your computer explodes and/or starts shooting pink dildos at you as a result of my comment I do humbly apologize but you do so at your own risk. I am by no stretch of the imagination an expert.

    2. Thanks Solaire, Crazywink, N/A, keto, Seneekikaant thanked for this post
    3. #2
      Respected Hacker
      PRAISE THE SUUUUUUUUUUUUUUN
       
      Coding
       
      Solaire's Avatar
      Join Date
      Dec 2013
      Location
      Undead Burg
      Posts
      1,095
      Thanks (-->)
      364
      Thanks (<--)
      584
      Nice find!
      Visual Representation vs. Real Value

      [02-02, 21:50] AnomanderRake: jeans, skinny jeans, MC hammer pants, yoga pants & hot pants
      [02-02, 21:50] AnomanderRake: Only one of them isn't gay
      [02-02, 21:51] Krampus: MC hammer pants, duh
      [02-02, 21:54] Krampus: Actually, trick pants. All questions are gay, duh
      [02-02, 21:56] AnomanderRake: aight now I know you're hitting the bong :P
      [02-02, 21:58] Krampus: Trick bong, there is no spoon

    4. #3
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      225
      Love posts like these! This is what really helps people to actually understand rather than just accept it for a norm. Nice work.

    5. #4
      Coder
      System.Threading.Thread.Curren
      tThread.Sleep(10)
       
      Pawning
       
      Syntax Error's Avatar
      Join Date
      Nov 2014
      Location
      Moms basement
      Posts
      242
      Thanks (-->)
      257
      Thanks (<--)
      158
      Quote Originally Posted by Krampus View Post
      Nice find!
      Quote Originally Posted by Crazywink View Post
      Love posts like these! This is what really helps people to actually understand rather than just accept it for a norm. Nice work.
      Thanks guys!
      The comments I post are the representation of my actions, thoughts, and/or beliefs. I do aim to help others but I make no guarantee that the code, help, or suggestions I make will work. If your computer explodes and/or starts shooting pink dildos at you as a result of my comment I do humbly apologize but you do so at your own risk. I am by no stretch of the imagination an expert.

    6. #5
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      712
      Thanks (-->)
      159
      Thanks (<--)
      225
      Quote Originally Posted by Crazywink View Post
      Love posts like these! This is what really helps people to actually understand rather than just accept it for a norm. Nice work.
      This only works if these threads get marked somehow, so a reader browsing this section can see instantly that this was a good post.
      As it is now this thread will be burried between other (probably useless) threads in a few weeks.
      My contributions
      UrbanTerror | OpenGL - ModelLogger | Polymorphic junk code | Tutorial/Article Collection
      Admiring technological singularity

    7. Thanks Crazywink, Syntax Error thanked for this post
    8. #6
      Respected Hacker
      PRAISE THE SUUUUUUUUUUUUUUN
       
      Coding
       
      Solaire's Avatar
      Join Date
      Dec 2013
      Location
      Undead Burg
      Posts
      1,095
      Thanks (-->)
      364
      Thanks (<--)
      584
      Quote Originally Posted by Superspinne View Post
      I guess this thread deserves to be sticked then.
      Agreed .
      Visual Representation vs. Real Value

      [02-02, 21:50] AnomanderRake: jeans, skinny jeans, MC hammer pants, yoga pants & hot pants
      [02-02, 21:50] AnomanderRake: Only one of them isn't gay
      [02-02, 21:51] Krampus: MC hammer pants, duh
      [02-02, 21:54] Krampus: Actually, trick pants. All questions are gay, duh
      [02-02, 21:56] AnomanderRake: aight now I know you're hitting the bong :P
      [02-02, 21:58] Krampus: Trick bong, there is no spoon

    9. Thanks Syntax Error thanked for this post
    10. #7
      Hacker
      Retired
       
      Pawning
       
      Crazywink's Avatar
      Join Date
      Jul 2012
      Location
      US
      Posts
      647
      Thanks (-->)
      111
      Thanks (<--)
      225
      GuidedHacking Advertisements
      Quote Originally Posted by Liduen View Post
      This only works if these threads get marked somehow, so a reader browsing this section can see instantly that this was a good post.
      As it is now this thread will be burried between other (probably useless) threads in a few weeks.
      Agreed, post is now stickied!

    11. Thanks Solaire, Syntax Error thanked for this post

    Similar Game Hacker Threads

    1. [Help] [SOLVED]CSGO - Get the real distance for FOV calculation
      By fully1337 in forum CS:GO Hacks Help
      Replies: 1
      Last Post: 12-09-2015, 07:10 AM
    2. Visual Studio Scheme
      By keto in forum Polls
      Replies: 9
      Last Post: 04-21-2015, 05:22 PM
    3. Visual studio vs Codeblocks
      By Nailo in forum C/C++
      Replies: 8
      Last Post: 01-22-2015, 04:37 PM
    4. [Discuss] is this real (blacklight retribution hack) (has survey)
      By aarongalve in forum Hacking Help
      Replies: 4
      Last Post: 09-08-2014, 11:08 AM
    5. No Visual Recoil.
      By nico0 in forum Hacking Help
      Replies: 9
      Last Post: 08-18-2012, 06:39 AM

    Tags for this Thread