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 support for 17.0.0 (64-bit only) #46

Merged
merged 7 commits into from
Oct 15, 2023

Conversation

TSRBerry
Copy link
Contributor

This PR adds support for read-only relocations which were added in 17.0.0 binaries.

These changes were ported from SciresM's changes to nxo64.py/ipcserver.py here, which is why I added him as a co-author to these commits.

The nxo64 changes are already done, but I need to figure out how to port the ipcserver changes, since they involve reading values from the IPCEmulator and I'm currently trying to understand how this could be done here. I currently think the emulator is set up in one function and only used there, which differs from the way ipcserver seems to handle it.

I'll mark this PR as draft until I either figure this out or somebody else figures it out before me and wants to add the solution here.


Aside from these changes I made a minor adjustment to the way plt entries are handled, so no exceptions can be thrown there and the user instead just receives a note about missing support for CFI-enabled binaries.

This closes #41, but doesn't solve the underlying issue that we currently can't find the plt for the binaries mentioned above.

@Adubbz
Copy link
Owner

Adubbz commented Oct 13, 2023

I would actually support IPCEmulator being removed (unless someone actually does rely upon it). I don't think it has been completely functional since much earlier versions of HOS,and the value added was fairly limited to begin with

@TSRBerry
Copy link
Contributor Author

Maybe I should try making nxo-utils/ipcserver.py compatible with Ghidra instead if you want to replace IPCEmulator entirely.

I have the ipcserver changes almost done already, but I'm currently running into a few bugs that I need to fix before I can push that.

I should check if we are able to make analyzers in python as well or if these scripts need to be ported to Java.

@Adubbz
Copy link
Owner

Adubbz commented Oct 14, 2023

Where possible porting to Java remains ideal in my mind, given Ghidra continues to only package outdated Python 2/Jython support

@TSRBerry TSRBerry marked this pull request as ready for review October 14, 2023 16:31
@TSRBerry
Copy link
Contributor Author

I tested these changes with ghidra version 10.4 and the ldn sysmodule for 16.1.0 and 17.0.0 and compared the results against ipcserver.py.

I'd say this is working correctly now and is ready for review!

The build.gradle changes made working on this a lot easier since I could just launch ghidra from within the project and I didn't have to restart it twice to install a new extension as I needed to do before.

@TSRBerry TSRBerry changed the title [WIP] Add support for 17.0.0 (64-bit only) Add support for 17.0.0 (64-bit only) Oct 14, 2023
@TSRBerry TSRBerry marked this pull request as draft October 14, 2023 17:11
@TSRBerry TSRBerry marked this pull request as ready for review October 14, 2023 17:17
@Adubbz Adubbz merged commit 3d849df into Adubbz:master Oct 15, 2023
1 check passed
@TSRBerry TSRBerry deleted the feature/1700_support branch October 15, 2023 14:39
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.

NSO Loader: Index 0 out of bounds for length 0
2 participants