Results 1 to 7 of 7
  1. #1
    withexplosions's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0

    Need Help Updating Value At Memory Location

    I just started using C++, not new to programming in general, but I am new C++. I'm trying to write a hack for the game Arcanum: Of Steamworks and Magick Obscura. Using CheatEngine, I was able to find the memory address which stores the character's gold value and change it through CheatEngine. It is my understanding that the memory location will change every time the user opens Arcanum. What do I need to do to automagically detect where character's gold value is stored in memory every time the hack is launched? The program will simply be a console application that allows the user to enter an amount of gold to change their value to.

  2. #2
    KissU's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Posts
    107
    Reputation
    10
    Thanks
    14
    My Mood
    Blah
    Find static address. And WriteProcessMemory.
    "More suicides in world make there are less suicides in the world"


  3. #3
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Use a signature

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




  4. #4
    withexplosions's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by KissU View Post
    Find static address. And WriteProcessMemory.
    That's the green one right? Do you know where I can read about finding the static address?

  5. #5
    withexplosions's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    Quote Originally Posted by .::SCHiM::. View Post
    Use a signature
    Where can I read about signatures?

  6. #6
    .::SCHiM::.'s Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    733
    Reputation
    180
    Thanks
    880
    My Mood
    Twisted
    Quote Originally Posted by withexplosions View Post
    Where can I read about signatures?
    You can't, but signatures are very easy. Signatures are the hexadecimal footprint of a specific function or variable (in this case gold). Go to that memory location and try to find a string of bytes that is static throughout multiple instances of the program. Another thing you must consider is that the offset relative to the variable you actually want to change must be static as well.

    For example:

    Consider that I've found the string 0xDEADBEEF to be static (it's always somewhere in memory, and it always resides exactly 5 bytes before the gold variable)

    Now I use a function called bcompare (search for it on the forums) to find the signature 0xDEADBEEF. Knowing that the gold variable is always 5 bytes further then where I find 0xDEADBEEF, I only have to add 0x5 to the memory offset.

    Of course there isn't always a static string of bytes, so try to look for pointers to your variable en see if they have signatures attached to them. Often a signature can be used through many versions of the same program, sometimes your hacks can survive multiple patches because the signatures don't change.

    ps: double posting is forbidden on this forum, so is you want to quote somebody use ]quote[ tags, or mention them '@'
    Last edited by .::SCHiM::.; 11-23-2011 at 12:16 PM.

    I'm SCHiM

    Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.

    Polymorphic engine
    Interprocess callback class
    SIN
    Infinite-precision arithmetic
    Hooking dynamic linkage
    (sloppy)Kernel mode Disassembler!!!

    Semi debugger




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

    Hassan (11-23-2011),withexplosions (11-23-2011)

  8. #7
    Variant's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Posts
    37
    Reputation
    10
    Thanks
    7
    1. If you not are familiar with pointers in the C++ language i would recommend you go through some tutorials about them and play around with them(program with them) before you move on to step two.

    2**** you were saying you are using Cheat Engine as your memory scanner. I would recommend that you go to youtube and search for "Cheat Engine 5.5 Tutorial 1/9 - Introduction" and watch all of the 9 tutorials and especially the tutorials about pointers.

    3.Now it is time for you to find your pointer to the memory item you want to modify in memory

    4. When you have done this you should check out the ReadProcessMemory and WriteProcessMemory classes, since you wanted to this from an external application(A console application in your case).

    5.Put all of this to use:

    Some code:

    I take for granted that you know about functions and classes and the basic types available in c++.

    //To read and write process memory you will need a handle to the process you want to modify. To get this do the following.

    Code:
    #include <windows.h>//Needed for some classes and structures we will use
    
    HANDLE Process = 0;
    unsigned long ProcessId = 0;
    GetWindowThreadProcessId(FindWindowA(NULL,"Insert the window-name of the application you want a handle to"),&ProcessId);//It basically finds the window you looking for and from there on gets the Process-Id and stores that in the variable ProcessId.
    
    //Note i will not include error checking
    Process = OpenProcess(PROCESS_VM_OPERATION |PROCESS_VM_READ|PROCESS_VM_WRITE,true,ProcessId);//Basicly makes the HANDLE Process hold a reference to the process you want to access, with the privileges that we first applied.
    
    //I will let the pointer handling part for you
    //When you have the address you want to write to do the following
    
    unsigned long YourAdress = Youradress here;
    int YourValue = The value you want to write here;//You can replace this with a char or whatever you feel like
    WriteProcessMemory(Process,(LPVOID)YourAdress,&YourValue,(DWORD)sizeof(YourValue),0);//Writes the value YourValue to the adress YourAdress in the process memory of Process.

  9. The Following User Says Thank You to Variant For This Useful Post:

    withexplosions (11-23-2011)

Similar Threads

  1. Need help with updating my old Engine.Exe file
    By bobs__bees in forum Combat Arms Help
    Replies: 7
    Last Post: 10-04-2009, 12:59 PM
  2. Need help finding values
    By Noonga in forum Combat Arms Hacks & Cheats
    Replies: 9
    Last Post: 08-21-2009, 06:40 AM
  3. need help with memory addresses
    By falzarex in forum Blackshot Hacks & Cheats
    Replies: 0
    Last Post: 07-06-2009, 08:25 AM
  4. NEED HELP REFERENCED MEMORY
    By SnipedSteps in forum CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    Replies: 1
    Last Post: 03-07-2009, 04:54 AM
  5. Need help updating to 1.7...
    By Rico760 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 1
    Last Post: 08-16-2008, 01:42 AM