![]() |
|
|
|
#1
|
|||
|
|||
|
If you want a c or asm skelleton for a trainer, just pm me.
Trainers can be very simple, something like a timer (SetTimer) that checks your hotkey keystate (GetAsyncKeyState), and then writes to a memory address (WriteProcessMemory). But before you can WriteProcessMemory you need to find the games Handle, using FindWindow, then GetWindowThreadProcessId, which lets you OpenProcess. Also, if you don't want to do any codeing, You can download "Trainer-Maker-Kit" from here http://membres.lycos.fr/tsearch/. (authors website). It simplifys it all, but can be restrictive. |
|
#2
|
|||
|
|||
|
Quote:
In that case you can use DirectInput. Another thing you should pay attention to is the problem of memory allocation. Mondern games are very complex so they use dynamically allocated memory (often called DMA - Dynamic Memory Allocation if i'm not mistaken) to store certain stuff. In that case it doesn't help to you look for a particular value in memory and to write to it directly. Instead you will have to use one of the following techniques:
|
|
#3
|
|||
|
|||
|
Just a little correction about DMA.
DMA stands for Direct Memory Access, and is used when performing IO to a hard disk or a CD-ROM, for example. Without DMA, in PIO mode, the CPU is used a lot because it's reading the bytes from the IO ports of the device and writing them to the memory locations, or vice-versa. With DMA, or Ultra-DMA, data is read from the device and placed in memory directly (by the DMA controller), while the CPU is doing something else, or is idle. DMA can also be used in a sound card for example. In that case, the sound card goes directly to memory to read the sound samples, the CPU doesn't have to be in the middle instead of doing something else. The dynamically allocated memory you're talking about is a simple malloc(), or a VirtualAlloc call, which reserve a memory region in the heap and return a pointer to it. Also, regarding item 2, "base address", I'd say that probably it's likely that a single pointer won't suffice. Due to the chaining of objects created at runtime, you may have a static location which points to a structure that can be in different locations. That structure, in turn, will contain one pointer for another structrure, and so on, until another structure some levels deeper will contain the actual lives and energy counters. That said, this 2nd approach will also hardly work on a newer version. Both the initial base address, and the structure's offsets may change between versions. |
|
#4
|
|||
|
|||
|
Quote:
As for.. Quote:
In the days of Yore.. you had to patch track loaders because each level used different code or was loaded to a different address. And ofcourse you had no breakpoint on write access capability to find that all important SUB #1 instruction :-) But then.. it made it more fun to do.. |
|
#5
|
|||||
|
|||||
|
Quote:
Quote:
Quote:
However it should rarely happen that structure member offsets change. This can only happen if the programmers add members before the member you want to hack or if they modify the structure's member alignment. And just to make it clear: With porting to newer versions I didn't mean to port cheats from 1.0 -> 2.0 (as this rarely works) or sth like this but from 1.0 -> 1.1. Quote:
Quote:
|
|
#6
|
|||
|
|||
|
I thought you were making a confusion, but you obviously know what you're talking about
|
|
#7
|
|||
|
|||
|
Try this example in asm.
|
|
#8
|
|||
|
|||
|
I do remember that it was very easy using Game Tools 3.xx for MSDOS times.
In Windows times ReadProcessMeory, WriteProcessMemory... Cheers. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|