From 08e6e4d13cc0ada851ed79992ab308cb83238c70 Mon Sep 17 00:00:00 2001 From: xpahos Date: Sun, 9 Apr 2017 20:13:31 +0300 Subject: [PATCH] Workaround for Qt5.8 WebEngine (#92) --- src/CMakeLists.txt | 47 +- src/webengine/widgets/dashboard.ui | 1197 +++++++ .../widgets/memwidget/memorywidget.ui | 3055 +++++++++++++++++ src/widgets/memwidget/memorywidget.cpp | 26 +- src/widgets/memwidget/memorywidget.h | 12 +- 5 files changed, 4329 insertions(+), 8 deletions(-) create mode 100644 src/webengine/widgets/dashboard.ui create mode 100644 src/webengine/widgets/memwidget/memorywidget.ui diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0e0369ee..cae6ba9c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,10 +9,20 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTOUIC ON) set(CMAKE_AUTORCC ON) -find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebKit WebKitWidgets) +set(QT_USE_MODULES Core Widgets Gui) +find_package(Qt5 REQUIRED COMPONENTS ${QT_USE_MODULES}) +if (Qt5_VERSION_MINOR GREATER 7) + list(APPEND QT_USE_MODULES WebEngine WebEngineWidgets) + message("Using QT5 WebEngine instead WebKit") + add_definitions(-DUSE_WEBENGINE) + find_package(Qt5 REQUIRED COMPONENTS ${QT_USE_MODULES}) +else (Qt5_VERSION_MINOR GREATER 7) + set(CMAKE_AUTOUIC ON) + list(APPEND QT_USE_MODULES WebKit WebKitWidgets) + find_package(Qt5 REQUIRED COMPONENTS ${QT_USE_MODULES}) +endif(Qt5_VERSION_MINOR GREATER 7) if(WIN32) # use radare2 libraries from submodule on windows @@ -120,13 +130,40 @@ set(UI_FILES widgets/commentswidget.ui widgets/stringswidget.ui widgets/flagswidget.ui - widgets/memwidget/memorywidget.ui widgets/sdbdock.ui dialogs/commentsdialog.ui widgets/sidebar.ui - widgets/dashboard.ui dialogs/xrefsdialog.ui) +if (Qt5_VERSION_MINOR GREATER 7) + list(APPEND UI_FILES webengine/widgets/memwidget/memorywidget.ui + webengine/widgets/dashboard.ui) + + set(UI_FILES_OUT "") + + # Workaround for Qt 5.8 + # AutoUIC looking for ui files in the same directory as source code + # files. This code directly calls uic for headers generation. + foreach(it ${UI_FILES}) + message("Preprocessing uic: ${it}") + get_filename_component(outfile ${it} NAME_WE) + get_filename_component(infile ${it} ABSOLUTE) + set(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.h) + add_custom_command(OUTPUT ${outfile} + COMMAND ${Qt5Widgets_UIC_EXECUTABLE} + ARGS ${ui_options} -o ${outfile} ${infile} + MAIN_DEPENDENCY ${infile} VERBATIM) + list(APPEND UI_FILES_OUT ${outfile}) + endforeach() + + set(UI_FILES ${UI_FILES_OUT}) + +else (Qt5_VERSION_MINOR GREATER 7) + list(APPEND UI_FILES widgets/memwidget/memorywidget.ui + widgets/dashboard.ui) +endif (Qt5_VERSION_MINOR GREATER 7) + + set(QRC_FILES resources.qrc) @@ -137,5 +174,5 @@ add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"") add_executable(iaito ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES}) -qt5_use_modules(iaito Core Widgets Gui WebKit WebKitWidgets) +qt5_use_modules(iaito ${QT_USE_MODULES}) target_link_libraries(iaito ${RADARE2_LIBRARIES}) diff --git a/src/webengine/widgets/dashboard.ui b/src/webengine/widgets/dashboard.ui new file mode 100644 index 00000000..52abebc4 --- /dev/null +++ b/src/webengine/widgets/dashboard.ui @@ -0,0 +1,1197 @@ + + + Dashboard + + + + 0 + 0 + 1055 + 999 + + + + background-color: rgb(255, 255, 255); + + + Dashboard + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + true + + + + + 0 + 0 + 1055 + 977 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 39 + 20 + + + + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + + + + 19 + 75 + true + + + + OVERVIEW + + + + + + + Qt::Horizontal + + + + + + + + 17 + 75 + true + + + + Info + + + + + + + 10 + + + 0 + + + 0 + + + + + QFormLayout::ExpandingFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 3 + + + + + + 75 + true + + + + File: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Format: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Mode: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Size: + + + + + + + + 75 + true + + + + Type: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Class: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Language: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Bits: + + + + + + + -- + + + false + + + true + + + + + + + -- + + + false + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 3 + + + 0 + + + + + + 75 + true + + + + FD: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Base addr: + + + + + + + + 75 + true + + + + Virtual addr: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Canary: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Crypto: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + NX bit: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + PIC: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Static: + + + + + + + -- + + + false + + + true + + + + + + + -- + + + false + + + true + + + + + + + + + QFormLayout::ExpandingFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 3 + + + + + + 75 + true + + + + Architecture: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Machine: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + OS: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Subsystem: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Stripped: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Relocs: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Endianness: + + + + + + + -- + + + false + + + true + + + + + + + + 75 + true + + + + Compiled: + + + + + + + -- + + + false + + + true + + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Fixed + + + + 20 + 5 + + + + + + + + Qt::Horizontal + + + + + + + 0 + + + + + + 17 + 75 + true + + + + Hashes + + + + + + + + 17 + 75 + true + + + + Libraries + + + + + + + + + 0 + + + + + QFormLayout::ExpandingFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 3 + + + + + + 75 + true + + + + MD5: + + + + + + + + + + false + + + true + + + + + + + + 75 + true + + + + SHA1: + + + + + + + + + + false + + + true + + + + + + + + 0 + 0 + + + + + 75 + true + + + + Entropy: + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + + + + + 17 + 75 + true + + + + Statistics + + + + + + + QTabBar +{ + qproperty-drawBase: 0; +} + +QTabWidget::pane { /* The tab widget frame */ + border-top: 0px; +} + +QTabBar::tab { + background: rgb(240, 240, 240); + border: 0px solid #2180a9; + border-bottom-color: #2180a9; + border-top-left-radius: 0px; + border-top-right-radius: 0px; + min-width: 8ex; + padding: 5px; + margin-bottom: 3px; + margin-top: 3px; +} + +QTabBar::tab:selected { + background: #2180a9; + color: #FFFFFF; +} + +QTabBar::tab:hover { + background: #2180a9; /* #3C879E; */ + color: #FFFFFF; +} + + + QTabWidget::North + + + 0 + + + + Line + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 950 + 400 + + + + + 950 + 400 + + + + + qrc:/html/stats.html + + + + + + + + + Polar + + + + 0 + + + 0 + + + 20 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 950 + 400 + + + + + 950 + 400 + + + + + qrc:/html/fcn_stats.html + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + verticalSpacer_3 + polarWebView + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+
+
+ + +
diff --git a/src/webengine/widgets/memwidget/memorywidget.ui b/src/webengine/widgets/memwidget/memorywidget.ui new file mode 100644 index 00000000..ec844545 --- /dev/null +++ b/src/webengine/widgets/memwidget/memorywidget.ui @@ -0,0 +1,3055 @@ + + + MemoryWidget + + + + 0 + 0 + 950 + 767 + + + + + 0 + 0 + + + + Memory + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 0 + + + + background-color: #333; + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + + 5 + + + 0 + + + 10 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + Disassembly + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:checked { + border: 5px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/disas_light.png + :/new/prefix1/img/icons/disas_white.png:/new/prefix1/img/icons/disas_light.png + + + true + + + true + + + false + + + buttonGroup + + + + + + + + 0 + 0 + + + + Graph + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:checked { + border: 5px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/graph_light.png + :/new/prefix1/img/icons/graph_white.png:/new/prefix1/img/icons/graph_light.png + + + true + + + false + + + buttonGroup + + + + + + + + 0 + 0 + + + + Hexdump + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:checked { + border: 5px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/hexdump_light.png + :/new/prefix1/img/icons/hexdump_white.png:/new/prefix1/img/icons/hexdump_light.png + + + true + + + false + + + buttonGroup + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Show/Hide preview panel + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-left: 10px solid #444; + border-right: 10px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:pressed { + border: 5px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolButton:checkeds { + border: 5px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/eye.png + :/new/prefix1/img/icons/eye_white.png:/new/prefix1/img/icons/eye.png + + + true + + + true + + + + + + + Show/Hide memory sidebar + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-left: 10px solid #444; + border-right: 10px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:pressed { + border: 5px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolButton:checkeds { + border: 5px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/right.png:/new/prefix1/img/icons/right.png + + + true + + + + + + + Qt::Horizontal + + + + + + + Settings + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:pressed { + border: 5px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/cog_light.png:/new/prefix1/img/icons/cog_light.png + + + QToolButton::InstantPopup + + + true + + + + + + + + + + true + + + QTabWidget::pane { /* The tab widget frame */ +border-top: 0px; +} + + + QTabWidget::South + + + 0 + + + false + + + + Disassembly + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + QSplitter::handle { + height: 2px; + background-color: rgb(255, 255, 255); + image: url(:/new/prefix1/img/icons/tabs.png); +} + + + Qt::Horizontal + + + 2 + + + + + 0 + 0 + + + + + 0 + 0 + + + + + Anonymous Pro + 13 + + + + + + + QFrame::NoFrame + + + 0 + + + Qt::ScrollBarAlwaysOff + + + true + + + QPlainTextEdit::NoWrap + + + true + + + + + + false + + + 80 + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + background-color: rgb(255, 255, 255); + + + QFrame::NoFrame + + + QFrame::Plain + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 55 + 20 + + + + + + + + QToolButton { /* all types of tool button */ + border: 3px solid rgb(255, 255, 255); + border-left: 10px solid rgb(255, 255, 255); + border-right: 10px solid rgb(255, 255, 255); + border-radius: 0px; + background-color: rgb(255, 255, 255); + color: rgb(191, 191, 191); + } + +QToolButton:hover { + border: 3px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; + color: rgb(255, 255, 255); + } + +QToolButton:checked { + border: 3px solid #999; + border-left: 10px solid #999; + border-right: 10px solid #999; + border-radius: 0px; + background-color: #999; + color: rgb(255, 255, 255); +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + Preview + + + true + + + false + + + buttonGroup_3 + + + + + + + QToolButton { /* all types of tool button */ + border: 3px solid rgb(255, 255, 255); + border-left: 10px solid rgb(255, 255, 255); + border-right: 10px solid rgb(255, 255, 255); + border-radius: 0px; + background-color: rgb(255, 255, 255); + color: rgb(191, 191, 191); + } + +QToolButton:hover { + border: 3px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; + color: rgb(255, 255, 255); + } + +QToolButton:checked { + border: 3px solid #999; + border-left: 10px solid #999; + border-right: 10px solid #999; + border-radius: 0px; + background-color: #999; + color: rgb(255, 255, 255); +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + Pseudo + + + true + + + false + + + buttonGroup_3 + + + + + + + QToolButton { /* all types of tool button */ + border: 3px solid rgb(255, 255, 255); + border-left: 10px solid rgb(255, 255, 255); + border-right: 10px solid rgb(255, 255, 255); + border-radius: 0px; + background-color: rgb(255, 255, 255); + color: rgb(191, 191, 191); + } + +QToolButton:hover { + border: 3px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; + color: rgb(255, 255, 255); + } + +QToolButton:checked { + border: 3px solid #999; + border-left: 10px solid #999; + border-right: 10px solid #999; + border-radius: 0px; + background-color: #999; + color: rgb(255, 255, 255); +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + Graph + + + true + + + true + + + buttonGroup_3 + + + + + + + Qt::Horizontal + + + + 55 + 20 + + + + + + previewToolButton + decoToolButton + horizontalSpacer_2 + horizontalSpacer + simpleGrapgToolButton + + + + + + + 0 + 0 + + + + + + + QTabWidget::South + + + 2 + + + + Preview + + + + 0 + + + 0 + + + 0 + + + 5 + + + 0 + + + + + + 0 + 0 + + + + + Anonymous Pro + 13 + + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QTextEdit::NoWrap + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + Decomp + + + + 0 + + + 0 + + + 0 + + + 5 + + + 0 + + + + + + 0 + 0 + + + + + Anonymous Pro + 13 + + + + QFrame::NoFrame + + + QFrame::Plain + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + QPlainTextEdit::NoWrap + + + + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + Graph + + + + 0 + + + 0 + + + 0 + + + 5 + + + 0 + + + + + + 0 + 0 + + + + + Anonymous Pro + 12 + + + + QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); + font: 11pt "Monaco"; +} + + + + about:blank + + + + + + + + + + + + + + + + + Hexdump + + + + 0 + + + 0 + + + 0 + + + 5 + + + 0 + + + + + 5 + + + 0 + + + + + 0 + + + + + + 0 + 0 + + + + + Anonymous Pro + 13 + + + + false + + + + + + QFrame::NoFrame + + + 0 + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + + + + true + + + QTextEdit::NoWrap + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Anonymous Pro'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Monaco'; font-size:12pt;"><br /></p></body></html> + + + false + + + false + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + Anonymous Pro + 13 + + + + false + + + QFrame::NoFrame + + + 0 + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + QTextEdit::NoWrap + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Anonymous Pro'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Monaco'; font-size:12pt;"><br /></p></body></html> + + + false + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + + Anonymous Pro + 13 + + + + false + + + QFrame::NoFrame + + + 0 + + + Qt::ScrollBarAlwaysOn + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + QTextEdit::NoWrap + + + true + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Anonymous Pro'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Monaco'; font-size:12pt;"><br /></p></body></html> + + + false + + + Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + + + + + + Graph + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::DefaultContextMenu + + + + about:blank + + + + 1.000000000000000 + + + + + + + + + + + + 0 + 0 + + + + + 257 + 16777215 + + + + QTabWidget::pane { /* The tab widget frame */ +border-top: 0px; +} + + + QTabWidget::South + + + 0 + + + + Disas + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + Qt::ScrollBarAlwaysOff + + + QAbstractScrollArea::AdjustToContents + + + true + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + 0 + 0 + 257 + 885 + + + + + 0 + 0 + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 5 + + + 2 + + + 5 + + + + + 5 + + + 2 + + + 2 + + + + + + 0 + 0 + + + + + 75 + true + + + + Function: + + + + + + + + + + + + + false + + + true + + + + + + + + + 5 + + + 0 + + + 5 + + + + + ... + + + + 8 + 8 + + + + true + + + true + + + Qt::DownArrow + + + + + + + + 0 + 0 + + + + <html><head/><body><p><span style=" font-weight:600;">Information</span></p></body></html> + + + + + + + 0 + + + + + Radar graph + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-left: 10px solid #444; + border-right: 10px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:checked { + border: 5px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/radar.png + :/new/prefix1/img/icons/radar_white.png:/new/prefix1/img/icons/radar.png + + + + 8 + 8 + + + + true + + + true + + + buttonGroup_2 + + + + + + + Polar graph + + + QToolButton { /* all types of tool button */ + border: 5px solid #333; + border-left: 10px solid #333; + border-right: 10px solid #333; + border-radius: 0px; + background-color: #333; + } + +QToolButton:hover { + border: 5px solid #444; + border-left: 10px solid #444; + border-right: 10px solid #444; + border-radius: 0px; + background-color: #444; + } + +QToolButton:checked { + border: 5px solid #2180a9; + border-left: 10px solid #2180a9; + border-right: 10px solid #2180a9; + border-radius: 0px; + background-color: #2180a9; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + :/new/prefix1/img/icons/polar.png + :/new/prefix1/img/icons/polar_white.png:/new/prefix1/img/icons/polar.png + + + + 8 + 8 + + + + true + + + false + + + buttonGroup_2 + + + + + + + + + + + + 0 + 0 + + + + + 0 + 250 + + + + + 250 + 250 + + + + 1 + + + + Tab 1 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 245 + 245 + + + + + 250 + 250 + + + + + qrc:/html/fcn_graph.html + + + + + + + + + Tab 2 + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 245 + 245 + + + + + 250 + 250 + + + + + qrc:/html/fcn_radar.html + + + + + + + + + + + + 5 + + + 0 + + + + + + + + + 8 + 8 + + + + true + + + true + + + Qt::DownArrow + + + + + + + + 75 + true + + + + true + + + Offset info: + + + + + + + + + + 0 + 0 + + + + + 0 + 175 + + + + + 11 + + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + 10 + + + true + + + + Info + + + + + Value + + + + + + + + + + ... + + + + 8 + 8 + + + + true + + + true + + + Qt::DownArrow + + + + + + + + 75 + true + + + + true + + + Opcode description: + + + + + + + + + + 0 + 0 + + + + background-color: rgb(255, 255, 255); +color: rgb(0, 0, 0); + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + Qt::ScrollBarAlwaysOff + + + false + + + true + + + + + + + 5 + + + 0 + + + 0 + + + + + + + + + 8 + 8 + + + + true + + + true + + + Qt::DownArrow + + + + + + + <b>Xrefs from:</b> + + + + + + + + + + 0 + 0 + + + + + 0 + 100 + + + + + 11 + + + + QTreeWidget::item +{ + padding-left:10px; + padding-top: 1px; + padding-bottom: 1px; + border-left: 10px; +} + +QTreeWidget::item:hover +{ + background: rgb(242, 246, 248); + color: black; +} + +QTreeWidget::item:selected +{ + background: gray; + color: white; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); + font: 12pt "Monaco"; +} + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::ScrollPerPixel + + + 0 + + + + Address + + + + + Instruction + + + + + + + + 5 + + + 0 + + + + + ... + + + + 8 + 8 + + + + true + + + true + + + Qt::DownArrow + + + + + + + <b>Xrefs To:</b> + + + + + + + + + + 0 + 0 + + + + + 0 + 100 + + + + + 11 + + + + QTreeWidget::item +{ + padding-left:10px; + padding-top: 1px; + padding-bottom: 1px; + border-left: 10px; +} + +QTreeWidget::item:hover +{ + background: rgb(242, 246, 248); + color: black; +} + +QTreeWidget::item:selected +{ + background: gray; + color: white; +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); + font: 12pt "Monaco"; +} + + + QFrame::NoFrame + + + Qt::ScrollBarAlwaysOff + + + QAbstractItemView::ScrollPerPixel + + + 0 + + + + Address + + + + + Instruction + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + Hex + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QTabWidget::North + + + 0 + + + true + + + false + + + + Parsing + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + 5 + + + 0 + + + + + 0 + + + + + + 0 + 0 + + + + + Dissasembly + + + + + String + + + + + Assembler + + + + + C byte array + + + + + C dword array + + + + + C qword array + + + + + Python + + + + + JSON + + + + + Javascript + + + + + + + + + 0 + 0 + + + + Endian + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + Little + + + + + Big + + + + + + + + + + + 0 + 0 + + + + + 0 + 0 + + + + QFrame::NoFrame + + + QFrame::Plain + + + 0 + + + + QLayout::SetMinimumSize + + + 5 + + + 0 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + Arch + + + + + + + + 0 + 0 + + + + QComboBox::AdjustToMinimumContentsLength + + + false + + + + + + + + 0 + 0 + + + + Bits + + + + + + + QComboBox::AdjustToMinimumContentsLength + + + + 16 + + + + + 32 + + + + + 64 + + + + + + + + + + + + 0 + 0 + + + + + Anonymous Pro + 13 + + + + QFrame::NoFrame + + + 0 + + + ;; Select some bytes on the left +;; to see them disassembled + + + + + + + + + + Information + + + + 6 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 75 + true + + + + Bytes info + + + + + + + QFormLayout::ExpandingFieldsGrow + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + Qt::AlignHCenter|Qt::AlignTop + + + 5 + + + 6 + + + 5 + + + 5 + + + + + + 0 + 0 + + + + MD5: + + + + + + + SHA1: + + + + + + + Entropy: + + + + + + + + 0 + 0 + + + + false + + + true + + + + + + + 5 + + + + + + 0 + 0 + + + + false + + + true + + + + + + + Copy MD5 + + + QToolButton { /* all types of tool button */ + border: 0px solid rgb(255, 255, 255); + border-radius: 6px; + border-left: 5px solid rgb(255, 255, 255); + border-right: 5px solid rgb(255, 255, 255); + margin-bottom: 1px; + margin-top: 1px; + background-color: rgb(255, 255, 255); + image: url(:/new/prefix1/img/icons/transfer.png); +} + +QToolButton:hover { + + border: 0px solid #2180a9; + border-radius: 6px; + border-left: 5px solid #2180a9; + border-right: 5px solid #2180a9; + margin-bottom: 1px; + margin-top: 1px; + background-color: #2180a9; + image: url(:/new/prefix1/img/icons/transfer_white.png); +} + +QToolButton:pressed { + border: 0px solid rgb(255, 255, 255); + border-radius: 6px; + border-left: 5px solid rgb(255, 255, 255); + border-right: 5px solid rgb(255, 255, 255); + margin-bottom: 1px; + margin-top: 1px; + background-color: rgb(255, 255, 255); + image: url(:/new/prefix1/img/icons/transfer.png); +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + + + + + + 5 + + + + + + 0 + 0 + + + + false + + + true + + + + + + + Copy SHA1 + + + QToolButton { /* all types of tool button */ + border: 0px solid rgb(255, 255, 255); + border-radius: 6px; + border-left: 5px solid rgb(255, 255, 255); + border-right: 5px solid rgb(255, 255, 255); + margin-bottom: 1px; + margin-top: 1px; + background-color: rgb(255, 255, 255); + image: url(:/new/prefix1/img/icons/transfer.png); +} + +QToolButton:hover { + + border: 0px solid #2180a9; + border-radius: 6px; + border-left: 5px solid #2180a9; + border-right: 5px solid #2180a9; + margin-bottom: 1px; + margin-top: 1px; + background-color: #2180a9; + image: url(:/new/prefix1/img/icons/transfer_white.png); +} + +QToolButton:pressed { + border: 0px solid rgb(255, 255, 255); + border-radius: 6px; + border-left: 5px solid rgb(255, 255, 255); + border-right: 5px solid rgb(255, 255, 255); + margin-bottom: 1px; + margin-top: 1px; + background-color: rgb(255, 255, 255); + image: url(:/new/prefix1/img/icons/transfer.png); +} + +QToolTip { + background-color: #444; + border: 3px solid #444; + color: rgb(232, 232, 232); +} + + + + + + + + + + + + + + Qt::Horizontal + + + + + + + 0 + + + + + <b>Histogram</b> + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + Graph + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + QFrame::NoFrame + + + 0 + + + false + + + true + + + + Basic blocks + + + + + fcn.08040000 + + + + 0x08048e10 + + + + + 0x08048e50 + + + + + 0x080583FF + + + + + + + + + + + + + + Change font + + + Change font + + + + + Disasm side panel + + + Disasm side panel + + + + + Hexdump side panel + + + Hexdump side panel + + + + + Graph side panel + + + Graph side panel + + + + + Send to notepad + + + Send to notepad + + + + + Add comment + + + Add comment + + + + + Rename + + + Rename + + + + + Undefine + + + Undefine + + + + + Show/Hide bytes + + + Show/Hide bytes + + + + + Switch case + + + Switch case + + + + + Syntax ATT/Intel + + + Syntax ATT/Intel + + + + + Copy all + + + Copy all + + + + + Copy bytes + + + Copy bytes + + + + + Copy disasm + + + Copy disasm + + + + + Copy Hexpair + + + Copy Hexpair + + + + + Copy ASCII + + + Copy ASCII + + + + + Copy Text + + + Copy Text + + + + + 1 + + + 1 + + + + + 2 + + + 2 + + + + + 4 + + + 4 + + + + + 8 + + + 8 + + + + + 16 + + + 16 + + + + + 32 + + + 32 + + + + + 64 + + + 64 + + + + + Edit + + + Edit + + + + + Paste + + + Paste + + + + + Insert Hex + + + Insert Hex + + + + + Insert String + + + Insert String + + + + + XRefs + + + XRefs + + + + + Separate bytes + + + Separate bytes with space + + + + + Right align bytes + + + Right align bytes + + + + + Separate disasm calls + + + Separate disasm calls + + + + + Show stack pointer + + + Show stack pointer + + + + + + QWebEngineView + QWidget +
QtWebEngineWidgets/QWebEngineView
+
+
+ + + + + + + + + +
diff --git a/src/widgets/memwidget/memorywidget.cpp b/src/widgets/memwidget/memorywidget.cpp index 08871dca..e7fde4f6 100644 --- a/src/widgets/memwidget/memorywidget.cpp +++ b/src/widgets/memwidget/memorywidget.cpp @@ -11,11 +11,16 @@ #include #include #include -#include #include #include #include +#if defined(USE_WEBENGINE) + #include +#else + #include +#endif + MemoryWidget::MemoryWidget(MainWindow *main) : QDockWidget(main), ui(new Ui::MemoryWidget) @@ -66,6 +71,10 @@ MemoryWidget::MemoryWidget(MainWindow *main) : graph_bar->setVisible(false); // Hide graph webview scrollbars + +#if defined(USE_WEBENGINE) + ui->graphWebView->page()->runJavaScript("document.body.style.overflow='hidden';"); +#else ui->graphWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff); ui->graphWebView->page()->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff); @@ -76,6 +85,7 @@ MemoryWidget::MemoryWidget(MainWindow *main) : // Debug console QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true); +#endif // Add margin to function name line edit ui->fcnNameEdit->setTextMargins(5, 0, 0, 0); @@ -180,7 +190,11 @@ MemoryWidget::MemoryWidget(MainWindow *main) : connect(this->disasTextEdit->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(disasmScrolled())); connect(this->hexASCIIText->verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(hexScrolled())); +#if defined(USE_WEBENGINE) + connect(ui->graphWebView->page(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool))); +#else connect(ui->graphWebView->page()->mainFrame(), SIGNAL(loadFinished(bool)), this, SLOT(frameLoadFinished(bool))); +#endif } /* @@ -1407,7 +1421,11 @@ void MemoryWidget::create_graph(QString off) { ui->graphWebView->load(QUrl("qrc:/graph/html/graph/index.html#" + off)); QString port = this->main->core->config("http.port"); +#if defined(USE_WEBENGINE) + ui->graphWebView->page()->runJavaScript(QString("r2.root=\"http://localhost:" + port + "\"")); +#else ui->graphWebView->page()->mainFrame()->evaluateJavaScript(QString("r2.root=\"http://localhost:" + port + "\"")); +#endif } QString MemoryWidget::normalize_addr(QString addr) { @@ -1752,7 +1770,11 @@ void MemoryWidget::frameLoadFinished(bool ok) { QSettings settings; if (settings.value("dark").toBool()) { QString js = "r2ui.graph_panel.render('dark');"; - ui->graphWebView->page()->mainFrame()->evaluateJavaScript(js); +#if defined(USE_WEBENGINE) + ui->graphWebView->page()->runJavaScript(js, [](const QVariant &result){ qDebug() << result; }); +#else + qDebug() << ui->graphWebView->page()->mainFrame()->evaluateJavaScript(js); +#endif } } } diff --git a/src/widgets/memwidget/memorywidget.h b/src/widgets/memwidget/memorywidget.h index 31d3101d..1e39b079 100644 --- a/src/widgets/memwidget/memorywidget.h +++ b/src/widgets/memwidget/memorywidget.h @@ -11,11 +11,16 @@ #include #include #include -#include #include #include #include +#if defined(USE_WEBENGINE) + #include +#else + #include +#endif + class MainWindow; namespace Ui { @@ -39,8 +44,13 @@ public: QTreeWidget *xrefToTreeWidget_2; QTreeWidget *xreFromTreeWidget_2; QTabWidget *memTabWidget; +#if defined(USE_WEBENGINE) + QWebEngineView *graphWebView; + QWebEngineView *histoWebView; +#else QWebView *graphWebView; QWebView *histoWebView; +#endif Highlighter *highlighter; Highlighter *highlighter_5;