Skip to content

Instantly share code, notes, and snippets.

@caioluders
Created April 16, 2017 02:07
Show Gist options
  • Select an option

  • Save caioluders/89a7a95189a581e8d9bd557c1b9427d8 to your computer and use it in GitHub Desktop.

Select an option

Save caioluders/89a7a95189a581e8d9bd557c1b9427d8 to your computer and use it in GitHub Desktop.
from bitslicer import VirtualMemoryError, DebuggerError
import keycode, keymod
class Script(object):
def __init__(self):
self.currentLifeAddress = None # variable to store where the enemy's life address is
debug.registerHotkey(keycode.A, keymod.CONTROL, self.killShip) # Add a hotkey to call the self.killShip function
debug.addBreakpoint(vm.base() + 0xDC642, self.shipDamaged) # Make a breakpoint every time that mov [rdi+0x70], eax is reached and call self.shipDamaged , vm.base() is the pagination of the memory , this changes every time it loads
def killShip(self,hotkeyID) :
if self.currentLifeAddress is not None:
vm.writeInt32(self.currentLifeAddress,0) # write 0 at the enemy's life
def shipDamaged(self, instructionAddress, registers):
self.currentLifeAddress = registers['rdi']+0x70 # gets the address of enemy's life
debug.log(registers['rdi']) # debug shit
debug.resume()
def finish(self):
debug.log('Cleaning up..')
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment