From 92572947272de79d0241a5f597af7cdd1857e1a5 Mon Sep 17 00:00:00 2001 From: Maijin Date: Mon, 25 Sep 2017 19:51:49 +0200 Subject: [PATCH] Fix more iaito -> cutter --- .gitignore | 2 +- .gitmodules | 6 ++-- .travis.yml | 66 ++++++++++++++++++++++++++--------------- README.md | 2 +- src/CMakeLists.txt | 28 ++++++++--------- src/cutter.cpp | 14 ++++----- src/cutter.h | 2 +- src/cutter.pro | 12 ++++---- src/iaito.desktop | 6 ++-- src/lib_radare2.pri | 8 ++--- src/radarewebserver.cpp | 2 +- src/resources.qrc | 2 +- 12 files changed, 84 insertions(+), 66 deletions(-) diff --git a/.gitignore b/.gitignore index 724c0218..a2167a73 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # The final executable after `make clean` -iaito +cutter AStyle* # C++ objects and libs diff --git a/.gitmodules b/.gitmodules index b943753d..8116a01e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ -[submodule "iaito_win32"] - path = iaito_win32 - url = https://github.com/mrexodia/iaito_win32 +[submodule "cutter_win32"] + path = cutter_win32 + url = https://github.com/mrexodia/cutter_win32 [submodule "radare2"] path = radare2 url = https://github.com/radare/radare2 diff --git a/.travis.yml b/.travis.yml index cbf88dca..f065f313 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,34 +1,52 @@ language: cpp -compiler: gcc + cache: ccache -sudo: require -dist: trusty -before_install: - - sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y - - sudo apt-get update -qq - -install: - - sudo apt-get -y install qt56base qt56webengine - - source /opt/qt5*/bin/qt5*-env.sh +matrix: + include: + - os: osx + before_install: + - brew update + install: + - brew install p7zip ccache + - curl -L -o qt5-mac.sh https://raw.githubusercontent.com/LRFLEW/OpenRCT2Launcher/develop/qt5-mac.sh + - chmod a+x qt5-mac.sh + - export PATH="$PATH:/usr/local/opt/ccache/libexec:$PWD/$(./qt5-mac.sh . base declarative tools webchannel positioning extra-webengine)" + after_success: + # TODO: include radare2/www for the webserver + - macdeployqt cutter.app -dmg + - curl --upload-file ./iai*.dmg https://transfer.sh/cutter-git.$(git rev-parse --short HEAD).dmg + - os: linux + dist: trusty + sudo: required + before_install: + - sudo add-apt-repository ppa:beineri/opt-qt562-trusty -y + - sudo apt-get update -qq + install: + - sudo apt-get -y install qt56base qt56webengine + - source /opt/qt5*/bin/qt5*-env.sh + after_success: + - sudo make INSTALL_ROOT=appdir install + - sudo chown -R $USER appdir + - cp -r /usr/share/radare2 appdir/usr/share/ + - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + - chmod a+x linuxdeployqt*.AppImage + - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH + - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -verbose=2 + - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage -verbose=2 + - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + - curl --upload-file ./Iai*.AppImage https://transfer.sh/Cutter-git.$(git rev-parse --short HEAD)-x86_64.AppImage script: - git submodule init ; git submodule update - cd radare2 - - sys/install.sh + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + INSTALL_TARGET=install sys/install.sh; + else + LDFLAGS=-headerpad_max_install_names INSTALL_TARGET=install sys/install.sh; + fi - cd .. - - mkdir build ; cd build + - mkdir build + - cd build - qmake PREFIX=/usr APPIMAGE=1 ../src - make -j4 - - mkdir appdir - - sudo make INSTALL_ROOT=appdir install && sudo chown -R $USER appdir - - mkdir -p appdir/usr/share/radare2 && cp -Lr /usr/share/radare2/*-git/ appdir/usr/share/radare2/ && find appdir/ - -after_success: - - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" - - chmod a+x linuxdeployqt*.AppImage - - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH - - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -verbose=2 - - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage -verbose=2 - - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - - ls Cut*.AppImage diff --git a/README.md b/README.md index 956e3382..90053da6 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Cutter [![Build Status](https://travis-ci.org/radareorg/cutter.svg?branch=master)](https://travis-ci.org/radareorg/cutter) -A Qt and C++ GUI for radare2 reverse engineering framework (originally Iaito) +A Qt and C++ GUI for radare2 reverse engineering framework (originally Cutter) ## Screenshot diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0980a42d..e488d3d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -17,16 +17,16 @@ find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui WebEngine WebEngineWidgets if(WIN32) # use radare2 libraries from submodule on windows - set(IAITO_WIN32_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cutter_win32") - list(APPEND CMAKE_PREFIX_PATH "${IAITO_WIN32_DIR}") + set(CUTTER_WIN32_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../cutter_win32") + list(APPEND CMAKE_PREFIX_PATH "${CUTTER_WIN32_DIR}") if(CMAKE_SIZEOF_VOID_P EQUAL 8) # 64 bit - list(APPEND CMAKE_LIBRARY_PATH "${IAITO_WIN32_DIR}/radare2/lib64") + list(APPEND CMAKE_LIBRARY_PATH "${CUTTER_WIN32_DIR}/radare2/lib64") else() - list(APPEND CMAKE_LIBRARY_PATH "${IAITO_WIN32_DIR}/radare2/lib32") + list(APPEND CMAKE_LIBRARY_PATH "${CUTTER_WIN32_DIR}/radare2/lib32") endif() - set(RADARE2_INCLUDE_DIRS "${IAITO_WIN32_DIR}/radare2/include/libr" "${IAITO_WIN32_DIR}/include") + set(RADARE2_INCLUDE_DIRS "${CUTTER_WIN32_DIR}/radare2/include/libr" "${CUTTER_WIN32_DIR}/include") endif() @@ -46,11 +46,11 @@ include(QMakeProParse) configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cutter.pro" "${CMAKE_CURRENT_BINARY_DIR}/cutter.pro" COPYONLY) # trigger reconfigure if cutter.pro changes -parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/cutter.pro" IAITO_PRO) -set(SOURCE_FILES ${IAITO_PRO_SOURCES}) -set(HEADER_FILES ${IAITO_PRO_HEADERS}) -set(UI_FILES ${IAITO_PRO_FORMS}) -set(QRC_FILES ${IAITO_PRO_RESOURCES}) +parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/cutter.pro" CUTTER_PRO) +set(SOURCE_FILES ${CUTTER_PRO_SOURCES}) +set(HEADER_FILES ${CUTTER_PRO_HEADERS}) +set(UI_FILES ${CUTTER_PRO_FORMS}) +set(QRC_FILES ${CUTTER_PRO_RESOURCES}) message(STATUS "sources from cutter.pro: ${SOURCE_FILES}") message(STATUS "headers from cutter.pro: ${HEADER_FILES}") @@ -58,10 +58,10 @@ message(STATUS "forms from cutter.pro: ${UI_FILES}") message(STATUS "resources from cutter.pro: ${QRC_FILES}") -set(IAITO_VERSION_SUFFIX "-dev") -set(IAITO_VERSION_FULL "${PROJECT_VERSION}${IAITO_VERSION_SUFFIX}") -message(STATUS "Building Cutter version ${IAITO_VERSION_FULL}") -add_definitions("-DAPP_VERSION=\"${IAITO_VERSION_FULL}\"") +set(CUTTER_VERSION_SUFFIX "-dev") +set(CUTTER_VERSION_FULL "${PROJECT_VERSION}${CUTTER_VERSION_SUFFIX}") +message(STATUS "Building Cutter version ${CUTTER_VERSION_FULL}") +add_definitions("-DAPP_VERSION=\"${CUTTER_VERSION_FULL}\"") add_executable(cutter ${UI_FILES} ${QRC_FILES} ${SOURCE_FILES} ${HEADER_FILES}) diff --git a/src/cutter.cpp b/src/cutter.cpp index 5bbc28c8..4ab4562c 100644 --- a/src/cutter.cpp +++ b/src/cutter.cpp @@ -49,7 +49,7 @@ CutterCore::CutterCore(QObject *parent) : r_core_loadlibs(this->core_, R_CORE_LOADLIBS_ALL, NULL); // IMPLICIT r_bin_iobind (core_->bin, core_->io); - // Otherwise r2 may ask the user for input and Iaito would freeze + // Otherwise r2 may ask the user for input and Cutter would freeze config("scr.interactive", "false"); // Used by the HTML5 graph @@ -808,7 +808,7 @@ QStringList CutterCore::getAsmPluginNames() QStringList ret; RAsmPlugin *ap; - IaitoRListForeach(core_->assembler->plugins, it, RAsmPlugin, ap) + CutterRListForeach(core_->assembler->plugins, it, RAsmPlugin, ap) { ret << ap->name; } @@ -823,7 +823,7 @@ QStringList CutterCore::getAnalPluginNames() QStringList ret; RAnalPlugin *ap; - IaitoRListForeach(core_->anal->plugins, it, RAnalPlugin, ap) + CutterRListForeach(core_->anal->plugins, it, RAnalPlugin, ap) { ret << ap->name; } @@ -934,7 +934,7 @@ QList CutterCore::getAllSymbols() RBinSymbol *bs; if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) { - IaitoRListForeach(core_->bin->cur->o->symbols, it, RBinSymbol, bs) + CutterRListForeach(core_->bin->cur->o->symbols, it, RBinSymbol, bs) { QString type = QString(bs->bind) + " " + QString(bs->type); SymbolDescription symbol; @@ -948,7 +948,7 @@ QList CutterCore::getAllSymbols() /* list entrypoints as symbols too */ int n = 0; RBinAddr *entry; - IaitoRListForeach(core_->bin->cur->o->entries, it, RBinAddr, entry) + CutterRListForeach(core_->bin->cur->o->entries, it, RBinAddr, entry) { SymbolDescription symbol; symbol.vaddr = entry->vaddr; @@ -995,7 +995,7 @@ QList CutterCore::getAllRelocs() RBinReloc *br; if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) { - IaitoRListForeach(core_->bin->cur->o->relocs, it, RBinReloc, br) + CutterRListForeach(core_->bin->cur->o->relocs, it, RBinReloc, br) { RelocDescription reloc; @@ -1024,7 +1024,7 @@ QList CutterCore::getAllStrings() RBinString *bs; if (core_ && core_->bin && core_->bin->cur && core_->bin->cur->o) { - IaitoRListForeach(core_->bin->cur->o->strings, it, RBinString, bs) + CutterRListForeach(core_->bin->cur->o->strings, it, RBinString, bs) { StringDescription str; str.vaddr = bs->vaddr; diff --git a/src/cutter.h b/src/cutter.h index b4de9449..4a4f258b 100644 --- a/src/cutter.h +++ b/src/cutter.h @@ -22,7 +22,7 @@ #define HAVE_LATEST_LIBR2 false -#define IaitoRListForeach(list, it, type, x) \ +#define CutterRListForeach(list, it, type, x) \ if (list) for (it = list->head; it && ((x=(type*)it->data)); it = it->n) #define __alert(x) QMessageBox::question (this, "Alert", QString(x), QMessageBox::Ok) diff --git a/src/cutter.pro b/src/cutter.pro index a1808908..dae69256 100644 --- a/src/cutter.pro +++ b/src/cutter.pro @@ -155,13 +155,13 @@ unix { PREFIX = /usr/local } - icon_file = img/iaito-small.png + icon_file = img/cutter-small.png share_pixmaps.path = $$PREFIX/share/pixmaps share_pixmaps.files = $$icon_file - desktop_file = iaito.desktop + desktop_file = cutter.desktop # built-in no need for files atm target.path = $$PREFIX/bin @@ -173,12 +173,12 @@ unix { # Triggered for example by 'qmake APPIMAGE=1' !isEmpty(APPIMAGE){ - # UGLY work around for the logo name in iaito.desktop - # Would be better to have a file called iaito.png in the first place - system(cp img/iaito-small.png $$OUT_PWD/iaito-small.png) + # UGLY work around for the logo name in cutter.desktop + # Would be better to have a file called cutter.png in the first place + system(cp img/cutter-small.png $$OUT_PWD/cutter-small.png) appimage_root.path = / - appimage_root.files = $$OUT_PWD/iaito.png $$desktop_file + appimage_root.files = $$OUT_PWD/cutter.png $$desktop_file INSTALLS += appimage_root } diff --git a/src/iaito.desktop b/src/iaito.desktop index 99da1249..07160530 100644 --- a/src/iaito.desktop +++ b/src/iaito.desktop @@ -1,6 +1,6 @@ [Desktop Entry] Type=Application -Name=Iaitō -Exec=iaito -Icon=iaito-small +Name=Cutter +Exec=cutter +Icon=cutter-small Categories=Development; diff --git a/src/lib_radare2.pri b/src/lib_radare2.pri index 9d101387..d5973c2f 100644 --- a/src/lib_radare2.pri +++ b/src/lib_radare2.pri @@ -1,12 +1,12 @@ win32 { DEFINES += _CRT_NONSTDC_NO_DEPRECATE DEFINES += _CRT_SECURE_NO_WARNINGS - INCLUDEPATH += "$$PWD/../iaito_win32/include" - INCLUDEPATH += "$$PWD/../iaito_win32/radare2/include/libr" + INCLUDEPATH += "$$PWD/../cutter_win32/include" + INCLUDEPATH += "$$PWD/../cutter_win32/radare2/include/libr" !contains(QT_ARCH, x86_64) { - LIBS += -L"$$PWD/../iaito_win32/radare2/lib32" + LIBS += -L"$$PWD/../cutter_win32/radare2/lib32" } else { - LIBS += -L"$$PWD/../iaito_win32/radare2/lib64" + LIBS += -L"$$PWD/../cutter_win32/radare2/lib64" } LIBS += \ diff --git a/src/radarewebserver.cpp b/src/radarewebserver.cpp index 598735b1..2e8bd559 100644 --- a/src/radarewebserver.cpp +++ b/src/radarewebserver.cpp @@ -23,7 +23,7 @@ void RadareWebServer::start() QProcessEnvironment env(QProcessEnvironment::systemEnvironment()); if (env.contains("APPIMAGE") && env.contains("APPDIR") && env.contains("OWD")) { - // pretty sure now iaito runs as AppImage + // pretty sure now cutter runs as AppImage //QString defaultPath("/usr/share/radare2/1.5.0-git/www"); QString defaultHttpRoot(core->config("http.root")); diff --git a/src/resources.qrc b/src/resources.qrc index 52c17812..43bf28dd 100644 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -55,7 +55,7 @@ img/icons/transfer_white.svg img/icons/spin_light.svg img/logo2.png - img/iaito-small.png + img/cutter-small.png img/logo-small-white.png img/icons/import_light.svg fonts/Anonymous Pro.ttf