• 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
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      VDV777's Avatar
      Join Date
      Mar 2013
      Posts
      92
      Thanks (-->)
      38
      Thanks (<--)
      0

      crash c++/VS 2012

      John Kittz
      code:
      recoiil.h
      Code:
      class RecoilPlayer;
      
      class RecoilPlayer
      {
      public:
      	__int32 Recoil; //0x0000 
      char _0x0004[60];
      
      static RecoilPlayer* Singleton (int*address)
      {
      return *(RecoilPlayer**)address;
      }
      };//Size=0x0040
      main.cpp
      Code:
      DWORD WINAPI Game_thread (LPVOID)
      {
      	CreateConsole();
      	DWORD Recoil_Eng = (DWORD)GetModuleHandle("Game.exe") + 0x13F135C;
      	DWORD offsets[] = {0x50 , 0x138 , 0xC , 0x4 , 0x3C};
      	int* locPlayer = ReadPointer(Recoil_Eng, offsets ,5);
      	RecoilPlayer* localPlayer = RecoilPlayer::Singleton(locPlayer);
      	printf ("address = %X\n" , localPlayer->Recoil);
      
      	localPlayer->Recoil = 100;
      When i call "
      Code:
      localPlayer->Recoil = 100
      " - crash and if
      Code:
      printf ("address = %X\n" , localPlayer->Recoil);
      - crash . Where is my error?
      Last edited by VDV777; 06-25-2013 at 01:43 PM.

    2. #2
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      emistz's Avatar
      Join Date
      May 2013
      Posts
      71
      Thanks (-->)
      2
      Thanks (<--)
      9
      Can't say for sure, but that pointer magic looks kinda messy:
      static RecoilPlayer* Singleton (int*address)
      {
      return *(RecoilPlayer**)address;
      }

      You're casting into a RecoilPlayer ptr_ptr and then dereferncing it. Is that what you intend to do?

    3. #3
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      VDV777's Avatar
      Join Date
      Mar 2013
      Posts
      92
      Thanks (-->)
      38
      Thanks (<--)
      0
      Quote Originally Posted by emistz View Post
      Can't say for sure, but that pointer magic looks kinda messy:
      static RecoilPlayer* Singleton (int*address)
      {
      return *(RecoilPlayer**)address;
      }

      You're casting into a RecoilPlayer ptr_ptr and then dereferncing it. Is that what you intend to do?
      i need to write "value in game class , param Recoil"
      sorry for my english

    4. #4
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      somethingsomethingdarksid's Avatar
      Join Date
      Apr 2013
      Posts
      17
      Thanks (-->)
      0
      Thanks (<--)
      1
      Your answer doesn't really give any appropriate information to your emistz.

      return *(RecoilPlayer**)address; /// wtf? :O

      return (RecoilPlayer *) *address; // IF THE VALUE IS STORED AT THE LOCATION (i.e. the variable's value) - and is a memory address.
      return (RecoilPLayer *) address; // if you just want the address of this (which won't work anyway cuz address will go out of context when the function ends.


      It looks like you're trying to 'copy' the value pointed at by address.

      Anwyay, your problem could be anywhere. If you're assigning a value to address that isn't a valid memory location, that could crash - for example.
      Output would be nice.

      You're also doing it a bad way...

      return reinterpret_cast<RecoilPLayer *>(*address); // ASSUMING that the value stored in address is a valid memory pointer....


      I'm guessing you're going to still have errors.

    5. Thanks VDV777 thanked for this post
    6. #5
      Jr.Coder
      Learning to hack games!
       
      Feeling Normal
       
      VDV777's Avatar
      Join Date
      Mar 2013
      Posts
      92
      Thanks (-->)
      38
      Thanks (<--)
      0
      Cheats'n'Trainers
      Quote Originally Posted by somethingsomethingdarksid View Post
      Your answer doesn't really give any appropriate information to your emistz.

      return *(RecoilPlayer**)address; /// wtf? :O

      return (RecoilPlayer *) *address; // IF THE VALUE IS STORED AT THE LOCATION (i.e. the variable's value) - and is a memory address.
      return (RecoilPLayer *) address; // if you just want the address of this (which won't work anyway cuz address will go out of context when the function ends.


      It looks like you're trying to 'copy' the value pointed at by address.

      Anwyay, your problem could be anywhere. If you're assigning a value to address that isn't a valid memory location, that could crash - for example.
      Output would be nice.

      You're also doing it a bad way...

      return reinterpret_cast<RecoilPLayer *>(*address); // ASSUMING that the value stored in address is a valid memory pointer....


      I'm guessing you're going to still have errors.
      thank you help me a lot!
      /close thread

    Similar Game Hacker Threads

    1. c++ VS 2012
      By VDV777 in forum C/C++
      Replies: 4
      Last Post: 04-25-2013, 09:41 AM
    2. Member of the Quarter [Q4 2012]
      By c5 in forum Member of the Quarter
      Replies: 15
      Last Post: 01-01-2013, 08:06 AM
    3. Anyone using Visual Studio 2012 right now?
      By shuuk in forum Hacking Help
      Replies: 15
      Last Post: 12-07-2012, 01:06 PM
    4. C++ Snake Game Weekend Project 2012.08.26
      By voidisalive in forum C/C++
      Replies: 12
      Last Post: 08-30-2012, 07:47 PM

    Tags for this Thread