本文整理汇总了Python中idc.PatchByte方法的典型用法代码示例。如果您正苦于以下问题:Python idc.PatchByte方法的具体用法?Python idc.PatchByte怎么用?Python idc.PatchByte使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类idc
的用法示例。
在下文中一共展示了idc.PatchByte方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: patch_word
# 需要导入模块: import idc [as 别名]
# 或者: from idc import PatchByte [as 别名]
def patch_word(ea, value, wordsize=WORD_SIZE):
"""Patch the word at the given address.
Words are patched using PatchByte(), PatchWord(), PatchDword(), or PatchQword(), as
appropriate.
"""
if wordsize == 1:
idc.PatchByte(ea, value)
elif wordsize == 2:
idc.PatchWord(ea, value)
elif wordsize == 4:
idc.PatchDword(ea, value)
elif wordsize == 8:
idc.PatchQword(ea, value)
else:
raise ValueError('Invalid argument: wordsize={}'.format(wordsize))
示例2: reset
# 需要导入模块: import idc [as 别名]
# 或者: from idc import PatchByte [as 别名]
def reset():
idc.MakeUnknown(idc.MinEA(), 0x1000, 0)
for i in range(0x1000):
idc.PatchByte(idc.MinEA() + i, 0)
示例3: patch
# 需要导入模块: import idc [as 别名]
# 或者: from idc import PatchByte [as 别名]
def patch(self, temp = None):
#用object.buffer中的数据给idb打补丁
if temp != None:
self.buffer = temp
for index,byte in enumerate(self.buffer):
idc.PatchByte(self.start + index, ord(byte))
示例4: xor
# 需要导入模块: import idc [as 别名]
# 或者: from idc import PatchByte [as 别名]
def xor(size, key, buff):
for index in range(0, size):
cur_addr = buff + index
temp = idc.Byte(cur_addr) ^ key
idc.PatchByte(cur_addr, temp)
示例5: memcpy
# 需要导入模块: import idc [as 别名]
# 或者: from idc import PatchByte [as 别名]
def memcpy(addr, data):
""" writes data to the virtual address in IDA's database """
for i in xrange(0, len(data)):
idc.PatchByte(addr + i, ord(data[i]))