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

implement an ihex/srec BinaryView #5832

Closed
wants to merge 11 commits into from
Closed

implement an ihex/srec BinaryView #5832

wants to merge 11 commits into from

Conversation

rbran
Copy link
Contributor

@rbran rbran commented Aug 6, 2024

Currently binja crashes if trying to open a ihex/srec file "with options". Caused by a stack overflow with BNGetBinaryViewLoadSettingsForData calling itself:

[repeats...]
#124017 0x00007fffd26b03d6 in std::panicking::try::do_call<binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure_env#0}<view_bintxt::ihex::IHexViewConstructor>, *mut binaryninjacore_sys::BNSettings> (data=0x7fffffffc730) at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559
#124018 0x00007fffd26b354b in __rust_try () from /home/rbran/.binaryninja/plugins/libview_bintxt.so
#124019 0x00007fffd26add53 in std::panicking::try<*mut binaryninjacore_sys::BNSettings, binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure_env#0}<view_bintxt::ihex::IHexViewConstructor>> (f=...) at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523
#124020 0x00007fffd26a697a in std::panic::catch_unwind<binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure_env#0}<view_bintxt::ihex::IHexViewConstructor>, *mut binaryninjacore_sys::BNSettings> (f=...) at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149
#124021 0x00007fffd2690b12 in binaryninja::custombinaryview::register_view_type::cb_load_settings<view_bintxt::ihex::IHexViewConstructor> (ctxt=0x5555569d1590, data=0x7fffb2edb060)
    at /home/rbran/src/binaryninja-api/rust/src/ffi.rs:20
#124022 0x00007fffecaf3bd8 in ?? () from /opt/binaryninja/libbinaryninjacore.so.1
#124023 0x00007fffecae5bed in BNGetBinaryViewLoadSettingsForData () from /opt/binaryninja/libbinaryninjacore.so.1
#124024 0x00007fffd269f997 in binaryninja::custombinaryview::BinaryViewTypeBase::load_settings_for_data<view_bintxt::ihex::IHexViewConstructor> (self=0x5555569d1590, data=0x7fffffffc8b8)
    at /home/rbran/src/binaryninja-api/rust/src/custombinaryview.rs:174
#124025 0x00007fffd2690d81 in binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure#0}<view_bintxt::ihex::IHexViewConstructor> ()
    at /home/rbran/src/binaryninja-api/rust/src/custombinaryview.rs:113
#124026 0x00007fffd26b03d6 in std::panicking::try::do_call<binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure_env#0}<view_bintxt::ihex::IHexViewConstructor>, *mut binaryninjacore_sys::BNSettings> (data=0x7fffffffc990) at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:559
#124027 0x00007fffd26b354b in __rust_try () from /home/rbran/.binaryninja/plugins/libview_bintxt.so
#124028 0x00007fffd26add53 in std::panicking::try<*mut binaryninjacore_sys::BNSettings, binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure_env#0}<view_bintxt::ihex::IHexViewConstructor>> (f=...) at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panicking.rs:523
#124029 0x00007fffd26a697a in std::panic::catch_unwind<binaryninja::custombinaryview::register_view_type::cb_load_settings::{closure_env#0}<view_bintxt::ihex::IHexViewConstructor>, *mut binaryninjacore_sys::BNSettings> (f=...) at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library/std/src/panic.rs:149
#124030 0x00007fffd2690b12 in binaryninja::custombinaryview::register_view_type::cb_load_settings<view_bintxt::ihex::IHexViewConstructor> (ctxt=0x5555569d1590, data=0x7fffb2edb060)
    at /home/rbran/src/binaryninja-api/rust/src/ffi.rs:20
#124031 0x00007fffecaf3bd8 in ?? () from /opt/binaryninja/libbinaryninjacore.so.1
#124032 0x00007fffecae5bed in BNGetBinaryViewLoadSettingsForData () from /opt/binaryninja/libbinaryninjacore.so.1
#124033 0x00007ffff7be6e1c in ?? () from /opt/binaryninja/libbinaryninjaui.so.1
#124034 0x00007ffff79012bc in OptionsDialog::addSettingsViewForType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
   from /opt/binaryninja/libbinaryninjaui.so.1
#124035 0x00007ffff7905a5b in OptionsDialog::loadViews() () from /opt/binaryninja/libbinaryninjaui.so.1
#124036 0x00005555557562c7 in ?? ()
#124037 0x00005555557992ca in ?? ()
#124038 0x000055555572dd69 in ?? ()
#124039 0x00007fffea7c2148 in QObject::event(QEvent*) () from /opt/binaryninja/libQt6Core.so.6
#124040 0x00007ffff6d837e6 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /opt/binaryninja/libQt6Widgets.so.6
#124041 0x00007fffea76b34a in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /opt/binaryninja/libQt6Core.so.6
#124042 0x00007fffea76ed89 in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) () from /opt/binaryninja/libQt6Core.so.6
#124043 0x00007fffea91ba2e in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/binaryninja/libQt6Core.so.6
#124044 0x00007fffeb441121 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/binaryninja/libQt6Gui.so.6
#124045 0x00007fffea7777cb in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /opt/binaryninja/libQt6Core.so.6
#124046 0x00007fffea773a96 in QCoreApplication::exec() () from /opt/binaryninja/libQt6Core.so.6
#124047 0x000055555567a8ff in ?? ()
#124048 0x00007fffea034e08 in ?? () from /usr/lib/libc.so.6
#124049 0x00007fffea034ecc in __libc_start_main () from /usr/lib/libc.so.6
#124050 0x0000555555687655 in ?? ()

@rbran rbran force-pushed the ihex-view branch 2 times, most recently from 90bc357 to a0d7e6b Compare August 7, 2024 16:28
@rbran rbran changed the title implement an ihex BinaryView implement an ihex/srec BinaryView Aug 7, 2024
@plafosse plafosse requested a review from zznop August 26, 2024 18:04
@emesare emesare assigned emesare and unassigned zznop Aug 26, 2024
@emesare emesare requested review from emesare and removed request for zznop August 26, 2024 18:18
@rbran rbran marked this pull request as ready for review August 27, 2024 21:14
@emesare
Copy link
Member

emesare commented Aug 27, 2024

Merged with 7e1027d, added in >4.2.5990-dev

@emesare emesare closed this Aug 27, 2024
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.

3 participants