Ghidra笔记

API部分

#TODO write a description for this script
#@author CXA
#@category Memory
#@keybinding  ctrl alt shift n
#@menupath Tools.Packet.Nop
#@toolbar 
currentAddr=currentLocation.getByteAddress() #获取光标位置地址
nop = 0x90 
instruction = getInstructionAt(currentAddr) #返回位于指定地址的指令,如果不存在指令则返回null。
instructionSize = instruction.getDefaultFallThroughOffset()
removeInstructionAt(currentAddr)
for i in range(instructionSize):
   #addWrap通过向给定地址添加位移来创建一个新地址
   setByte(currentAddr.addWrap(i),nop)
posted @ 2022-07-25 19:46  公众号python学习开发  阅读(40)  评论(0编辑  收藏  举报