Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: /home/xazax/Programming/DiffGen/xDiffGen/Core/RObin.class.php
- ===================================================================
- --- /home/xazax/Programming/DiffGen/xDiffGen/Core/RObin.class.php (revision 379)
- +++ /home/xazax/Programming/DiffGen/xDiffGen/Core/RObin.class.php (working copy)
- @@ -67,12 +67,15 @@
- $this->patch_callback = $callback;
- }
- - protected function Patch($offset, $value) {
- + protected function Patch($offset, $value, $doit=false) {
- if( !is_null($this->patch_callback) )
- call_user_func($this->patch_callback, $offset, $value);
- - $length = strlen($value);
- - for($i = 0; $i < $length; $i++)
- - $this->exe[$offset + $i] = $value[$i];
- + if ( $doit )
- + {
- + $length = strlen($value);
- + for($i = 0; $i < $length; $i++)
- + $this->exe[$offset + $i] = $value[$i];
- + }
- }
- // Locates the PE header
- @@ -236,10 +239,10 @@
- // replace(400, array(4 => "\x00", 2 => "\xAB"))
- // Replaces the byte at 404 (400 + 4) with a null (x00) byte;
- // Replaces the byte at 402 (400 + 2) with a xAB byte.
- - public function replace($offset, $replace)
- + public function replace($offset, $replace, $doit=false)
- {
- foreach ($replace as $pos => $value) {
- - $this->Patch($offset + $pos, $value);
- + $this->Patch($offset + $pos, $value, $doit);
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement