mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-14 00:38:42 +00:00
Merge branch 'master' of github.com:hteso/iaito into contextmenu
This commit is contained in:
commit
28aa884354
@ -19,14 +19,7 @@ script:
|
||||
- mkdir build ; cd build
|
||||
- qmake PREFIX=/usr ../src
|
||||
- make -j4
|
||||
- # make install does not work, so do it by hand
|
||||
- # sudo make INSTALL_ROOT=appdir install ; sudo chown -R $USER appdir ; find appdir/
|
||||
- mkdir -p appdir/usr/bin
|
||||
- mkdir -p appdir/usr/share/applications
|
||||
- cp iaito appdir/usr/bin
|
||||
- cp ../src/img/logo-small.png appdir/iaito.png
|
||||
- cp ../src/iaito.desktop appdir/
|
||||
- cp ../src/iaito.desktop appdir/usr/share/applications/
|
||||
- sudo make INSTALL_ROOT=appdir install ; sudo chown -R $USER appdir ; find appdir/
|
||||
|
||||
after_success:
|
||||
- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
|
||||
|
104
src/Iaito.pro
104
src/Iaito.pro
@ -1,14 +1,7 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2014-02-27T11:31:27
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
ICON = img/Enso.icns
|
||||
|
||||
# No idea what this does exactly
|
||||
TEMPLATE = app
|
||||
|
||||
TARGET = iaito
|
||||
|
||||
# The application version
|
||||
win32 {
|
||||
VERSION = 1.0
|
||||
@ -16,34 +9,27 @@ win32 {
|
||||
VERSION = 1.0-dev
|
||||
}
|
||||
|
||||
ICON = img/Enso.icns
|
||||
|
||||
QT += core gui webkit webkitwidgets
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
QT_CONFIG -= no-pkg-config
|
||||
|
||||
CONFIG += c++11
|
||||
|
||||
# Define the preprocessor macro to get the application version in our application.
|
||||
DEFINES += APP_VERSION=\\\"$$VERSION\\\"
|
||||
|
||||
QT += core gui webkit webkitwidgets
|
||||
QT_CONFIG -= no-pkg-config
|
||||
|
||||
macx {
|
||||
QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc++
|
||||
EXTSO=dylib
|
||||
} else {
|
||||
win32 {
|
||||
EXTSO=dll
|
||||
} else {
|
||||
EXTSO=so
|
||||
}
|
||||
QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc++
|
||||
}
|
||||
CONFIG += c++11
|
||||
|
||||
INCLUDEPATH *= .
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
TARGET = iaito
|
||||
TEMPLATE = app
|
||||
|
||||
INCLUDEPATH += ./
|
||||
|
||||
SOURCES += main.cpp\
|
||||
mainwindow.cpp \
|
||||
SOURCES += \
|
||||
main.cpp \
|
||||
mainwindow.cpp \
|
||||
newfiledialog.cpp \
|
||||
optionsdialog.cpp \
|
||||
highlighter.cpp \
|
||||
@ -77,7 +63,8 @@ SOURCES += main.cpp\
|
||||
dialogs/xrefsdialog.cpp \
|
||||
hexhighlighter.cpp
|
||||
|
||||
HEADERS += mainwindow.h \
|
||||
HEADERS += \
|
||||
mainwindow.h \
|
||||
newfiledialog.h \
|
||||
optionsdialog.h \
|
||||
highlighter.h \
|
||||
@ -112,7 +99,8 @@ HEADERS += mainwindow.h \
|
||||
widgets/banned.h \
|
||||
hexhighlighter.h
|
||||
|
||||
FORMS += mainwindow.ui \
|
||||
FORMS += \
|
||||
mainwindow.ui \
|
||||
newfiledialog.ui \
|
||||
optionsdialog.ui \
|
||||
createnewdialog.ui \
|
||||
@ -136,22 +124,38 @@ FORMS += mainwindow.ui \
|
||||
RESOURCES += \
|
||||
resources.qrc
|
||||
|
||||
win32 {
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
INCLUDEPATH += "$$PWD/../iaito_win32/include"
|
||||
INCLUDEPATH += "$$PWD/../iaito_win32/radare2/include/libr"
|
||||
!contains(QMAKE_HOST.arch, x86_64) {
|
||||
LIBS += -L"$$PWD/../iaito_win32/radare2/lib32"
|
||||
} else {
|
||||
LIBS += -L"$$PWD/../iaito_win32/radare2/lib64"
|
||||
}
|
||||
} else {
|
||||
#INCLUDEPATH += /usr/local/radare2/osx/include/libr
|
||||
INCLUDEPATH += /usr/local/include/libr
|
||||
INCLUDEPATH += /usr/include/libr
|
||||
#LIBS += -L/usr/local/radare2/osx/lib -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto
|
||||
LIBS += -L/usr/local/lib
|
||||
}
|
||||
include(lib_radare2.pri)
|
||||
|
||||
LIBS += -lr_core -lr_config -lr_cons -lr_io -lr_util -lr_flag -lr_asm -lr_debug -lr_hash -lr_bin -lr_lang -lr_io -lr_anal -lr_parse -lr_bp -lr_egg -lr_reg -lr_search -lr_syscall -lr_socket -lr_fs -lr_magic -lr_crypto
|
||||
|
||||
# 'make install' for AppImage
|
||||
unix {
|
||||
isEmpty(PREFIX) {
|
||||
PREFIX = /usr/local
|
||||
DEFAULT_PREFIX = true
|
||||
}
|
||||
|
||||
desktop_file = iaito.desktop
|
||||
|
||||
# built-in no need for files atm
|
||||
target.path = $$PREFIX/bin
|
||||
|
||||
share_applications.path = $$PREFIX/share/applications
|
||||
share_applications.files = $$desktop_file
|
||||
|
||||
# TODO:
|
||||
# iaito.png should be copied to $PREFIX/share/icons/$WIDTHx$HEIGHT
|
||||
|
||||
INSTALLS += target share_applications
|
||||
|
||||
# if a custom PREFIX is supplied, we asume it's an AppImage install
|
||||
!defined(DEFAULT_PREFIX, var) {
|
||||
# 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/logo-small.png $$OUT_PWD/iaito.png)
|
||||
|
||||
appimage_root.path = /
|
||||
appimage_root.files = $$OUT_PWD/iaito.png $$desktop_file
|
||||
|
||||
INSTALLS += appimage_root
|
||||
}
|
||||
}
|
||||
|
55
src/lib_radare2.pri
Normal file
55
src/lib_radare2.pri
Normal file
@ -0,0 +1,55 @@
|
||||
win32 {
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
INCLUDEPATH += "$$PWD/../iaito_win32/include"
|
||||
INCLUDEPATH += "$$PWD/../iaito_win32/radare2/include/libr"
|
||||
!contains(QMAKE_HOST.arch, x86_64) {
|
||||
LIBS += -L"$$PWD/../iaito_win32/radare2/lib32"
|
||||
} else {
|
||||
LIBS += -L"$$PWD/../iaito_win32/radare2/lib64"
|
||||
}
|
||||
} else {
|
||||
# check if r2 is available
|
||||
system(r2 > /dev/null 2>&1) {
|
||||
|
||||
# see https://github.com/hteso/iaito/pull/5#issuecomment-290433796
|
||||
RADARE2_INCLUDE_PATH = $$system(r2 -H | grep INCDIR | sed 's/[^=]*=//')
|
||||
RADARE2_LIB_PATH = $$system(r2 -H | grep LIBDIR | sed 's/[^=]*=//')
|
||||
|
||||
!isEmpty(RADARE2_INCLUDE_PATH) {
|
||||
INCLUDEPATH *= $$RADARE2_INCLUDE_PATH
|
||||
LIBS *= -L$$RADARE2_LIB_PATH
|
||||
} else {
|
||||
error("sorry could not find radare2 lib")
|
||||
}
|
||||
} else {
|
||||
error("r2 not found/in path")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LIBS += \
|
||||
-lr_core \
|
||||
-lr_config \
|
||||
-lr_cons \
|
||||
-lr_io \
|
||||
-lr_util \
|
||||
-lr_flag \
|
||||
-lr_asm \
|
||||
-lr_debug \
|
||||
-lr_hash \
|
||||
-lr_bin \
|
||||
-lr_lang \
|
||||
-lr_io \
|
||||
-lr_anal \
|
||||
-lr_parse \
|
||||
-lr_bp \
|
||||
-lr_egg \
|
||||
-lr_reg \
|
||||
-lr_search \
|
||||
-lr_syscall \
|
||||
-lr_socket \
|
||||
-lr_fs \
|
||||
-lr_magic \
|
||||
-lr_crypto
|
||||
|
@ -825,7 +825,8 @@ void MainWindow::on_backButton_clicked()
|
||||
this->core->cmd("s-");
|
||||
QString back_offset = this->core->cmd("s=").split(" > ").last().trimmed();
|
||||
if (back_offset != "") {
|
||||
this->seek(back_offset);
|
||||
QString fcn = this->core->cmdFunctionAt(back_offset);
|
||||
this->seek(this->memoryDock->normalizeAddr(back_offset), fcn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -861,6 +861,10 @@ void MemoryWidget::showDisasContextMenu(const QPoint &pt)
|
||||
QMenu *menu = ui->disasTextEdit_2->createStandardContextMenu();
|
||||
QTextCursor cur = ui->disasTextEdit_2->textCursor();
|
||||
|
||||
// Move cursor to mouse position to get proper function data
|
||||
cur.setPosition(ui->disasTextEdit_2->cursorForPosition(pt).position(), QTextCursor::MoveAnchor);
|
||||
ui->disasTextEdit_2->setTextCursor(cur);
|
||||
|
||||
if (cur.hasSelection()) {
|
||||
menu->addSeparator();
|
||||
menu->addAction(ui->actionSend_to_Notepad);
|
||||
@ -1599,9 +1603,9 @@ bool MemoryWidget::eventFilter(QObject *obj, QEvent *event) {
|
||||
jump = this->main->core->getOffsetJump(ele);
|
||||
if (jump != "") {
|
||||
if (jump.contains("0x")) {
|
||||
RAnalFunction *fcn = this->main->core->functionAt(jump.toLongLong(0, 16));
|
||||
if (fcn) {
|
||||
this->main->seek(jump, fcn->name);
|
||||
QString fcn = this->main->core->cmdFunctionAt(jump);
|
||||
if (fcn != "") {
|
||||
this->main->seek(jump.trimmed(), fcn);
|
||||
}
|
||||
} else {
|
||||
this->main->seek(this->main->core->cmd("?v " + jump), jump);
|
||||
|
@ -72,6 +72,8 @@ public slots:
|
||||
|
||||
QString normalize_addr(QString addr);
|
||||
|
||||
QString normalizeAddr(QString addr);
|
||||
|
||||
void setFcnName(QString addr);
|
||||
|
||||
void setMiniGraph(QString at);
|
||||
@ -164,7 +166,6 @@ private slots:
|
||||
void on_copyMD5_clicked();
|
||||
void on_copySHA1_clicked();
|
||||
void on_simpleGrapgToolButton_clicked();
|
||||
QString normalizeAddr(QString addr);
|
||||
void on_opcodeDescButton_clicked();
|
||||
void seek_back();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user