Currently such scenario is not supported, so I’d suggest making a script for it. Here’s a snippet I used in the past (will need to be adapted for the current API)
# helper function to iterate the instructions in an address range
def Instructions(start, end):
"""
Get a list of instructions in a given range
@return: ea of each instruction in the range [start..end)
"""
fii = ida_funcs.func_item_iterator_t()
ok = fii.set_range(start, end)
while ok:
yield fii.current()
ok = fii.next_code()
s = SelStart()
e = SelEnd()
if s == BADADDR or e==BADADDR:
Warning("select an address range before running the script!")
else:
rn = AskStr("r14", "Enter the register to track")
if rn != None:
reg = idaapi.str2reg(rn)
rval = AskLong(0, "Enter register's value")
for i in Instructions(s, e):
ins = DecodeInstruction(i)
if ins != None:
if ins.itype==idaapi.PPC_addi and ins[1].reg == reg:
# addi rx, reg, #imm
print "%08X: converting addi" % ins.ea
OpOffEx(ins.ea, 2, REF_OFF32|REFINFO_NOBASE, BADADDR, rval, 0)
elif ins[1].type==o_displ and ins[1].reg==reg:
#lwz rx, delta(reg)
print "%08X: converting displ" %ins.ea
OpOffEx(ins.ea, 1, REF_OFF32|REFINFO_NOBASE, BADADDR, rval, 0)
Please note that if your target is PPC, the fixed r13 value (SDA) can be set in the processor-specific options.