Created
June 11, 2025 12:27
-
-
Save d0now/f62aa20d3f8a9bf00866498324b12d13 to your computer and use it in GitHub Desktop.
Binary Ninja TriCore fastcall inline automation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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