本文整理匯總了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]))