|
Games::Hack::Patch::x86_64 - How to patch code sequences on x86_64 |
Games::Hack::Patch::x86_64 - How to patch code sequences on x86_64
$bytes=GetNOP( $adr_start, $adr_end, @disass );
Not useful in itself; is used by Games::Hack::Live, and will possibly be
used by Games::Hack::Offline.
Addresses given to this library are always in integer/decimal, so that the
script can simply add and subtract. (gdb returns hex values.)
Given a start and an end address, and the disassembled instructions
(although normally only one) in the given range (via gdb), return a binary
string that, when written at the start address, causes this part of the
program to be ignored.
A bit better, because it's shorter, is to return a short jump, with the
correct offset.
Currently these are the only ones I've seen.
Simply jumping over such sequences leaves the old values on the coprocessor stack and can cause irregular behaviour, aborts, core dumps, and other crashes.
So some care must be taken for them.
Patches are welcome.
Ph. Marek <pmarek@cpan.org>
Copyright (C) 2007 by Ph. Marek; licensed under the GPLv3.
|
Games::Hack::Patch::x86_64 - How to patch code sequences on x86_64 |