• 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 12
    1. #1
      The Angel Of Verdun
      Always More To Code!
       
      Lurking
       
      Nether's Avatar
      Join Date
      Dec 2013
      Location
      England, SW
      Posts
      299
      Thanks (-->)
      54
      Thanks (<--)
      186

      Reading Array Elements - AOB Scan Function

      John Kittz
      Hey Guys,

      I have been trying to crack this for hours now, Ive been trying to create my own AOB Scan Function and well I am able to read the first byte and return the address but I dont know how to access the entire array to say if address bytes = DefinedByteArray, Ill show you my code and maybe you can help.

      DWORD AOBscan(){

      DWORD StartAddress = 0x6A21B25;
      DWORD EndAddress = 0x6A21C4B;
      BYTE Bytes[] = {0x71, 0x16};

      for(StartAddress; StartAddress < EndAddress; StartAddress++){
      DWORD Res = mem.read<BYTE>(StartAddress);

      if(Res == Bytes[0]){
      cout << hex << StartAddress << endl;
      break;
      }


      }
      return StartAddress;
      }


      I am getting so close - i know i have to read the addresses one by one, and byte by byte and i need some sort of loop, i just cant think of how to code it.

      I have tried many different lopping methods - i guess i need to go back to learning about arrays and just general C++ .

      here is a different approach:

      DWORD AOBscan(){
      DWORD StartAddress = 0x11A4AF;
      DWORD ReadLength = 0x19; // how many bytes to read from base
      int bytePattern = 0;
      BYTE PatternOfBytes[] = {0x89, 0xFF};

      for(int i = 0; i != ReadLength; i++){

      if(mem.read<BYTE>((DWORD)StartAddress + i) == PatternOfBytes[bytePattern]) //if first byte matches array then
      {
      bytePattern++; //Increase the array number to read
      }

      else if(bytePattern == PatternOfBytes[2]) //If the POB has reached it's end, return the address location
      {
      cout << hex << StartAddress + i << endl;
      return StartAddress + i;//Address location
      }

      else
      {
      bytePattern = 0; //The pattern was false so start from 0 and next address
      }
      }

      }


      dont worry about different address its just for debuging on solitaire atm, i will eventually have it so user can input start/end address and bytes to look for
      Last edited by Nether; 12-19-2013 at 09:31 AM.

    2. #2
      Coder
      Kappa
       
      Hacking
       
      Szaka's Avatar
      Join Date
      Mar 2013
      Posts
      168
      Thanks (-->)
      1
      Thanks (<--)
      6
      Pattern scan i understand?
      make a BYTE* pointer to this memory and check from 0 to sizeof(yourpattern) if all bytes match i guess, if not, startaddress++ till u reach the end

    3. #3
      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
      Quote Originally Posted by Nether View Post
      for(StartAddress; StartAddress < EndAddress; StartAddress++){
      DWORD Res = mem.read<BYTE>(StartAddress);
      You seem to be reading always at the same address (StartAddress).

    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 (<--)
      186
      Quote Originally Posted by till0sch97 View Post
      You seem to be reading always at the same address (StartAddress).
      ......

      StartAddress++

      I can read every byte from StartAddress to EndAddress Perfectly but its one at a time - im trying the sizeof method provided, the only problem is reading it as an array so hopefully can solve later on, if not ill go back to learning about pointers and arrays

    5. #5
      Hacker
      ^.^
       
      Eating
       
      NTvalk's Avatar
      Join Date
      Jul 2013
      Location
      Your RAM
      Posts
      512
      Thanks (-->)
      176
      Thanks (<--)
      145
      Quote Originally Posted by Nether View Post
      ......

      StartAddress++

      I can read every byte from StartAddress to EndAddress Perfectly but its one at a time - im trying the sizeof method provided, the only problem is reading it as an array so hopefully can solve later on, if not ill go back to learning about pointers and arrays
      [PHP]
      /* an array with 5 elements */
      double balance[5] = {1000.0, 2.0, 3.4, 17.0, 50.0};
      double *p;
      int i;

      p = balance; // p is a pointer to the first element of balance 0x6A21B25 in your case I guess

      /* output each array element's value */
      printf( "Array values using pointer\n");
      for ( i = 0; i < 5; i++ )
      {
      printf("*(p + %d) : %f\n", i, *(p + i) ); // loop through the array
      }
      [/PHP]

      So you could try to use the pointer of the first element and just loop the bytes if you know the size of the array. (end address - start address).
      It is legal to use array names as constant pointers, and vice versa. Therefore, *(balance + 4) is a legitimate way of accessing the data at balance[4].
      Last edited by NTvalk; 12-19-2013 at 09:05 AM.

    6. Thanks Nether thanked for this post
    7. #6
      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
      Quote Originally Posted by Nether View Post
      ......

      StartAddress++

      I can read every byte from StartAddress to EndAddress Perfectly but its one at a time - im trying the sizeof method provided, the only problem is reading it as an array so hopefully can solve later on, if not ill go back to learning about pointers and arrays
      I'm sorry I misread sth there.. Why's your pattern only 2 bytes btw?

    8. #7
      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
      Don't know if this works but you could maybe try creating a buffer in your loop, with the length of your pattern, then just read X bytes (pattern length) and compare them with '=='

    9. Thanks Nether thanked for this post
    10. #8
      The Angel Of Verdun
      Always More To Code!
       
      Lurking
       
      Nether's Avatar
      Join Date
      Dec 2013
      Location
      England, SW
      Posts
      299
      Thanks (-->)
      54
      Thanks (<--)
      186
      Quote Originally Posted by till0sch97 View Post
      Don't know if this works but you could maybe try creating a buffer in your loop, with the length of your pattern, then just read X bytes (pattern length) and compare them with '=='
      I think i may have to make a buffer size.

      Im able to read more than 1 byte now thanks to NTvalk.

      Only problem with that is - say the address 0x11A4C2 - 0x89 / 0xFF

      it will find it and return that address but also return 0x11A4C3 :P im getting really close now, i do apreciate the help you guys have provided

    11. #9
      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
      Quote Originally Posted by Nether View Post
      I think i may have to make a buffer size.

      Im able to read more than 1 byte now thanks to NTvalk.

      Only problem with that is - say the address 0x11A4C2 - 0x89 / 0xFF

      it will find it and return that address but also return 0x11A4C3 :P im getting really close now, i do apreciate the help you guys have provided
      Compare all those buffer bytes with the ones that you need, then it will give you 1 address only..

    12. #10
      The Angel Of Verdun
      Always More To Code!
       
      Lurking
       
      Nether's Avatar
      Join Date
      Dec 2013
      Location
      England, SW
      Posts
      299
      Thanks (-->)
      54
      Thanks (<--)
      186
      Cheats'n'Trainers
      Quote Originally Posted by till0sch97 View Post
      Compare all those buffer bytes with the ones that you need, then it will give you 1 address only..
      erm okay but that was pretty obvious...

      the only compare functions i know is string compare so im guessing just convert them into char*/string and use strcmp(ResultBytes, MyByteArray).

      DWORD AOBscan(){

      DWORD StartAddress = 0x11A4AF;
      DWORD EndAddress = 0x11A4C8;
      DWORD bArray;

      BYTE Bytes[] = {0x89, 0xFF};
      BYTE *p;
      p = Bytes;

      int i;

      for(StartAddress; StartAddress < EndAddress; StartAddress++){ //Counts from Start Address To End Address

      for ( i = 0; i < 2; i++ )
      {
      bArray = (DWORD)p[i]; // Produces 89FF (Both My Bytes)
      if(mem.read<BYTE>(StartAddress) == bArray){ // Still Reads First Byte - I need String To Compare I Think
      cout << hex << StartAddress << endl; //Returns correct address but also the next address +1 (StartAddress++)
      }
      }

      }
      return 0;
      }


      So Far ^^ , im going to work on making it with char*/string so i can use strcmp but if anyone has a better idea please let me know - this was so much easier in VB hehe
      Last edited by Nether; 12-19-2013 at 11:10 AM.

    Page 1 of 2 12 LastLast

    Similar Game Hacker Threads

    1. [Help] Player Array
      By FloppyWhale in forum Assault Cube Hacks
      Replies: 5
      Last Post: 04-10-2016, 05:14 PM
    2. [Help] Player array
      By PePPeRmix in forum Hacking Help
      Replies: 5
      Last Post: 02-23-2016, 05:13 AM
    3. Replies: 5
      Last Post: 06-22-2015, 06:27 AM
    4. Calling a function by address (function in another module)
      By c5 in forum Tutorials and Snippets
      Replies: 9
      Last Post: 11-05-2013, 09:27 AM
    5. [Help] [ASK] array of byte
      By dydrax in forum Hacking Help
      Replies: 6
      Last Post: 03-19-2013, 02:52 PM