-
Notifications
You must be signed in to change notification settings - Fork 9
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 headless Ghidra tests to CI #9
Conversation
oofers bad rebase |
316568c
to
d39862a
Compare
d39862a
to
316568c
Compare
316568c
to
45fb901
Compare
@Flipout50 I looked at the failure log for the CI, are you sure GhidraServer is actually running? My hunch is that its crashing on run and not actually starting up. The way I would test this is the get the proc after using |
@Flipout50 don't forget to rebase! |
7f5b29b
to
4fa0ce4
Compare
Ayo @Flipout50, the CI ran for 5 hours on commit a7797ce until I canceled it. Maybe you forgot to shutdown the Ghidra side server in the code? |
libbs/decompiler_stubs/ghidra_libbs/ghidra_libbs_mainthread_server.py
Outdated
Show resolved
Hide resolved
@@ -46,6 +51,30 @@ def __init__(self, loop_on_plugin=True, **kwargs): | |||
|
|||
self.loop_on_plugin = loop_on_plugin | |||
|
|||
# Startup headless ghidra binary | |||
if self.headless: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move any code you can into _init_headless_componenets
b60752a
to
24b24b3
Compare
@Flipout50 reminder: give an update when you can here and mark it ready for review when it's ready :). |
@mahaloz I hit a big snag. I was planning to just add a simple test to rename a function to get this branch merged. Turns out thats broken too. There is a NoneType somehow making its way into ghidraBridge and I havn't been able to figure out how its getting there. For some reason _set_function_header is returning None even though all that is in the function is return False??? I found out through testing that the _set_function_header that I was looking at isn't even getting called so im trying to hunt down where the code is going. It ends up trying to call getService() from ghidra bridge on NoneType which causes the transaction to fail. |
UPDATE: I finally found where the bug is. Its when the function header gets changed, libbs calls |
So the tool is returning None? That’s not good. We need a way to get the Tool in this headless mode
…On Wed, Jan 24, 2024 at 4:08 PM, Flipout50 ***@***.***(mailto:On Wed, Jan 24, 2024 at 4:08 PM, Flipout50 <<a href=)> wrote:
UPDATE: I finally found where the bug is. Its when the function header gets changed, libbs calls typestr_to_gtype on the string "char". In this function on line 685 in interface.py, self.ghidra.getState().getTool() returns None, and we are attempting to call getService(dtm_service_class) on this NoneType
—
Reply to this email directly, [view it on GitHub](#9 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFCW3IEBRCVPJF4VEMEVJADYQG5A5AVCNFSM6AAAAABAAEPBXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBZGIZDOMJQGE).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
NationalSecurityAgency/ghidra#934 Ill try some solutions here. Apparently you can't get the tool from headless |
I see. All uses of getTool will need to be updated
…On Wed, Jan 24, 2024 at 4:56 PM, Flipout50 ***@***.***(mailto:On Wed, Jan 24, 2024 at 4:56 PM, Flipout50 <<a href=)> wrote:
[NationalSecurityAgency/ghidra#934](NationalSecurityAgency/ghidra#934) Ill try some solutions here. Apparently you can't get the tool from headless
—
Reply to this email directly, [view it on GitHub](#9 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFCW3IBHZDIGKX7M7ELMEFDYQHCXVAVCNFSM6AAAAABAAEPBXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBZGI3DENBXGY).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
888e0a2
to
d740eb9
Compare
There is only one other use in interface.py but it occurs in a gui function. I believe this doesn't get called in headless mode, so we can leave it alone right? |
You are right! Sounds good.
…On Thu, Jan 25, 2024 at 3:53 PM, Flipout50 ***@***.***(mailto:On Thu, Jan 25, 2024 at 3:53 PM, Flipout50 <<a href=)> wrote:
> I see. All uses of getTool will need to be updated
> […](#)
> On Wed, Jan 24, 2024 at 4:56 PM, Flipout50 @.(mailto:On Wed, Jan 24, 2024 at 4:56 PM, Flipout50 <[wrote: []())[NationalSecurityAgency/ghidra#934](NationalSecurityAgency/ghidra#934)]([NationalSecurityAgency/ghidra#934](https://github.com/NationalSecurityAgency/ghidra/issues/934)) Ill try some solutions here. Apparently you can't get the tool from headless — Reply to this email directly, [view it on GitHub]([#9 (comment)](#9 (comment))), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFCW3IBHZDIGKX7M7ELMEFDYQHCXVAVCNFSM6AAAAABAAEPBXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBZGI3DENBXGY). You are receiving this because you were mentioned.Message ID: @.>
There is only one other use in interface.py but it occurs in a gui function. I believe this doesn't get called in headless mode, so we can leave it alone right?
—
Reply to this email directly, [view it on GitHub](#9 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AFCW3IFWT4PJ424HNOR3IKTYQMEAPAVCNFSM6AAAAABAAEPBXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJRGI4DIMRSGM).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
No description provided.