Esempio n. 1
0
 def deserialize(d):
     op = EditFunctionOperation(vma=d['vma'],
                                name=d['name'],
                                args=d['args'],
                                retval=d['retval'])
     Operation.deserialize(op, d)
     return op
Esempio n. 2
0
 def deserialize(d):
     op = CreateFunctionOperation(vma=d['vma'],
                                  name=d['name'],
                                  args=d['args'],
                                  retval=d['retval'],
                                  sym_type=d['sym_type'])
     Operation.deserialize(op, d)
     return op
Esempio n. 3
0
 def deserialize(d):
     op = LoadOperation()
     Operation.deserialize(op, d)
     return op
Esempio n. 4
0
 def deserialize(d):
     op = PassiveScanOperation()
     Operation.deserialize(op, d)
     return op
Esempio n. 5
0
 def deserialize(d):
     op = ActiveScanOperation(d['vma'])
     Operation.deserialize(op, d)
     return op
Esempio n. 6
0
 def deserialize(d):
     op = ModifySettingsOperation(d['options'])
     Operation.deserialize(op, d)
     return op
Esempio n. 7
0
 def deserialize(d):
     op = ModifyCStructOperation(d['name'], d['field_names'],
                                 d['field_types'])
     Operation.deserialize(op, d)
     return op
Esempio n. 8
0
 def deserialize(d):
     op = CreateCStructOperation(d['name'], d['is_packed'])
     Operation.deserialize(op, d)
     return op
Esempio n. 9
0
 def deserialize(d):
     op = DeleteCStructOperation(d['name'])
     Operation.deserialize(op, d)
     return op
Esempio n. 10
0
 def deserialize(d):
     op = CreateLabelOperation(d['vma'], d['label'])
     Operation.deserialize(op, d)
     return op
Esempio n. 11
0
 def deserialize(d):
     op = DefineDataOperation(d['type_kind'], d['type_name'], d['var_name'],
                              d['vma'])
     Operation.deserialize(op, d)
     return op
Esempio n. 12
0
 def deserialize(d):
     op = UndefineDataOperation(d['vma'])
     Operation.deserialize(op, d)
     return op
Esempio n. 13
0
 def deserialize(d):
     op = DeleteFunctionOperation(vma=d['vma'])
     Operation.deserialize(op, d)
     return op
Esempio n. 14
0
logger = logging.getLogger(__name__)

STRUCTURE_TYPES = [
    Function,
    Section,
    Symbol,
    Parcel,
    Branch,
    DataString,
    Comment,
    Label,
    CStruct,
    DefinedData,
]

OPERATIONS = {cls.__name__: cls for cls in Operation.__subclasses__()}


def DeserializeBinary(d):
    if d['kind'] == 'file':
        return BinaryFile.deserialize(d)
    elif d['kind'] == 'string':
        return BinaryString.deserialize(d)
    elif d['kind'] == 'file_model':
        return BinaryFileModel.deserialize(d)
    else:
        raise Exception("Unrecognized binary kind %s" % d['kind'])


def DeserializeOperation(d):
    cls = d['op_name']
Esempio n. 15
0
 def deserialize(d):
     op = DeleteCommentOperation(d['vma'])
     Operation.deserialize(op, d)
     return op
Esempio n. 16
0
 def deserialize(d):
     op = CreateCommentOperation(d['vma'], d['comment'])
     Operation.deserialize(op, d)
     return op