• 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 6 of 6
    1. #1
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Shadoninja's Avatar
      Join Date
      Apr 2013
      Location
      Fort Collins, CO
      Posts
      36
      Thanks (-->)
      5
      Thanks (<--)
      1

      Getting the contents of a memory location as a string

      Silent VPN
      I am trying to print out my player's x coordinate to the gui of my dll injected hack.

      I know that xposition contains a DWORD of the address containing the player's x position, but I can't get it to assign its contents to the label xposStatus:

      What is working (kinda)
      Code:
      xposStatus->Text = xposition.ToString();
      This prints out what I wanted it to: the memory location holding my player's x coordinates. But that is only a small proof that I am on the right path.

      Attempt 1: (The compiler yells at me)
      Code:
      xposStatus->Text = *xposition.ToString();
      Attempt 2: ("Error: invalid type conversion")
      Code:
      xposStatus->Text = *(DWORD *)xposition.ToString();

      Attempt 3: (This compiles, but doesn't change the label at all)
      Code:
      int test = *(DWORD *)xposition;
      xposStatus->Text = test.ToString();



      How can I get that float value contained in xposition?
      Last edited by Shadoninja; 05-13-2013 at 07:36 PM.

    2. #2
      Respected Hacker
      Learning to hack games!
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Quote Originally Posted by Shadoninja View Post
      I am trying to print out my player's x coordinate to the gui of my dll injected hack.

      I know that xposition contains a DWORD of the address containing the player's x position, but I can't get it to assign its contents to the label xposStatus:

      What is working (kinda)
      Code:
      xposStatus->Text = xposition.ToString();
      This prints out what I wanted it to: the memory location holding my player's x coordinates. But that is only a small proof that I am on the right path.

      Attempt 1: (The compiler yells at me)
      Code:
      xposStatus->Text = *xposition.ToString();
      Attempt 2: ("Error: invalid type conversion")
      Code:
      xposStatus->Text = *(DWORD *)xposition.ToString();

      Attempt 3: (This compiles, but doesn't change the label at all)
      Code:
      int test = *(DWORD *)xposition;
      xposStatus->Text = test.ToString();



      How can I get that float value contained in xposition?
      So basically you have a DLL which is injected in the process. This DLL opens a window in which you want to write something. Did I understand that correclty?

    3. #3
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Shadoninja's Avatar
      Join Date
      Apr 2013
      Location
      Fort Collins, CO
      Posts
      36
      Thanks (-->)
      5
      Thanks (<--)
      1
      Yeah, it opens up a gui created from visual studios built in win32 application support. So the object on the gui that I am trying to change is the Text element of a Label^ object from System::Windows::Forms::Label^;

      Getting the contents of a memory location as a string

      This is the same structure Fleep uses in one of his tutorials, but he only uses string literals to change certain label's text to "on" or "off." I want real-time information presented, which obviously requires variable input, and the label just isn't having it.

    4. #4
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      492
      He wants to read a float from memory and convert it to a string
      Getting the contents of a memory location as a string

    5. #5
      Kim Kong Trasher
      I don't have status.
       
      Raging
       
      c5's Avatar
      Join Date
      Jul 2012
      Location
      Mankei Iland
      Posts
      1,221
      Thanks (-->)
      97
      Thanks (<--)
      492
      Code:
      DWORD position = *(DWORD_PTR*)xposition;
      xposStatus->Text = *(float*)position.ToString();
      Getting the contents of a memory location as a string

    6. #6
      Newbie
      Learning to hack games!
       
      Feeling Normal
       
      Shadoninja's Avatar
      Join Date
      Apr 2013
      Location
      Fort Collins, CO
      Posts
      36
      Thanks (-->)
      5
      Thanks (<--)
      1
      Silent VPN
      That line is giving me the "Invalid type conversion" error.

      Code:
      xposStatus->Text = *(float*)position.ToString();
            underlined red^  (the carrot is pointing to it)
      And the same error happens when I do it like this

      Code:
      char* test = *(float*)position.ToString();
      underlined red^
      Honestly if there is a better way to set up the gui, I will be happy to do that. Even if its just a console window. I just want to learn a decent way of setting this all up

    Similar Game Hacker Threads

    1. [Help] Static library location
      By markfrancis in forum Hacking Help
      Replies: 0
      Last Post: 05-01-2016, 11:07 PM
    2. [Help] Read Non Unicode String from memory without having length?
      By Yothri in forum Hacking Help
      Replies: 5
      Last Post: 10-13-2015, 10:46 AM
    3. [Help] reading string from memory adress [external]
      By Ex0rpl4net in forum C/C++
      Replies: 12
      Last Post: 09-03-2015, 06:33 PM
    4. Finding location on body
      By scrapsmoke in forum Counter-Strike: Source Hacks
      Replies: 3
      Last Post: 06-09-2015, 04:07 AM
    5. [Help] Mouse Location - Possible?
      By inZertion in forum General Coding Discussion
      Replies: 11
      Last Post: 06-12-2014, 04:57 AM

    Tags for this Thread