本文整理汇总了Python中netzob.Common.Type.TypeConvertor.TypeConvertor.encodeGivenTypeToNetzobRaw方法的典型用法代码示例。如果您正苦于以下问题:Python TypeConvertor.encodeGivenTypeToNetzobRaw方法的具体用法?Python TypeConvertor.encodeGivenTypeToNetzobRaw怎么用?Python TypeConvertor.encodeGivenTypeToNetzobRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类netzob.Common.Type.TypeConvertor.TypeConvertor
的用法示例。
在下文中一共展示了TypeConvertor.encodeGivenTypeToNetzobRaw方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cellrenderer_project_props_changed_cb
# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import encodeGivenTypeToNetzobRaw [as 别名]
def cellrenderer_project_props_changed_cb(self, cellrenderer, path, new_value):
if isinstance(new_value, Gtk.TreeIter): # a combo box entry has been selected
liststore_possibleValues = cellrenderer.get_property('model')
value = liststore_possibleValues[new_value][0]
else: # the cellrenderer entry has changed
value = new_value
# Identify the property name/value and reconstruct the associated setter
name = self.view.projectPropertiesListstore[path][0]
for prop in self.getCurrentProject().getProperties():
if prop.getName() == name:
prop.setCurrentValue(TypeConvertor.encodeGivenTypeToNetzobRaw(value, prop.getFormat()))
break
self.view.updateProjectProperties()
示例2: force_execute_clicked_cb
# 需要导入模块: from netzob.Common.Type.TypeConvertor import TypeConvertor [as 别名]
# 或者: from netzob.Common.Type.TypeConvertor.TypeConvertor import encodeGivenTypeToNetzobRaw [as 别名]
def force_execute_clicked_cb(self, widget):
#extract choose value
delimiter = self._view.force_entry.get_text()
if delimiter is None or delimiter == "":
return
#update widget
self.flagStop = False
self._view.force_stop.set_sensitive(True)
self._view.force_cancel.set_sensitive(False)
self._view.force_execute.set_sensitive(False)
self._view.force_entry.set_sensitive(False)
self._view.force_radiobutton_hexa.set_sensitive(False)
self._view.force_radiobutton_string.set_sensitive(False)
if self._view.force_radiobutton_hexa.get_active():
delimiterType = Format.HEX
else:
delimiterType = Format.STRING
# encode the delimiter
encodedDelimiter = TypeConvertor.encodeGivenTypeToNetzobRaw(delimiter, delimiterType)
# create a job to execute the partitioning
Job(self.startForcePartitioning(encodedDelimiter, delimiterType))