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

Add specific register CTBP handling #20

Open
wosk opened this issue Aug 12, 2022 · 2 comments
Open

Add specific register CTBP handling #20

wosk opened this issue Aug 12, 2022 · 2 comments

Comments

@wosk
Copy link

wosk commented Aug 12, 2022

image
Is it possible to improve callt parsing according to spec?
image
For support this feature, user can set CTBP value in some Proccessor specific dialog in Ghidra.
Value can be found in assembly:
image
If CTBP value is set, then Ghidra can set labels to subroutines instead of imediate value in callt.

Also there is a Global Pointer (GP / r4) register. But I don't know, how it can be useful for analyzing.

Thank you for you work!

Firmware dump for test you can find here https://www.mynissanleaf.com/viewtopic.php?t=32034

@esaulenka
Copy link
Owner

esaulenka commented Aug 15, 2022

Hello Nikita,

We discussed CALLT issue several year ago ( NationalSecurityAgency/ghidra#1430 (comment) ). But unfortunately, good solution have not found.

CALLT is not a general call, it much more close to JUMP instruction - for example, jmp LP in a CALLT subroutine means 'return from caller function, not from this one'.
But if you interpret CALLT as JUMP, you face with another issue: Ghidra cannot include same piece of code into several functions at the same time.

I need an advice from Ghidra team to implement it. I will try to make detailed issue, maybe they can help us. In any case, thanks for sharing binaries - samples that I have tested, didn't use this weird CALLT.
BTW, did you found memory map for those MCUs ?

@wosk
Copy link
Author

wosk commented Aug 18, 2022

Yep, this one fw executed on µPD70F3423. Specification here http://www.datasheet26.com/circuit/696926/UPD70F3423-%D0%B4%D0%B0%D1%82%D0%B0%D1%88%D0%B8%D1%82.html
I use below memory map, with alias for RAM and Peripheral IO regions.
image

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

No branches or pull requests

2 participants