Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a few sleigh bugs #3

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Tim---
Copy link

@Tim--- Tim--- commented Dec 9, 2021

Hi !

First, let me thank you for the work you put into this ! I corrected a few details but overall it is very usable.
I'm not sure you have the courage to get into some sleigh code 3 years after, but I figured I would do a PR for passersby that want to use this extension ;).

This PR contains:

  • Keeping only one register (R1) for return values because Ghidra 10.1 does not load the extensions otherwise. There could be tuning for 8-bytes return values or floating point but for now I didn't stumble upon code using it.
  • Changing the PUSHM and POPM ugly code by another ugly code :). The advantage is that the generated pcode does not have branches, and the Stack analyzer is much happier.
  • Change "PC = xxx" to "call [xxx]" in some instructions. There are some left in the code but I'm not sure how it must be handled (syntactically).
  • Add a call convention when all parameters are sent in the stack.

There are two more changes that I would like to add but I'm not really sure:

  • Removing R15 from the default call convention because it is not used in my case. But I don't know if the "official" call convention uses it.
  • A lot of arithmetic operations in the .sinc set "mode_mi = 4". This has the effect of only doing a 1-byte operation. But on most cases I saw, the operation is done on the full 4-bytes registers. This breaks several things, including SP tracking. I did a dirty fix by replacing with "mode_mi = 2" but I don't know if it will break other things.

Regards.

@abbotg
Copy link

abbotg commented Jun 7, 2022

Hi all,

I want to thank the author @jamchamb for your tedious effort in creating this very useful processor module and @Tim--- for your patches.

@jamchamb , would you be willing to upload a license so your code can continue to be improved? PR #2 can be merged adding the Apache license if you so choose.

Thanks for considering this.

All the best,
Gunther

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants