Exemplo 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
Exemplo 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
Exemplo n.º 3
0
 def deserialize(d):
     op = LoadOperation()
     Operation.deserialize(op, d)
     return op
Exemplo n.º 4
0
 def deserialize(d):
     op = PassiveScanOperation()
     Operation.deserialize(op, d)
     return op
Exemplo n.º 5
0
 def deserialize(d):
     op = ActiveScanOperation(d['vma'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 6
0
 def deserialize(d):
     op = ModifySettingsOperation(d['options'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 7
0
 def deserialize(d):
     op = ModifyCStructOperation(d['name'], d['field_names'],
                                 d['field_types'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 8
0
 def deserialize(d):
     op = CreateCStructOperation(d['name'], d['is_packed'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 9
0
 def deserialize(d):
     op = DeleteCStructOperation(d['name'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 10
0
 def deserialize(d):
     op = CreateLabelOperation(d['vma'], d['label'])
     Operation.deserialize(op, d)
     return op
Exemplo 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
Exemplo n.º 12
0
 def deserialize(d):
     op = UndefineDataOperation(d['vma'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 13
0
 def deserialize(d):
     op = DeleteFunctionOperation(vma=d['vma'])
     Operation.deserialize(op, d)
     return op
Exemplo 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']
Exemplo n.º 15
0
 def deserialize(d):
     op = DeleteCommentOperation(d['vma'])
     Operation.deserialize(op, d)
     return op
Exemplo n.º 16
0
 def deserialize(d):
     op = CreateCommentOperation(d['vma'], d['comment'])
     Operation.deserialize(op, d)
     return op