Thread: Byte search C++

Results 1 to 10 of 10
  1. #1
    scriptkiddy's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    67
    Reputation
    12
    Thanks
    63

    Byte search C++

    Hey guys! I have made some memory edits for C++, but I have a problem:

    1: The pointer for this game is NOT static, so it keeps changing on game restart.

    2: How do I change opcodes and preform functions such as mov eax, [1000]

    3: So, this is basically like question number one, I read somewhere that you can make C++ scan for bytes in a process (I know how to open a process). So basically, my bytes are:

    29 83 14 03 00 00

    and the opcode is

    sub [ebx+00000314],eax

    My question is, how do I find this and get the memory address, so that I can edit its value or change the opcode?

    What function do I use? for sure it can't be ReadProcessMemory, what would it be?

    Tyvm for your time, hopefully somebody can help me ou on this

    I want to do this in a C++ trainer, so which function should I use to find the pointer?
    Last edited by scriptkiddy; 10-07-2009 at 08:28 AM.

  2. #2
    Z0d14k's Avatar
    Join Date
    Oct 2009
    Gender
    male
    Location
    World
    Posts
    318
    Reputation
    18
    Thanks
    641
    My Mood
    Cool
    Hi,

    you have tu unpack warrock.exe debug it with ollydb and search for the addres.. and you will see the off bytes.
    For the on byte try to NOP it, if it doesent work you have to search the correct bytes.

  3. #3
    Noxit's Avatar
    Join Date
    Jul 2007
    Gender
    male
    Location
    N:\O\X\I\T.exe
    Posts
    2,017
    Reputation
    24
    Thanks
    640
    My Mood
    Drunk
    Wow complicated shit
    --














  4. #4
    Lolland's Avatar
    Join Date
    Feb 2009
    Gender
    male
    Location
    Lolland!
    Posts
    3,156
    Reputation
    49
    Thanks
    868
    My Mood
    Inspired
    Wow, post count +1.

  5. #5
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,204
    My Mood
    Flirty
    I think they are talking about two different things. The first involves scanning for bytes using C++.... making a program to do so, sort of like they do in address loggers. What Zodiak is talking about is using a plugin for Olly to unpack warrock and just reverse it manually.

    I saw a function a while back in some old source for an address logger. Maybe I can find it for you.
    Last edited by why06; 10-10-2009 at 03:45 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  6. #6
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    It's fairly simple, before I explain, let me state that I totally disagree with what Z0d14k has said. If you're going to make a hack, reverse engineer it yourself, and patch it yourself, don't hijack shellcode from other people(whether it only be 1 byte long or not).

    A signature scan is pretty simple, all you're going to need is memcmp and an array of bytes holding your signature.(assuming you're injecting executable code into the target, otherwise you'll need to use readprocessmemory api to dump a region of the target into a buffer and scan that.) Simply start at any address(where in virtual memory the game was loaded is a good place) and use memcmp, increasing the index from the base address by one byte every time a match isn't made with the byte array you're looking for(also known as a signature), when a match is made, return the address you last checked. I wrote a signature scanning class a while ago, I'll see if I can dig it up. They wouldn't take long to write though.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  7. The Following 2 Users Say Thank You to radnomguywfq3 For This Useful Post:

    Hell_Demon (10-11-2009),why06 (10-10-2009)

  8. #7
    scriptkiddy's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    67
    Reputation
    12
    Thanks
    63
    sorry double post plz delete, and ty Jetamay. Dont need your source, figured it out with your idea. Tyvm.

    Resolved. No, this wasn't asking how to search for memory addresses, I am not retarted. It had to do with DLL injection.

    Thanks for the idea dude. It worked. Will give you credit when I use this.
    Last edited by why06; 10-10-2009 at 11:24 PM.

  9. #8
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    Do u mean this ??


    Code:
    BYTE Array1[] = { 0xc7, 0x86, 0x00, 0x01 }
    DWORD Address = 0x123456;
    
    WriteProcessMemory(phandle, (LPVOID) Address1,(LPVOID) &Array1, sizeof(Array1), 0);

  10. #9
    scriptkiddy's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    Canada
    Posts
    67
    Reputation
    12
    Thanks
    63
    Quote Originally Posted by Matrix_NEO006 View Post
    Do u mean this ??


    Code:
    BYTE Array1[] = { 0xc7, 0x86, 0x00, 0x01 }
    DWORD Address = 0x123456;
    
    WriteProcessMemory(phandle, (LPVOID) Address1,(LPVOID) &Array1, sizeof(Array1), 0);
    nope, injected memory scan, but I already figured out how to make it using his idea.

  11. #10
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,204
    My Mood
    Flirty
    Quote Originally Posted by scriptkiddy View Post
    nope, injected memory scan, but I already figured out how to make it using his idea.
    Hmmm... that's what I thought you meant too. What's an injected memory scan?

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Similar Threads

  1. [Help]Searching for Bytes
    By Cryptonic in forum Combat Arms Coding Help & Discussion
    Replies: 8
    Last Post: 04-21-2011, 08:35 PM
  2. [Request] Help in searching Bytes
    By D3t0N4t3 in forum WarRock Hack Source Code
    Replies: 3
    Last Post: 04-02-2011, 05:52 PM
  3. Beginner Guide to using T-Search
    By arunforce in forum Game Hacking Tutorials
    Replies: 0
    Last Post: 01-02-2006, 08:13 PM
  4. Differences in Bytes.
    By Dave84311 in forum Game Hacking Tutorials
    Replies: 0
    Last Post: 01-02-2006, 12:36 PM
  5. Hi;Searching for hack
    By Silverman in forum General Game Hacking
    Replies: 0
    Last Post: 12-31-2005, 05:35 AM

Tags for this Thread