示例#1
0
    def setEditMode(self, mode, target=None):
        if mode not in ["binary", "process"]:
            self.error("Invalid edit mode!")
            return False

        self.editMode = mode
        
        if self.editMode == "process":
            if not userHasRoot():
                self.error("Needs to be root!")
                return False

        if target:
            self.target = target
        return True
示例#2
0
    def openEditor(self):
        if self.editMode == "process":
            if not userHasRoot():
                self.error("Needs to be root!")
                return False

            self.editor = GDBWrapper(self.target)
            self._isFileEditor = False
        elif self.editMode == "binary":
            self.editor = BinaryEditor(self.target)
            self._isFileEditor = True
        else:
            self.error("Edit mode not set correctly!")
            return False

        self.editor.open()
        return self.editor is not None