#include <Patch.hpp>
Public Methods | |
| Patch () | |
| Create, but init nothing. | |
| Patch (unsigned char *data, unsigned short len, unsigned int addr) | |
| Create a patch with supplied data. More... | |
| Patch (unsigned char *data, unsigned short len, unsigned int addr, rwKernel *x) | |
| Create a patch with supplied data. More... | |
| Patch (string) | |
| Initialize the object from a string as created by dump (). More... | |
| Patch (string, rwKernel *) | |
| Initialize the object from a string as created by dump (). More... | |
| ~Patch () | |
| Foo. | |
| void | initFromString (string) |
| init object from a string. | |
| string | getPatchAsString () |
| Foo. | |
| bool | wasChanged () |
| tells you if the patch data was modified. More... | |
| bool | isLinked () |
| bool | isApplied () |
| bool | isFailed () |
| bool | isClean () |
| int | getState () |
| void | restore () |
| Restore patch data. More... | |
| bool | remove () |
| Remove applied Patch (Undo changes done to memory). | |
| bool | remove (rwKernel *) |
| Remove applied Patch (Undo changes done to memory). | |
| unsigned char * | getData () |
| Get a pointer to patch data. | |
| void | apply (rwKernel *) |
| Apply the patch to the kernel. More... | |
| void | apply () |
| Apply the patch to the kernel. More... | |
| void | link (Addr2AddrList *) |
| link the patch with the kernel. More... | |
| void | dump (string file) |
| Dump patch information into a file. More... | |
Friends | |
| istream & | operator>> (istream &, Patch &) |
| Foo. | |
| ostream & | operator<< (ostream &, Patch &) |
| Foo. | |
A Patch is a amount of data, which is to be written to a given address. Patching means modification of kernel memory. Therefore, the data, which will be overwritten, is saved (before writting). Additionally the status of the Patch is tracked. Thus, you are able to undo, reapply and debug patches. The states a Patch must be in are: CLEAN (the patch was never touched) LINKED (it was linked without an error) APPLIED (it was applied without an error) LFAILED (linking failed) AFAILED (applying failed)
|
||||||||||||||||||||||
|
Create a patch with supplied data.
|
|
|||||||||||||||||||||||||||||
|
Create a patch with supplied data. This constructor, compared with the above, will set a local reference to a rwKernel object.
|
|
|
Initialize the object from a string as created by dump ().
|
|
|||||||||||||||
|
Initialize the object from a string as created by dump ().
|
|
|
Apply the patch to the kernel. Use this apply method if you supplied a reference to a rwKernel object at creation time. |
|
|
Apply the patch to the kernel. Effectivly write the patch data to the supplied address. The method allows you to supply a a reference to a rwKernel object. you can supply on construction of the patch. However, there might be none at that time. |
|
|
Dump patch information into a file. This will produce human readable output. It can be used e.g. for restoring and debugging. Because the output is line based and can be used to initialize a Patch object you are effecitvely able to reproduce patching sessions.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
link the patch with the kernel. Replace all placeholders with real addresses. |
|
|
Restore patch data. Might be helpful if linking failed. |
|
|
tells you if the patch data was modified. (e.g. by linking).
|
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001