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

Ghidra 11.1 breaks BSIM #95

Closed
clearbluejar opened this issue Jun 11, 2024 · 1 comment · Fixed by #96
Closed

Ghidra 11.1 breaks BSIM #95

clearbluejar opened this issue Jun 11, 2024 · 1 comment · Fixed by #96

Comments

@clearbluejar
Copy link
Owner

In Ghidra 11.1, a new check was introduced to VTsession create. This would check to see if the destination program was RW.

Exception has occurred: ghidra.util.ReadOnlyException
ghidra.util.ReadOnlyException: VT Session destination program is read-only which prevents its use
Exception: Java Exception

The above exception was the direct cause of the following exception:

  File "/workspaces/ghidriff/ghidriff/bsim.py", line 82, in correlate_bsim
    session: VTSession = VTSessionDB.createVTSession(bsim_factory.name, p1, p2, session_ref)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ghidriff/ghidriff/version_tracking_diff.py", line 138, in find_matches
    correlate_bsim(self, matches, p1, p2, p1_matches, p2_matches, monitor, self.logger,
  File "/workspaces/ghidriff/ghidriff/ghidra_diff_engine.py", line 1267, in diff_bins
    unmatched, matched, skip_types = self.find_matches(p1, p2)
                                     ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ghidriff/ghidriff/__main__.py", line 88, in main
    pdiff = d.diff_bins(diff[0], diff[1])
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/workspaces/ghidriff/ghidriff/__main__.py", line 104, in <module>
    main()
ghidra.util.ghidra.util.ReadOnlyException: ghidra.util.ReadOnlyException: VT Session destination program is read-only which prevents its use

Here: https://github.com/NationalSecurityAgency/ghidra/blob/ebfd108ddecfd0964ffa51f1cc8fcc3c70f3e7df/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/api/db/VTSessionDB.java#L368-L374

@clearbluejar
Copy link
Owner Author

We can provide a workaround by manipulating a private variable in Java with reflection.

https://stackoverflow.com/questions/30107772/changing-of-private-variables

@clearbluejar clearbluejar linked a pull request Jun 11, 2024 that will close this issue
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 a pull request may close this issue.

1 participant