We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
python3 dbg.py a -> works python3 dbg.py $(pwd)/a -> works python3 dbg.py ../a -> crashes python3 dbg.py pls/a -> crashes
python3 dbg.py a
python3 dbg.py $(pwd)/a
python3 dbg.py ../a
python3 dbg.py pls/a
dbg3.py:
#For Testing Binary Ninja Debugger import binaryninja from binaryninja.debugger import DebugAdapterType import getopt import sys from binaryninja.debugger import DebuggerController, DebuggerEventType # Parse command line arguments opts, args = getopt.getopt(sys.argv[1:], "") if len(args) < 1: print("Usage: python test_debugger.py <path_to_binary>") sys.exit(1) binary_path = args[0] bv = binaryninja.load(binary_path) # Ensure analysis is complete bv.update_analysis_and_wait() dc = DebuggerController(bv) dc.adapter_type = 'LLDB' # Define a callback to capture stdout messages def stdout_listener(event): #how do we get stderr?!? print("Event Type: %s" % event.type) if event.type in [DebuggerEventType.BackendMessageEventType]: print(f"Backend: {event.data.message_data.message}") elif event.type in [DebuggerEventType.LaunchFailureEventType]: print(f"ErrorMessage: {event.data.error_data.error}") elif event.type in [DebuggerEventType.StdoutMessageEventType, ]: print(f"Program Output: {event.data.message_data.message}") # Register the callback dc.register_event_callback(stdout_listener) dc.cmd_line = "hi testarg" # Launch the target if dc.launch_and_wait(): pass #print("Launch successful.") # Resume execution and wait for the target to stop stop_reason = dc.go_and_wait() # After the target has stopped print(f"Stop Reason: {dc.stop_reason_str}") else: print("Failed to launch the target.") import time dc.remove_event_callback(stdout_listener) time.sleep(1) #Cleanup del dc print("Done!") print("Sleeping") time.sleep(1) import sys sys.exit(0)
The text was updated successfully, but these errors were encountered:
negasora
No branches or pull requests
python3 dbg.py a
-> workspython3 dbg.py $(pwd)/a
-> workspython3 dbg.py ../a
-> crashespython3 dbg.py pls/a
-> crashesdbg3.py:
The text was updated successfully, but these errors were encountered: