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

Crash when trying to debug binary using the async API incorrectly #672

Open
negasora opened this issue Dec 13, 2024 · 4 comments
Open

Crash when trying to debug binary using the async API incorrectly #672

negasora opened this issue Dec 13, 2024 · 4 comments
Labels

Comments

@negasora
Copy link
Member

Binary Ninja Ultimate 4.3.6564-dev

from binaryninja import load
from binaryninja.debugger import DebuggerController

with load("/usr/bin/ls") as bv:
    dc = DebuggerController(bv)

    if dc.launch():
        stop_reason = dc.go_and_wait()
        print(f"Stop Reason: {dc.stop_reason_str}")
    else:
        print("Failed to launch the target.")
@negasora negasora added the crash label Dec 13, 2024
@xusheng6
Copy link
Member

You should use launch_and_wait() to launch the target. launch only requests the operation and does not actually perform it

@negasora
Copy link
Member Author

It sounds like there are two bugs:

  1. Document async/sync API and how to use them #675 which will fix the documentation that shows this pattern
  2. This bug, where the user should be told the target isn't launched yet, instead of crashing with no feedback

@xusheng6
Copy link
Member

Re-opening this -- as mentioned above, even if the user is using the API in a wrong way, we should not crash

@xusheng6 xusheng6 reopened this Dec 17, 2024
@xusheng6 xusheng6 changed the title Crash when trying to debug binary Crash when trying to debug binary using the async API incorrectly Dec 17, 2024
@xusheng6
Copy link
Member

This is a UAF on the debugger controller and the objects owned by it. I am not sure there is actually a way to fix it.

Hopefully #676 and #675 will make this less likely to happen

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

No branches or pull requests

2 participants