• 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 9 of 9

    Thread: Memory problem

    1. #1
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225

      Memory problem

      John Kittz
      I'm using the following code to write a value of 1 into a specific adress. (Thx to Fleep)
      BYTE Value[] = {0x1,0x0,0x0,0x0};
      DWORD BaseAddress = {0xDE77A4};
      WriteProcessMemory( hProcHandle, (BYTE*)BaseAddress, &Value, sizeof(Value), NULL);

      How do I write the value 30000 or 12.4567 into this adress?
      How would this line
      BYTE Value[] = {0x?,0x?,0x?,0x?};

      look like?

    2. #2
      Coder
      Kappa
       
      Hacking
       
      Szaka's Avatar
      Join Date
      Mar 2013
      Posts
      168
      Thanks (-->)
      1
      Thanks (<--)
      6
      BYTE Value[] = {0x1,0x0,0x0,0x0}; means the same as DWORD Value=1;

      Check what is "endian"

    3. #3
      Hacker
      ^.^
       
      Eating
       
      NTvalk's Avatar
      Join Date
      Jul 2013
      Location
      Your RAM
      Posts
      512
      Thanks (-->)
      176
      Thanks (<--)
      145
      Do you want to address the individual bytes of a 32-bit int? One possible method is a union:

      union
      {
      uint32_t integer;
      unsigned char byte[4];
      } foo;

      int main()
      {
      foo.integer = 123456789;
      BYTE Value[] = { foo.byte[3], foo.byte[2], foo.byte[1], foo.byte[0]};
      }


      Or you can do it with pointers (pseudo code ,not sure it works)


      unsigned char* GetBytes(uint32_t integer){
      char[] temp;

      for (int i = 0; i < sizeof(integer); ++i) {
      unsigned char byte = *((unsigned char *)&x + i);
      temp[i] = (unsigned)byte;
      return temp;
      }
      Last edited by NTvalk; 11-16-2013 at 11:15 AM.

    4. #4
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225
      I looked up "endian" and after about 10 minutes I ended up in a forum where a nice guy postet this example:

      The first need to care about in which machine the program is running because of the difference between Big and Little Ending save bytes in memory.

      Big endian saves the most significant byte in lower memory address's, to the opposite of Little endian that saves the less significant byte in lower memoriy address 's.

      Example the following integer variable (assuming int = 4 bytes) : 0X1A1B1C1D

      in big endian would be saved in memory (assuming address's grow from left to right)
      1A | 1B | 1C | 1D
      in little endian would be
      1D | 1C | 1B | 1A
      So in my case it would work like this:
      Value to write: 30000 -> 0x7530
      BYTE Value[] = {0x30,0x75,0x0,0x0};

      Can I write it also like this?:
      BYTE Value[] = {0x30,0x75};


      And if I have an adress containing a float number- how could I write that?


      Thx guys

    5. #5
      Hacker
      ^.^
       
      Eating
       
      NTvalk's Avatar
      Join Date
      Jul 2013
      Location
      Your RAM
      Posts
      512
      Thanks (-->)
      176
      Thanks (<--)
      145
      Quote Originally Posted by Liduen View Post
      I looked up "endian" and after about 10 minutes I ended up in a forum where a nice guy postet this example:



      So in my case it would work like this:
      Value to write: 30000 -> 0x7530
      BYTE Value[] = {0x30,0x75,0x0,0x0};

      Can I write it also like this?:
      BYTE Value[] = {0x30,0x75};


      And if I have an adress containing a float number- how could I write that?


      Thx guys
      Well you could use the union examplei posted above and instead of uint32_t use a float and replace byte[4] with byte[sizeof(float)]

    6. #6
      Learning to hack games!
       
      Feeling Normal
       
      's Avatar
      Join Date
      Jan 1970
      Posts
      0
      Thanks (-->)
      294
      Thanks (<--)
      328
      How about some inline asm?


      void FunctionNameHere()
      {
      __asm
      {
      mov eax, 0xDE77A4
      mov ecx, 0x7530
      mov dword ptr [eax], ecx
      }
      }

      void FunctionNameHere(DWORD base)
      {
      __asm
      {
      mov eax, base
      mov dword ptr [eax], 0x7530
      }
      }

      void FunctionNameHere(DWORD base, int value)
      {
      __asm
      {
      mov eax, base
      mov ecx, value
      mov dword ptr [eax], ecx
      }
      }

    7. #7
      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 (<--)
      491
      Quote Originally Posted by Liduen View Post
      I looked up "endian" and after about 10 minutes I ended up in a forum where a nice guy postet this example:



      So in my case it would work like this:
      Value to write: 30000 -> 0x7530
      BYTE Value[] = {0x30,0x75,0x0,0x0};

      Can I write it also like this?:
      BYTE Value[] = {0x30,0x75};


      And if I have an adress containing a float number- how could I write that?


      Thx guys
      memset((void*)&Value, 1337.f, sizeof(float));
      Memory problem

    8. #8
      Global Moderator
      give me my colorz back
      FeelsBadMan
       
      Coding
       
      till0sch's Avatar
      Join Date
      Oct 2012
      Location
      Germany.
      Posts
      1,168
      Thanks (-->)
      179
      Thanks (<--)
      340
      Why not just defining as DWORD and using DWORD Value = 30000; ? Or did I understand sth wrong here?

    9. #9
      Hacker
      Turning to page 394...
       
      Coding
       
      Liduen's Avatar
      Join Date
      May 2013
      Location
      Germany
      Posts
      713
      Thanks (-->)
      161
      Thanks (<--)
      225
      Cheats'n'Trainers
      Quote Originally Posted by till0sch97 View Post
      Why not just defining as DWORD and using DWORD Value = 30000; ? Or did I understand sth wrong here?
      Thanks, that made it a lot easier... lol :eek:
      Last edited by Liduen; 11-18-2013 at 01:44 PM.

    Similar Game Hacker Threads

    1. [Help] Dumping a whole region of memory somewhere to trick a memory check
      By windows.h in forum Hacking Help
      Replies: 6
      Last Post: 02-18-2016, 09:28 AM
    2. [Help] C# Problem
      By xa84759x in forum Hacking Help
      Replies: 11
      Last Post: 02-07-2015, 02:00 PM
    3. Fleeps memory triggerbot problem
      By simonpaa in forum Hacking Help
      Replies: 4
      Last Post: 08-12-2014, 11:56 AM
    4. [Help] Read Memory Problem
      By Chri907 in forum GH Tutorials Help
      Replies: 5
      Last Post: 05-17-2014, 11:31 AM
    5. Little Problem!
      By nico0 in forum Visual Basic
      Replies: 9
      Last Post: 07-24-2012, 04:54 AM

    Tags for this Thread