Skip to content

Instantly share code, notes, and snippets.

@d0now
Created June 11, 2025 12:27
Show Gist options
  • Save d0now/f62aa20d3f8a9bf00866498324b12d13 to your computer and use it in GitHub Desktop.
Save d0now/f62aa20d3f8a9bf00866498324b12d13 to your computer and use it in GitHub Desktop.
Binary Ninja TriCore fastcall inline automation
for func in bv.functions:
fastcall = False
for block in func:
for toks, _ in block:
if str(toks[0]) == 'fret':
fastcall = True
if fastcall:
print(func.name)
regs = func.clobbered_regs.regs
if 'a11' in regs:
regs.remove('a11')
func.return_type = Type.int(4)
func.return_regs = regs
func.clobbered_regs = regs
func.is_pure = False
func.inline_during_analysis = True
bv.update_analysis_and_wait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment