Ejemplo n.º 1
0
 def apply(self):
     if self.applied:
         return self
     log.debug("Applying detour at 0x%08x (%s)"%(self.address, self.config))
     try:
         self.applied = True
         DetourManager[self.address] = self
         _detour.createDetour(self.address, self.config.overwrite_len, self.config.bytes_to_pop, self.type)
         _detour.setDetourSettings(self.address, (self.config.bytes_to_pop, self.config.return_to_original, 0))
     except _detour.DetourAccessViolationException:
         self.applied=False
         del DetourManager[self.address]
         raise _detour.DetourAccessViolationException("Invalid detour address 0x%08x"%(self.address))
     return self
Ejemplo n.º 2
0
 def setConfiguration(self, settingsDict):
     n = ["bytesToPop", "executeOriginal", "int3_after_call"]
     p = []
     for x in n:
         p.append(settingsDict[x])
     _detour.setDetourSettings(self.address, p)