Compare commits

...
46 Commits
Author SHA1 Message Date
pancake cccaa3772a Add more modes and locations in the search widget comboboxes 2022-10-28 14:00:14 +02:00
Michal Ambroz 9ec1261ab9 some more 5.7.8 versioning 2022-10-28 01:43:27 +02:00
Michal Ambroz e529aebeb7 I forgot to change pro config to 5.7.8 2022-10-28 01:43:27 +02:00
pancake a98efe0cfb Use XDG paths for translations too 2022-10-27 16:29:25 +02:00
pancake 269cbac239 Fix eval var names 2022-10-19 20:55:52 +02:00
pancake f74826f047 Disable the decompiler tokenizer because it's really awfully implemented 2022-10-18 17:07:40 +02:00
pancake a33a73009f Fix type for an initial config var 2022-10-18 17:07:22 +02:00
pancake e3cf502fe4 Bring back the codemeta parsing 2022-10-18 12:56:10 +02:00
pancake 0764c4304a Fix race conditions in all decompilers when built with MONOTHREAD
* Disable the super-inefficient codemeta parser
2022-10-18 12:53:31 +02:00
pancake 697543fcf9 Get imports using the API and copy some logic from symbols into imports aiming to fix something 2022-10-18 10:36:26 +02:00
pancake 16fe40f7ae Remove two unused shellscripts 2022-10-17 09:06:21 +02:00
pancake c909eeecf6 Restore seek in cmdHtml() 2022-10-15 12:32:53 +02:00
pancake 148d77cf20 Move About to the bottom in the Help menu 2022-10-15 00:05:40 +02:00
pancake 5472217f77 Add 'aa' to the list of supported analysis options 2022-10-14 20:24:24 +02:00
pancake 6e6d40ed7e Always open the console dock by default 2022-10-14 20:04:55 +02:00
pancake 32203ce9a0 Fix all race conditions by making iaito monothread by default 2022-10-14 19:35:09 +02:00
pancake 69bce2f516 Fix qt5 deprecation warning 2022-10-14 17:42:39 +02:00
pancake 46a89eab47 Fix #107 - bug reporting and about dialog links not working 2022-10-14 17:16:05 +02:00
pancake f8652d9f62 Upgrade the github runners 2022-10-14 16:42:25 +02:00
Pau Rodriguez-Estivill 960fdaa9c7 Implement user-install 2022-10-12 15:44:04 +02:00
Pau Rodriguez-Estivill 2e503d5a17 Disable translations submodule 2022-10-12 15:44:04 +02:00
pancake dfb16cf2ee Install the manpage 2022-10-12 14:54:35 +02:00
pancake 7fbd28f918 Fix reference links for telegram and project 2022-10-12 12:17:57 +02:00
Pau RE b773f2b0c3 Update translation install method (#104)
* Update translation install
* Update translations submodule
* Remove unnedded translation build
2022-10-07 05:38:53 +02:00
Michal Ambroz 32cbe65a6a remove duplicate StartupNotify=true
Having duplicate StartupNotify is making the desktop file invalid on some platforms and is not passing the sanity check for the Fedora package build
https://kojipkgs.fedoraproject.org//work/tasks/9327/92669327/build.log

+ appstream-util validate-relax --nonet /builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64/usr/share/metainfo/org.radare.iaito.appdata.xml
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64/usr/share/metainfo/org.radare.iaito.appdata.xml: OK
+ desktop-file-validate /builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: hint: value item "Viewer" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: Graphics, or Office
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: hint: value item "ComputerScience" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: Education, or Science
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: hint: value item "DataVisualization" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: Education, or Science
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: hint: value item "Emulator" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: System, or Game
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: hint: value item "FileTools" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: Utility, or System
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: hint: value item "Security" in key "Categories" in group "Desktop Entry" can be extended with another category among the following categories: Settings, or System
/builddir/build/BUILDROOT/iaito-5.7.6-1.fc38.x86_64//usr/share/applications/org.radare.iaito.desktop: error: file contains multiple keys named "StartupNotify" in group "Desktop Entry"
error: Bad exit status from /var/tmp/rpm-tmp.iTnWFV (%check)
RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.iTnWFV (%check)
Child return code was: 1
EXCEPTION: [Error()]
2022-10-05 19:21:22 +02:00
Pau RE 88227b6623 Add flathub information in README 2022-10-05 18:35:07 +02:00
pancake 3721ec82fb Add install for meson 2022-10-05 00:40:16 +02:00
pancake 5b7ae60d45 Add r2's RAnal plugin listing tab 2022-10-03 11:10:17 +02:00
pancake 3890f557f2 Fix Qt deprecation warning 2022-10-03 11:10:05 +02:00
Pau Rodriguez-Estivill 2d78b57122 Rename and move unix icon 2022-09-30 17:01:00 +02:00
Pau Rodriguez-Estivill 23d04633cd Fix appdata 2022-09-30 16:30:42 +02:00
pancake 3cef6ddb48 Aim to fix the macos ci problems 2022-09-30 13:58:22 +02:00
pancake 2aa1788c47 make clean is the new mrproper 2022-09-30 13:49:54 +02:00
pancake 1f2f8d2d9d Remove python and crashreport messages from qmake 2022-09-30 13:36:27 +02:00
pancake 1c1c21ca56 Use win_subsystem: 'windows' instead of gui_app: true in meson
* gui_app is deprecated in meson 0.56
2022-09-30 13:31:53 +02:00
pancake 8677adc55f Remove the python references in about, configure and meson builds 2022-09-30 13:31:35 +02:00
pancake 9790012e0b Dont use r_xdg_datadir on old r2 2022-09-30 13:26:55 +02:00
Pau Rodriguez-Estivill 9159b74a24 Add support for the new r2 xdg module 2022-09-30 13:25:03 +02:00
Pau Rodriguez-Estivill f000631de3 Add flatpak translations path 2022-09-30 13:25:03 +02:00
pancake 881942a2da Release iaito-5.7.6 2022-09-29 17:26:59 +02:00
pancake d2382f2277 Fix crash in Relocswidget happening on linux 2022-09-27 18:54:42 +02:00
pancake 65a1947cca Clarify fallthrough cases 2022-09-27 18:52:49 +02:00
pancake 765fce3cba Aim to fix the macos CI by pointing at the x64 macOS r2 pkg 2022-09-27 18:23:47 +02:00
pancake 449c68fb53 Release 5.7.4 2022-09-25 23:28:20 +02:00
pancake c8fb13aca7 Fix segfault in imports widget 🤦 2022-09-25 23:17:17 +02:00
Arhzi 1f9b0c2d69 fix: src/core/Iaito.cpp SIGABRT in IaitoCore::initialize -> RCoreLocked::~RCoreLocked 2022-08-08 11:04:23 +02:00
64 changed files with 825 additions and 470 deletions

No files matched your search

+23 -25
View File
@@ -1,7 +1,7 @@
name: iaito CI
env:
R2V: 5.7.2
R2V: 5.7.8
on:
push:
@@ -15,11 +15,11 @@ jobs:
acr-linux-r2git:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v1
- uses: actions/setup-python@v4
with:
python-version: 3.8.x
- name: apt dependencies
@@ -37,16 +37,16 @@ jobs:
- name: packaging
run: |
make -j -C dist/debian
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: iaito-amd64.deb
path: dist/debian/*/*.deb
acr-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v1
with:
@@ -69,16 +69,16 @@ jobs:
- name: packaging
run: |
make -C dist/debian
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: iaito-amd64.deb
path: dist/debian/*/*.deb
acr-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v1
with:
@@ -86,13 +86,14 @@ jobs:
- name: homebrew dependencies
run: |
brew update
brew install coreutils pkg-config qt@5
brew install pkg-config qt@5
brew unlink qt@5 || true
brew link --force qt@5
pip3 install meson
pip3 install ninja
- name: install r2
run: |
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-${{env.R2V}}.pkg
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-x64-${{env.R2V}}.pkg
sudo installer -pkg *.pkg -target /
- name: build iaito
run: |
@@ -106,7 +107,7 @@ jobs:
- name: packaging
run: |
make -C dist/macos
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: iaito-mac-amd64.zip
path: dist/macos/iaito*.zip
@@ -122,9 +123,9 @@ jobs:
# Prevent one job from pausing the rest
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- name: apt dependencies
if: contains(matrix.os, 'ubuntu')
@@ -142,11 +143,8 @@ jobs:
- name: homebrew dependencies
if: contains(matrix.os, 'macos')
run: |
cd scripts
brew update --preinstall # temporary workaround for https://github.com/Homebrew/homebrew-bundle/issues/751
brew bundle
brew install coreutils
brew install pkg-config
brew install coreutils pkg-config
- name: py dependencies
run: |
pip install meson
@@ -166,9 +164,9 @@ jobs:
w64-meson:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
@@ -184,12 +182,12 @@ jobs:
# curl -vLo qt-unified-windows-x86-online.exe http://download.qt.io/official_releases/online_installers/qt-unified-windows-x86-online.exe
# qt-unified-windows-x86-online.exe --verbose --script ..\ci\qt.qs
- name: Install Qt
uses: jurplel/install-qt-action@v2
uses: jurplel/install-qt-action@v3
- name: dependencies
shell: cmd
run: |
pip install ninja meson wget
choco install zip
choco install zip
# - name: install r2
# shell: bash
# run: |
@@ -208,11 +206,11 @@ jobs:
call configure.bat
call make.bat
dir /s
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: iaito.exe
path: iaito\iaito.exe
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ env.PACKAGE_NAME }}
path: build/${{ env.PACKAGE_NAME }}
+3
View File
@@ -89,3 +89,6 @@ src/out
# astyle backup .orig files
*.orig
# Translations
src/translations
-3
View File
@@ -1,3 +0,0 @@
[submodule "src/translations"]
path = src/translations
url = https://github.com/radareorg/iaito-translations
+39 -23
View File
@@ -16,56 +16,72 @@ endif
all: iaito
clean:
mrproper: clean
rm -rf build
.PHONY: install build run user-install clean mrproper translations
mrproper: clean
git clean -xdf
iaito: translations
$(MAKE) -C build -j4
translations: build src/translations/README.md
$(MAKE) -C src/translations
# lrelease src/Iaito.pro
src/translations/README.md:
git submodule update --init
.PHONY: install run user-install clean mrproper install-translations
# force qt5 build when QtCreator is installed in user's home
ifeq ($(shell test -x ~/Qt/5.12.3/clang_64/bin/qmake || echo err),)
QMAKE=~/Qt/5.12.3/clang_64/bin/qmake
ifeq ($(shell test -x ~/Qt/5.*/clang_64/bin/qmake || echo err),)
QMAKE=~/Qt/5.*/clang_64/bin/qmake
endif
iaito: build
$(MAKE) -C build -j4
build:
mkdir -p build
cd build && $(QMAKE) ../src/Iaito.pro $(QMAKE_FLAGS)
install: translations
install-man:
mkdir -p "${DESTDIR}${MANDIR}/man1"
for FILE in src/*.1 ; do ${INSTALL_MAN} "$$FILE" "${DESTDIR}${MANDIR}/man1" ; done
install: build
ifeq ($(shell uname),Darwin)
rm -rf $(DESTDIR)/Applications/iaito.app
mkdir -p $(DESTDIR)/Applications
cp -rf build/iaito.app $(DESTDIR)/Applications/iaito.app
mkdir -p $(DESTDIR)/usr/local/bin
ln -fs '/Applications/iaito.app/Contents/MacOS/iaito' $(DESTDIR)'/usr/local/bin/iaito'
mkdir -p $(DESTDIR)/$(PREFIX)/bin
ln -fs '/Applications/iaito.app/Contents/MacOS/iaito' $(DESTDIR)/$(PREFIX)'/bin/iaito'
else
$(MAKE) -C build install INSTALL_ROOT=$(DESTDIR)
endif
$(MAKE) -C src/translations install
mkdir -p "$(DESTDIR)/$(PREFIX)/share/iaito/translations"
cp -f src/translations/build/*.qm "$(DESTDIR)/$(PREFIX)/share/iaito/translations"
$(MAKE) install-man
uninstall:
ifeq ($(shell uname),Darwin)
rm -rf $(DESTDIR)/Applications/iaito.app
mkdir -p $(DESTDIR)/Applications
rm -rf "$(DESTDIR)/usr/local/bin/iaito"
rm -rf "$(DESTDIR)/$(PREFIX)/bin/iaito"
else
rm -rf "$(DESTDIR)/$(PREFIX)/share/iaito"
rm -rf "$(DESTDIR)/$(PREFIX)/bin/iaito"
endif
rm -f "${DESTDIR}$(MANDIR)/man1/iaito.1"
user-install:
user-install: build
ifeq ($(shell uname),Darwin)
rm -rf ${HOME}/Applications/iaito.app
mkdir -p ${HOME}/Applications
cp -rf build/iaito.app ${HOME}/Applications/iaito.app
else
$(MAKE) -C build install INSTALL_ROOT=/ PREFIX=${HOME}/.local
endif
$(MAKE) install-man DESTDIR=/ PREFIX=${HOME}/.local MANDIR=${HOME}/.local/share/man
user-uninstall:
$(MAKE) uninstall DESTDIR=/ PREFIX=${HOME}/.local MANDIR=${HOME}/.local/share/man
run:
rarun2 libpath=$(shell r2 -H R2_LIBDIR) program=$(BIN)
src/translations/README.md:
git clone https://github.com/radareorg/iaito-translations.git src/translations
install-translations: src/translations/README.md
$(MAKE) -C src/translations install PREFIX="$(DESTDIR)/$(PREFIX)"
user-install-translations: src/translations/README.md
$(MAKE) -C src/translations user-install
+25 -1
View File
@@ -23,6 +23,30 @@ iaito is the official graphical interface for radare2, a libre reverse engineeri
There are automated CI builds and [releases](https://github.com/radareorg/iaito/releases) of iaito for Linux, macOS and Windows.
<a href='https://flathub.org/apps/details/org.radare.iaito'><img width='120' alt='Download on Flathub' src='https://flathub.org/assets/badges/flathub-badge-en.png'/></a>
### Translations
Note: The flatpak/flathub version already ships the translations as an optional extension.
To install translations please download latest version from [iaito-translations](https://github.com/radareorg/iaito-translations) repo.
To install in your home directory, run the following:
```sh
$ git clone https://github.com/radareorg/iaito-translations.git
$ cd iaito-translations
$ make user-install
```
Alternatively, it this project makefile can be used to install them:
```sh
$ make user-install-translations
OR
$ make install-translations # to install to system
```
## Source Builds
### Dependencies
@@ -56,7 +80,7 @@ make
make run
```
To install the app and the translations in your home:
To install the app in your home:
```sh
make install
-121
View File
@@ -1,121 +0,0 @@
#!/bin/sh
# This script is a work in progress
#### Constants ####
ERR=0
#### User variables ####
BUILD="$(pwd)/build"
QMAKE_CONF=$*
ROOT_DIR=$(pwd)
check_r2() {
r2 -v >/dev/null 2>&1
if [ $? = 0 ]; then
R2COMMIT=$(r2 -v | tail -n1 | sed "s,commit: \\(.*\\) build.*,\\1,")
SUBMODULE=$(git submodule | grep "radare2" | awk '{print $1}')
if [ "$R2COMMIT" = "$SUBMODULE" ]; then
return 0
fi
return 0
fi
return 1
}
find_qmake() {
qmakepath=$(command -v qmake-qt5)
if [ -z "$qmakepath" ]; then
qmakepath=$(command -v qmake)
fi
if [ -z "$qmakepath" ]; then
echo "You need qmake to build Iaito."
echo "Please make sure qmake is in your PATH environment variable."
exit 1
fi
echo "$qmakepath"
}
find_lrelease() {
lreleasepath=$(command -v lrelease-qt5)
if [ -z "$lreleasepath" ]; then
lreleasepath=$(command -v lrelease)
fi
if [ -z "$lreleasepath" ]; then
echo "You need lrelease to build Iaito."
echo "Please make sure lrelease is in your PATH environment variable."
exit 1
fi
echo "$lreleasepath"
}
find_gmake() {
gmakepath=$(command -v gmake)
if [ -z "$gmakepath" ]; then
gmakepath=$(command -v make)
fi
${gmakepath} --help 2>&1 | grep -q gnu
if [ $? != 0 ]; then
echo "You need GNU make to build Iaito."
echo "Please make sure gmake is in your PATH environment variable."
exit 1
fi
echo "$gmakepath"
}
prepare_breakpad() {
OS="$(uname -s)"
if [ -z "$OS" ]; then
echo "Could not identify OS, OSTYPE var is empty. You can try to disable breakpad to avoid this error."
exit 1
fi
if [ "$OS" = "Linux" ]; then
. $ROOT_DIR/scripts/prepare_breakpad_linux.sh
export PKG_CONFIG_PATH="$CUSTOM_BREAKPAD_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH"
elif [ "$OS" = "Darwin" ]; then
. $ROOT_DIR/scripts/prepare_breakpad_macos.sh
fi
}
# Build radare2
bash build_radare2.sh || exit 1
# Create translations
$(find_lrelease) ./src/Iaito.pro
# Build
if [ "${QMAKE_CONF#*IAITO_ENABLE_CRASH_REPORTS=true}" != "$QMAKE_CONF" ]; then
prepare_breakpad
fi
mkdir -p "$BUILD"
cd "$BUILD" || exit 1
$(find_qmake) ../src/Iaito.pro "$QMAKE_CONF"
$(find_gmake) -j4
ERR=$((ERR+$?))
# Move translations
mkdir -p "$(pwd)/translations"
find "$ROOT_DIR/src/translations" -maxdepth 1 -type f | grep -e "cutter_..\.qm" -e "iaito_..\.qm" | while read -r SRC_FILE; do
mv "$SRC_FILE" "$(pwd)/translations"
done
# Finish
if [ ${ERR} -gt 0 ]; then
echo "Something went wrong!"
else
echo "Build complete."
printf "This build of Iaito will be installed. Do you agree? [Y/n] "
read -r answer
if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
$(find_gmake) install
else
echo "Binary available at $BUILD/iaito"
fi
if [ -x '/usr/local/bin/iaito.app/Contents/MacOS/iaito' ]; then
ln -fs '/usr/local/bin/iaito.app/Contents/MacOS/iaito' '/usr/local/bin/iaito'
fi
fi
cd ..
-24
View File
@@ -1,24 +0,0 @@
#!/bin/sh
r2 -v >/dev/null 2>&1
if [ $? -eq 0 ]; then
echo "Correct radare2 version found, skipping..."
exit 0
fi
printf "A (new?) version of radare2 will be installed. Do you agree? [Y/n] "
read -r answer
case "$answer" in
""|y|Y)
R2PREFIX=${1:-"/usr"}
if [ ! -d "./radare2" ]; then
git clone --recurse-submodules https://github.com/radareorg/radare2
fi
cd radare2 || exit 1
./sys/install.sh "$R2PREFIX"
cd ..
;;
*)
echo "Sorry but you can't move forward without r2 installed"
exit 1
esac
+5
View File
@@ -5,3 +5,8 @@ LRELEASE=@LRELEASE@
WANT_PYTHON=@WANT_PYTHON@
WANT_PYTHON_BINDINGS=@WANT_PYTHON_BINDINGS@
WANT_CRASH_REPORTS=@WANT_CRASH_REPORTS@
DESTDIR?=
MANDIR=@MANDIR@
INSTALL=@INSTALL@
INSTALL_MAN=@INSTALL_MAN@
Vendored
+8 -19
View File
@@ -18,9 +18,6 @@ control_c() {
exit 1
}
trap control_c 2
WANT_PYTHON=0
WANT_PYTHON_BINDINGS=0
WANT_CRASH_REPORTS=0
split_host() {
S="$"
while : ; do
@@ -112,12 +109,12 @@ done
: ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s}
: ${INSTALL_MAN:=${INSTALL} -m 444}
: ${INSTALL_LIB:=${INSTALL} -m 755 -c}
PKGNAME='iaito' ; VERSION='5.7.2' ; VERSION_MAJOR=5; VERSION_MINOR=7; VERSION_PATCH=2; VERSION_NUMBER=50702; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
PKGNAME='iaito' ; VERSION='5.7.6' ; VERSION_MAJOR=5; VERSION_MINOR=7; VERSION_PATCH=6; VERSION_NUMBER=50706; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
}
show_usage() {
cat <<EOF2
'configure' configures iaito-5.7.2 to adapt to many kinds of systems.
'configure' configures iaito-5.7.6 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
@@ -159,13 +156,6 @@ System types:
--target=TARGET configure for building compilers for TARGET [HOST]
EOF2
printf "
Optional Features:
--with-python build with support for Python
--with-python-bindings
build with Python bindings
--with-crash-reports handle crashes nicely
"
printf "
Some influential environment variables:
CXX C++ compiler command
@@ -196,10 +186,10 @@ ocho() {
show_version() {
if [ "$QUIET" = 1 ]; then
echo "5.7.2"
echo "5.7.6"
exit 0
fi
echo "iaito-5.7.2 configuration script done with acr v2.0.0.
echo "iaito-5.7.6 configuration script done with acr v2.0.0.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
@@ -228,10 +218,9 @@ case $flag in
show_version ; ;;
-r|--r|--report)
echo "PKGNAME: iaito"
echo "VERSION: 5.7.2"
echo "VERSION: 5.7.6"
echo "LANGS: c++"
echo "PKG-CONFIG: r_core"
echo "FLAGS: --with-python --with-python-bindings --with-crash-reports"
exit 0
;;
--cache-file)
@@ -281,9 +270,6 @@ echo "FLAGS: --with-python --with-python-bindings --with-crash-reports"
--mandir)
MANDIR="$value"; ;;
"--with-python") WANT_PYTHON="1"; ;;
"--with-python-bindings") WANT_PYTHON_BINDINGS="1"; ;;
"--with-crash-reports") WANT_CRASH_REPORTS="1"; ;;
*) if [ "$value" ]; then eval "`echo $flag2=$value`" ;
else echo ; echo "WARNING: Unknown flag '$flag'." >&2 ; echo ; fi ;;
esac
@@ -471,6 +457,9 @@ echo no
fi
echo "error: This program is required." >&2
exit 1 ; fi
WANT_PYTHON="0"
WANT_PYTHON_BINDINGS="0"
WANT_CRASH_REPORTS="0"
SEDFLAGS=" -e '"
COUNT=0
for A in ${ENVWORDS} ; do
+6 -1
View File
@@ -1,5 +1,5 @@
PKGNAME iaito
VERSION 5.7.2
VERSION 5.7.6
CONTACT pancake ; [email protected]
LANG_CXX!
@@ -10,8 +10,13 @@ PKGCFG! R2_CFLAGS R2_LDFLAGS r_core
CHKPRG! QMAKE qmake
CHKPRG! LRELEASE lrelease
WANT_PYTHON = 0 ;
WANT_PYTHON_BINDINGS = 0 ;
WANT_CRASH_REPORTS = 0 ;
((
ARG_WITH WANT_PYTHON python build with support for Python ;
ARG_WITH WANT_PYTHON_BINDINGS python-bindings build with Python bindings ;
ARG_WITH WANT_CRASH_REPORTS crash-reports handle crashes nicely ;
))
SUBDIRS config.mk ;
+3
View File
@@ -15,6 +15,9 @@ SET "BUILDDIR=build_%PLATFORM%"
ECHO Prepare translations
IF NOT EXIST "src\translations\NUL" (
git clone https://github.com/radareorg/iaito-translations.git src/translations
)
FOR %%i in (src\translations\*.ts) DO lrelease %%i
ECHO Preparing directory
+1 -1
View File
@@ -19,7 +19,7 @@ all:
$(MAKE) deb
root:
cd ../../.. && $(MAKE) && $(MAKE) install PREFIX=/usr DESTDIR=/tmp/iaito-deb
cd ../../.. && $(MAKE) && $(MAKE) install install-translations PREFIX=/usr DESTDIR=/tmp/iaito-deb
mv /tmp/iaito-deb root
include ../deb_hand.mak
+1 -2
View File
@@ -31,9 +31,8 @@ fi
export CFLAGS=-O2
if [ "$SKIPBUILD" = 0 ]; then
./configure --prefix="${PREFIX}" || exit 1
make -C .. translations
fi
${MAKE} install PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
${MAKE} install install-translations PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
mkdir -p "${DST}"
echo "DST=$DST"
if [ -d "${SRC}" ]; then
+1 -2
View File
@@ -36,9 +36,8 @@ fi
export CFLAGS=-O2
if [ "$SKIPBUILD" = 0 ]; then
./configure --prefix="${PREFIX}" || exit 1
make -C .. translations
fi
${MAKE} install PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
${MAKE} install install-translations PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
mkdir -p "${DST}"
echo "DST=$DST"
if [ -d "${SRC}" ]; then
+1 -1
View File
@@ -24,7 +24,7 @@ RUN apk add --no-cache \
unzip \
zip \
wget && \
git clone --recurse-submodules https://github.com/radareorg/iaito.git /opt/iaito && \
git clone https://github.com/radareorg/iaito.git /opt/iaito && \
git clone --recurse-submodules https://github.com/radareorg/radare2 /opt/radare2 && \
cd /opt/radare2 && ./sys/install.sh /usr && \
cd /opt/iaito && sh configure && make
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
git submodule update --init
+1 -1
View File
@@ -12,7 +12,7 @@ log "Script started"
# Update submodule
log "Updating translations..."
cd ${TRAVIS_BUILD_DIR}/src
git submodule update translations
[ -d translations ] || git clone git clone https://github.com/radareorg/iaito-translations.git translations
cd translations
git pull origin master
+13 -34
View File
@@ -4,7 +4,7 @@ TARGET = iaito
IAITO_VERSION_MAJOR = 5
IAITO_VERSION_MINOR = 7
IAITO_VERSION_PATCH = 2
IAITO_VERSION_PATCH = 8
CONFIG += sdk_no_version_check
@@ -16,8 +16,8 @@ unix:QMAKE_LFLAGS += "-Wl,-rpath,/usr/local/lib"
# unix:QMAKE_LFLAGS += "-fsanitize=thread"
# QMAKE_CXXFLAGS += -fsanitize=thread
QMAKE_CXXFLAGS += -g -O0
# QMAKE_CXXFLAGS += -O0 -fsanitize=address
# QMAKE_LFLAGS += -fsanitize=address
#QMAKE_CXXFLAGS += -O0 -fsanitize=address
#QMAKE_LFLAGS += -fsanitize=address
VERSION = $${IAITO_VERSION_MAJOR}.$${IAITO_VERSION_MINOR}.$${IAITO_VERSION_PATCH}
@@ -26,30 +26,6 @@ VERSION = $${IAITO_VERSION_MAJOR}.$${IAITO_VERSION_MINOR}.$${IAITO_VERSION_PATCH
lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5")
# Doesnt build for Qt6 yet... but will do soon
TRANSLATIONS += translations/ar/iaito_ar.ts \
translations/ca/iaito_ca.ts \
translations/de/iaito_de.ts \
translations/es-ES/iaito_es.ts \
translations/eo/iaito_eo.ts \
translations/eu/iaito_eu.ts \
translations/fa/iaito_fa.ts \
translations/gl/iaito_gl.ts \
translations/fr/iaito_fr.ts \
translations/he/iaito_he.ts \
translations/hi/iaito_hi.ts \
translations/it/iaito_it.ts \
translations/ja/iaito_ja.ts \
translations/nl/iaito_nl.ts \
translations/pt-PT/iaito_pt.ts \
translations/ro/iaito_ro.ts \
translations/ru/iaito_ru.ts \
translations/tr/iaito_tr.ts \
translations/tp/iaito_tp.ts \
translations/zh-CN/iaito_zh.ts
# translations/ko/iaito_ko.ts problems with fonts
# translations/pt-BR/iaito_pt.ts #2321 handling multiple versions of a language
# Icon for OS X
ICON = img/iaito-o.icns
@@ -84,25 +60,28 @@ equals(IAITO_R2GHIDRA_STATIC, true) CONFIG += IAITO_R2GHIDRA_STATIC
DEFINES += IAITO_SOURCE_BUILD
# crash reports and python code has been removed and its unmaintained,
# so let's just disable the messages that are printed out
IAITO_ENABLE_CRASH_REPORTS {
message("Crash report support enabled.")
DEFINES += IAITO_ENABLE_CRASH_REPORTS
} else {
message("Crash report support disabled.")
# message("Crash report support disabled.")
}
IAITO_ENABLE_PYTHON {
message("Python enabled.")
DEFINES += IAITO_ENABLE_PYTHON
} else {
message("Python disabled.")
# message("Python disabled.")
}
IAITO_ENABLE_PYTHON_BINDINGS {
message("Python Bindings enabled.")
DEFINES += IAITO_ENABLE_PYTHON_BINDINGS
} else {
message("Python Bindings disabled. (requires IAITO_ENABLE_PYTHON=true)")
# message("Python Bindings disabled. (requires IAITO_ENABLE_PYTHON=true)")
}
win32:defined(IAITO_DEPS_DIR, var) {
@@ -719,10 +698,10 @@ unix {
PREFIX = /usr/local
}
icon_file = img/iaito-o.svg
icon_file = img/org.radare.iaito.svg
share_pixmaps.path = $$PREFIX/share/pixmaps
share_pixmaps.files = $$icon_file
share_icon.path = $$PREFIX/share/icons/hicolor/scalable/apps
share_icon.files = $$icon_file
desktop_file = org.radare.iaito.desktop
@@ -743,7 +722,7 @@ unix {
# built-in no need for files atm
target.path = $$PREFIX/bin
INSTALLS += target share_appdata share_applications share_pixmaps
INSTALLS += target share_appdata share_applications share_icon
# Triggered for example by 'qmake APPIMAGE=1'
!isEmpty(APPIMAGE){
+2 -2
View File
@@ -343,8 +343,8 @@ bool IaitoApplication::parseCommandLineOptions()
QCommandLineOption analOption({"A", "analysis"},
QObject::tr("Automatically open file and optionally start analysis. "
"Needs filename to be specified. May be a value between 0 and 2:"
" 0 = no analysis, 1 = aaa, 2 = aaaa (experimental)"),
"Needs filename to be specified. May be a value between 0 and 3:"
" 0 = no analysis, 1 = aa, 2 = aaa, 3 = aaaa (slow)"),
QObject::tr("level"));
cmd_parser.addOption(analOption);
-1
View File
@@ -36,7 +36,6 @@ void AnalTask::runTask()
if (options.writeEnabled) {
perms |= R_PERM_W;
emit Core()->ioModeChanged();
}
// Demangle (must be before file Core()->loadFile)
+1 -1
View File
@@ -31,7 +31,7 @@ void openIssue()
type = "N/A";
}
url =
"https://github.com/radareorg/cutter/issues/new?&body=**Environment information**\n* Operating System: "
"https://github.com/radareorg/iaito/issues/new?&body=**Environment information**\n* Operating System: "
+ osInfo + "\n* Iaito version: " + IAITO_VERSION_FULL +
"\n* File format: " + format + "\n * Arch: " + arch + "\n * Type: " + type +
"\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\n"
+16 -11
View File
@@ -59,22 +59,27 @@ const QStringList ColorThemeWorker::radare2UnusedOptions = {
ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent)
{
char* szThemes = r_str_home(R2_HOME_THEMES);
#if R2_VERSION_NUMBER < 50709
char* szThemes = r_str_home (R2_HOME_THEMES);
#else
char* szThemes = r_xdg_datadir ("cons");
#endif
customR2ThemesLocationPath = szThemes;
r_mem_free(szThemes);
if (!QDir(customR2ThemesLocationPath).exists()) {
QDir().mkpath(customR2ThemesLocationPath);
r_mem_free (szThemes);
if (!QDir (customR2ThemesLocationPath).exists ()) {
QDir().mkpath (customR2ThemesLocationPath);
}
QDir currDir { QStringLiteral("%1%2%3")
.arg(r_sys_prefix(nullptr))
.arg(R_SYS_DIR)
.arg(R2_THEMES)
QDir currDir {
QStringLiteral("%1%2%3")
.arg(r_sys_prefix(nullptr))
.arg(R_SYS_DIR)
.arg(R2_THEMES)
};
if (currDir.exists()) {
standardR2ThemesLocationPath = currDir.absolutePath();
if (currDir.exists ()) {
standardR2ThemesLocationPath = currDir.absolutePath ();
} else {
QMessageBox::critical(nullptr,
QMessageBox::critical (nullptr,
tr("Standard themes not found"),
tr("The radare2 standard themes could not be found in '%1'. "
"Most likely, radare2 is not properly installed.")
+3 -3
View File
@@ -130,7 +130,7 @@ static const QHash<QString, QVariant> asmOptions = {
{ "emu.str", true},
{ "asm.cmt.right", true },
{ "asm.cmt.col", 60 },
{ "asm.var.summary", false },
{ "asm.var.summary", 0 },
{ "asm.bytes", false },
{ "asm.size", false },
{ "asm.bytes.space", false },
@@ -147,8 +147,8 @@ static const QHash<QString, QVariant> asmOptions = {
{ "asm.marks", false },
{ "asm.refptr", false },
{ "asm.flags.real", true },
{ "asm.reloff", false },
{ "asm.reloff.flags", false },
{ "asm.offset.relative",false },
{ "asm.offset.flags", false },
{ "esil.breakoninvalid",true },
{ "graph.offset", false}
};
+46
View File
@@ -28,6 +28,52 @@ bool R2DecDecompiler::isAvailable()
return Core()->cmdList("e cmd.pdc=?").contains(QStringLiteral("pdd"));
}
RCodeMeta *R2DecDecompiler::decompileSync(RVA addr)
{
// auto document = Core()->cmdj("pddj @ " + QString::number(addr));
auto document = Core()->cmdjAt("pddj", addr);
QJsonObject json = document.object();
if (json.isEmpty()) {
// emit finished(Decompiler::makeWarning(tr("Failed to parse JSON from pdc")));
return NULL;
}
// note that r2dec doesnt have the "text" object like pdc does. so we cant reuse code
RCodeMeta *code = r_codemeta_new (nullptr);
QString codeString = "";
for (const auto line : json["log"].toArray()) {
if (!line.isString()) {
continue;
}
codeString.append(line.toString() + "\n");
}
QJsonArray linesArray = json["lines"].toArray();
for (const QJsonValueRef line : linesArray) {
QJsonObject lineObject = line.toObject();
if (lineObject.isEmpty()) {
continue;
}
RCodeMetaItem *mi = r_codemeta_item_new ();
mi->start = codeString.length();
codeString.append(lineObject["str"].toString() + "\n");
mi->end = codeString.length();
bool ok;
mi->type = R_CODEMETA_TYPE_OFFSET;
mi->offset.offset = lineObject["offset"].toVariant().toULongLong(&ok);
r_codemeta_add_item(code, mi);
}
for (const auto line : json["errors"].toArray()) {
if (!line.isString()) {
continue;
}
codeString.append(line.toString() + "\n");
}
std::string tmp = codeString.toStdString();
code->code = strdup(tmp.c_str());
return code;
}
void R2DecDecompiler::decompileAt(RVA addr)
{
if (task) {
+2
View File
@@ -30,6 +30,7 @@ public:
virtual bool isCancelable() { return false; }
virtual void decompileAt(RVA addr) =0;
virtual RCodeMeta *decompileSync(RVA addr) =0;
virtual void cancel() {}
signals:
@@ -45,6 +46,7 @@ private:
public:
explicit R2DecDecompiler(QObject *parent = nullptr);
RCodeMeta *decompileSync(RVA addr) override;
void decompileAt(RVA addr) override;
bool isRunning() override { return task != nullptr; }
+4
View File
@@ -18,7 +18,11 @@ signals:
protected:
void runTask() override
{
#if MONOTHREAD
QList<FunctionDescription> functions;
#else
auto functions = Core()->getAllFunctions();
#endif
emit fetchFinished(functions);
}
};
+39
View File
@@ -23,6 +23,45 @@ bool R2GhidraCmdDecompiler::isAvailable()
return Core()->cmdList("e cmd.pdc=?").contains(QStringLiteral("pdg"));
}
RCodeMeta *R2GhidraCmdDecompiler::decompileSync(RVA addr)
{
auto document = Core()->cmdj("pdgj @ " + QString::number(addr));
QJsonObject json = document.object();
if (json.isEmpty()) {
// emit finished(Decompiler::makeWarning(tr("Failed to parse JSON from pdc")));
return NULL;
}
QString codeString = json["code"].toString();
RCodeMeta *code = r_codemeta_new (nullptr);
QJsonArray linesArray = json["annotations"].toArray();
for (const QJsonValueRef line : linesArray) {
QJsonObject lineObject = line.toObject();
if (lineObject.isEmpty()) {
continue;
}
if (lineObject["type"].toString() != "offset") {
continue;
}
RCodeMetaItem *mi = r_codemeta_item_new ();
mi->start = lineObject["start"].toInt();
mi->end = lineObject["end"].toInt();
bool ok;
mi->type = R_CODEMETA_TYPE_OFFSET;
mi->offset.offset = lineObject["offset"].toVariant().toULongLong(&ok);
r_codemeta_add_item(code, mi);
}
for (const auto line : json["errors"].toArray()) {
if (!line.isString()) {
continue;
}
codeString.append(line.toString() + "\n");
}
std::string tmp = codeString.toStdString();
code->code = strdup(tmp.c_str());
return code;
}
void R2GhidraCmdDecompiler::decompileAt(RVA addr)
{
if (task) {
+1
View File
@@ -17,6 +17,7 @@ private:
public:
explicit R2GhidraCmdDecompiler(QObject *parent = nullptr);
RCodeMeta *decompileSync(RVA addr) override;
void decompileAt(RVA addr) override;
bool isRunning() override { return task != nullptr; }
+40
View File
@@ -23,6 +23,46 @@ bool R2pdcCmdDecompiler::isAvailable()
return Core()->cmdList("e cmd.pdc=?").contains(QStringLiteral("pdc"));
}
RCodeMeta *R2pdcCmdDecompiler::decompileSync(RVA addr)
{
auto document = Core()->cmdj("pdcj @ " + QString::number(addr));
QJsonObject json = document.object();
if (json.isEmpty()) {
// emit finished(Decompiler::makeWarning(tr("Failed to parse JSON from pdc")));
return NULL;
}
QString codeString = json["code"].toString();
RCodeMeta *code = r_codemeta_new (nullptr);
QJsonArray linesArray = json["annotations"].toArray();
for (const QJsonValueRef line : linesArray) {
QJsonObject lineObject = line.toObject();
if (lineObject.isEmpty()) {
continue;
}
if (lineObject["type"].toString() != "offset") {
continue;
}
RCodeMetaItem *mi = r_codemeta_item_new ();
mi->start = lineObject["start"].toInt();
mi->end = lineObject["end"].toInt();
bool ok;
mi->type = R_CODEMETA_TYPE_OFFSET;
mi->offset.offset = lineObject["offset"].toVariant().toULongLong(&ok);
r_codemeta_add_item(code, mi);
}
for (const auto line : json["errors"].toArray()) {
if (!line.isString()) {
continue;
}
codeString.append(line.toString() + "\n");
}
std::string tmp = codeString.toStdString();
code->code = strdup(tmp.c_str());
return code;
}
// thready, crashing, unsafe
void R2pdcCmdDecompiler::decompileAt(RVA addr)
{
if (task) {
+1
View File
@@ -18,6 +18,7 @@ private:
public:
explicit R2pdcCmdDecompiler(QObject *parent = nullptr);
void decompileAt(RVA addr) override;
RCodeMeta *decompileSync(RVA addr) override;
bool isRunning() override { return task != nullptr; }
+39
View File
@@ -23,6 +23,45 @@ bool R2retdecDecompiler::isAvailable()
return Core()->cmdList("e cmd.pdc=?").contains(QStringLiteral("pdz"));
}
RCodeMeta *R2retdecDecompiler::decompileSync(RVA addr)
{
auto document = Core()->cmdj("pdzj @ " + QString::number(addr));
QJsonObject json = document.object();
if (json.isEmpty()) {
// emit finished(Decompiler::makeWarning(tr("Failed to parse JSON from pdc")));
return NULL;
}
QString codeString = json["code"].toString();
RCodeMeta *code = r_codemeta_new (nullptr);
QJsonArray linesArray = json["annotations"].toArray();
for (const QJsonValueRef line : linesArray) {
QJsonObject lineObject = line.toObject();
if (lineObject.isEmpty()) {
continue;
}
if (lineObject["type"].toString() != "offset") {
continue;
}
RCodeMetaItem *mi = r_codemeta_item_new ();
mi->start = lineObject["start"].toInt();
mi->end = lineObject["end"].toInt();
bool ok;
mi->type = R_CODEMETA_TYPE_OFFSET;
mi->offset.offset = lineObject["offset"].toVariant().toULongLong(&ok);
r_codemeta_add_item(code, mi);
}
for (const auto line : json["errors"].toArray()) {
if (!line.isString()) {
continue;
}
codeString.append(line.toString() + "\n");
}
std::string tmp = codeString.toStdString();
code->code = strdup(tmp.c_str());
return code;
}
void R2retdecDecompiler::decompileAt(RVA addr)
{
if (task) {
+2
View File
@@ -17,6 +17,8 @@ private:
public:
explicit R2retdecDecompiler(QObject *parent = nullptr);
RCodeMeta *decompileSync(RVA addr) override;
void decompileAt(RVA addr) override;
bool isRunning() override { return task != nullptr; }
+6 -1
View File
@@ -79,13 +79,18 @@ QStringList Iaito::getTranslationsDirectories()
auto result = locateAll(QStandardPaths::DataLocation, "translations",
QStandardPaths::LocateDirectory);
// loading from iaito home
char *home = r_str_home(".local/share/iaito/translations");
#if R2_VERSION_NUMBER < 50709
char *home = r_str_home (".local/share/iaito/translations");
#else
char* home = r_xdg_datadir ("iaito/translations");
#endif
result << home;
printf ("Loading translations path %s\n", home);
free (home);
// loading from system
result << "/usr/local/share/iaito/translations";
result << "/usr/share/iaito/translations";
result << "/app/share/iaito/translations";
// loading from qt
auto qtpath = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
result << qtpath;
+4
View File
@@ -18,7 +18,11 @@ signals:
protected:
void runTask() override
{
#if MONOTHREAD
QList<StringDescription> strings;
#else
auto strings = Core()->getAllStrings();
#endif
emit stringSearchFinished(strings);
}
};
+5 -5
View File
@@ -37,7 +37,7 @@ UpdateWorker::UpdateWorker(QObject *parent) :
void UpdateWorker::checkCurrentVersion(time_t timeoutMs)
{
QUrl url("https://api.github.com/repos/radareorg/cutter/releases/latest");
QUrl url("https://api.github.com/repos/radareorg/iaito/releases/latest");
QNetworkRequest request;
request.setUrl(url);
@@ -57,8 +57,8 @@ void UpdateWorker::download(QString filename, QString version)
downloadFile.open(QIODevice::WriteOnly);
QNetworkRequest request;
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
QUrl url(QString("https://github.com/radareorg/cutter/releases/"
request.setAttribute(QNetworkRequest::RedirectPolicyAttribute, true);
QUrl url(QString("https://github.com/radareorg/iaito/releases/"
"download/v%1/%2").arg(version).arg(getRepositoryFileName()));
request.setUrl(url);
@@ -77,8 +77,8 @@ void UpdateWorker::showUpdateDialog(bool showDontCheckForUpdatesButton)
+ "<b>" + tr("Current version:") + "</b> " IAITO_VERSION_FULL "<br/>"
+ "<b>" + tr("Latest version:") + "</b> " + latestVersion.toString() + "<br/><br/>"
+ tr("For update, please check the link:<br/>")
+ QString("<a href=\"https://github.com/radareorg/cutter/releases/tag/v%1\">"
"https://github.com/radareorg/cutter/releases/tag/v%1</a><br/>").arg(latestVersion.toString())
+ QString("<a href=\"https://github.com/radareorg/iaito/releases/tag/v%1\">"
"https://github.com/radareorg/iaito/releases/tag/v%1</a><br/>").arg(latestVersion.toString())
+ tr("or click \"Download\" to download latest version of Iaito."));
if (showDontCheckForUpdatesButton) {
mb.setStandardButtons(QMessageBox::Save | QMessageBox::Reset | QMessageBox::Ok);
+57 -27
View File
@@ -116,7 +116,7 @@ namespace RJsonKey {
static void updateOwnedCharPtr(char *&variable, const QString &newValue)
{
auto data = newValue.toUtf8();
R_FREE(variable)
r_mem_free (variable);
variable = strdup(data.data());
}
@@ -146,7 +146,7 @@ RCoreLocked::~RCoreLocked()
{
core->coreLockDepth--;
#if R2_VERSION_NUMBER < 50609
assert(core->coreLockDepth > 0);
assert(core->coreLockDepth >= 0);
if (core->coreLockDepth == 0) {
core->coreBed = r_cons_sleep_begin();
}
@@ -364,6 +364,22 @@ QString IaitoCore::sanitizeStringForCommand(QString s)
return s.replace(regexp, QStringLiteral("_"));
}
QString IaitoCore::cmdHtml(const char *str)
{
CORE_LOCK();
RVA offset = core->offset;
r_core_cmd0 (core, "e scr.html=true;e scr.color=2");
char *res = r_core_cmd_str(core, str);
r_core_cmd0 (core, "e scr.html=false;e scr.color=0");
QString o = fromOwnedCharPtr(res);
if (offset != core->offset) {
updateSeek();
}
return o;
}
QString IaitoCore::cmd(const char *str)
{
CORE_LOCK();
@@ -459,11 +475,11 @@ void IaitoCore::cmdRaw0(const QString &s) {
(void)r_core_cmd0 (core_, s.toStdString().c_str());
}
QString IaitoCore::cmdRaw(const char *cmd)
QString IaitoCore::cmdRaw(const char *rcmd)
{
QString res;
#if 1
res = r_core_cmd_str (core_, cmd);
res = cmd (rcmd);
#else
CORE_LOCK();
r_cons_push ();
@@ -482,26 +498,18 @@ QString IaitoCore::cmdRaw(const char *cmd)
QJsonDocument IaitoCore::cmdj(const char *str)
{
char *res;
{
CORE_LOCK();
res = r_core_cmd_str(core, str);
}
CORE_LOCK();
char *res = r_core_cmd_str(core, str);
QJsonDocument doc = parseJson(res, str);
r_mem_free(res);
return doc;
}
QJsonDocument IaitoCore::cmdjAt(const char *str, RVA address)
{
QJsonDocument res;
RVA oldOffset = getOffset();
seekSilent(address);
res = cmdj(str);
QJsonDocument res = cmdj(str);
seekSilent(oldOffset);
return res;
}
@@ -516,10 +524,14 @@ QString IaitoCore::cmdTask(const QString &str)
QJsonDocument IaitoCore::cmdjTask(const QString &str)
{
#if MONOTHREAD
return cmdj(str);
#else
R2Task task(str);
task.startTask();
task.joinTask();
return parseJson(task.getResultRaw(), str);
#endif
}
QJsonDocument IaitoCore::parseJson(const char *res, const char *cmd)
@@ -592,28 +604,27 @@ bool IaitoCore::loadFile(QString path, ut64 baddr, ut64 mapaddr, int perms, int
bool bincache, bool loadbin, const QString &forceBinPlugin)
{
CORE_LOCK();
RIODesc *f;
r_config_set_i(core->config, "io.va", va);
r_config_set_i(core->config, "bin.cache", bincache);
r_config_set_i (core->config, "io.va", va);
r_config_set_b (core->config, "bin.cache", bincache);
f = r_core_file_open(core, path.toUtf8().constData(), perms, mapaddr);
RIODesc *f = r_core_file_open (core, path.toUtf8().constData(), perms, mapaddr);
if (!f) {
eprintf("r_core_file_open failed\n");
R_LOG_ERROR ("r_core_file_open failed");
return false;
}
if (!forceBinPlugin.isNull()) {
r_bin_force_plugin(r_core_get_bin(core), forceBinPlugin.toUtf8().constData());
r_bin_force_plugin (r_core_get_bin (core), forceBinPlugin.toUtf8().constData());
}
if (loadbin && va) {
if (!r_core_bin_load(core, path.toUtf8().constData(), baddr)) {
eprintf("CANNOT GET RBIN INFO\n");
}
R_LOG_ERROR ("Cannot find rbin information");
}
#if HAVE_MULTIPLE_RBIN_FILES_INSIDE_SELECT_WHICH_ONE
if (!r_core_file_open(core, path.toUtf8(), R_IO_READ | (rw ? R_IO_WRITE : 0, mapaddr))) {
eprintf("Cannot open file\n");
R_LOG_ERROR ("Cannot open file");
} else {
// load RBin information
// XXX only for sub-bins
@@ -1028,7 +1039,7 @@ void IaitoCore::setConfig(const char *k, int v)
void IaitoCore::setConfig(const char *k, bool v)
{
CORE_LOCK();
r_config_set_b(core->config, k, v);
r_config_set_b (core->config, k, v);
}
int IaitoCore::getConfigi(const char *k)
@@ -1445,11 +1456,14 @@ QJsonObject IaitoCore::getAddrRefs(RVA addr, int depth) {
}
// Check if the address points to a register
RFlagItem *fi = r_flag_get_i(core->flags, addr);
RFlagItem *fi = r_flag_get_i (core->flags, addr);
if (fi) {
RRegItem *r = r_reg_get(core->dbg->reg, fi->name, -1);
RRegItem *r = r_reg_get (core->dbg->reg, fi->name, -1);
if (r) {
json["reg"] = r->name;
#if R2_VERSION_NUMBER >= 50709
r_unref (r);
#endif
}
}
@@ -2613,6 +2627,7 @@ QList<ImportDescription> IaitoCore::getAllImports()
CORE_LOCK();
QList<ImportDescription> ret;
#if 0
QJsonArray importsArray = cmdj("iij").array();
for (const QJsonValue value : importsArray) {
@@ -2629,6 +2644,21 @@ QList<ImportDescription> IaitoCore::getAllImports()
ret << import;
}
#else
RBinImport *bi;
RListIter *it;
const RList *imports = r_bin_get_imports(core->bin);
// IaitoRListForeach(core->bin->cur->o->imports, it, RBinImport, bi)
IaitoRListForeach(imports, it, RBinImport, bi) {
QString type = QString(bi->bind) + " " + QString(bi->type);
ImportDescription imp;
//imp.vaddr = bi->vaddr;
imp.name = QString(bi->name);
imp.bind = QString(bi->bind);
imp.type = QString(bi->type);
ret << imp;
}
#endif
return ret;
}
+4
View File
@@ -1,6 +1,9 @@
#ifndef IAITO_H
#define IAITO_H
#define MONOTHREAD 1
// #define MONOTHREAD 0
#include "core/IaitoCommon.h"
#include "core/IaitoDescriptions.h"
#include "common/BasicInstructionHighlighter.h"
@@ -66,6 +69,7 @@ public:
* @note if you want to seek to an address, you should use IaitoCore::seek.
*/
QString cmd(const char *str);
QString cmdHtml(const char *str);
QString cmd(const QString &str) { return cmd(str.toUtf8().constData()); }
/**
* @brief send a command to radare2 asynchronously
+8 -4
View File
@@ -266,7 +266,7 @@ void MainWindow::initUI()
readSettings();
// Display tooltip for the Analyze Program action
ui->actionAnalyze->setToolTip("Analyze the program using radare2's \"aaa\" command");
ui->actionAnalyze->setToolTip("Analyze the program");
ui->menuFile->setToolTipsVisible(true);
}
@@ -667,6 +667,7 @@ void MainWindow::finalizeOpen()
// continue looping in case there is a graph widget
}
}
consoleDock->show();
}
bool MainWindow::saveProject(bool quit)
@@ -1597,7 +1598,7 @@ void MainWindow::on_actionIssue_triggered()
void MainWindow::documentationClicked()
{
QDesktopServices::openUrl(QUrl("https://cutter.re/docs/user-docs"));
QDesktopServices::openUrl(QUrl("https://www.radare.org"));
}
void MainWindow::on_actionRefresh_Panels_triggered()
@@ -1610,10 +1611,12 @@ void MainWindow::on_actionRefresh_Panels_triggered()
*/
void MainWindow::on_actionAnalyze_triggered()
{
auto *analTask = new AnalTask();
#if MONOTHREAD
R_LOG_ERROR ("monothread for auto-reanalysis disabled");
#else
InitialOptions options;
options.analCmd = { {"aaa", "Auto analysis"} };
analTask->setOptions(options);
auto *analTask = new AnalTask();
AsyncTask::Ptr analTaskPtr(analTask);
auto *taskDialog = new AsyncTaskDialog(analTaskPtr);
@@ -1623,6 +1626,7 @@ void MainWindow::on_actionAnalyze_triggered()
connect(analTask, &AnalTask::finished, this, &MainWindow::refreshAll);
Core()->getAsyncTaskManager()->start(analTaskPtr);
#endif
}
void MainWindow::on_actionImportPDB_triggered()
+5 -4
View File
@@ -39,7 +39,7 @@
<x>0</x>
<y>0</y>
<width>1013</width>
<height>22</height>
<height>20</height>
</rect>
</property>
<property name="defaultUp">
@@ -53,8 +53,8 @@
<rect>
<x>2024</x>
<y>127</y>
<width>151</width>
<height>327</height>
<width>161</width>
<height>311</height>
</rect>
</property>
<property name="title">
@@ -129,9 +129,10 @@
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAbout"/>
<addaction name="actionIssue"/>
<addaction name="actionDocumentation"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
+3 -1
View File
@@ -29,6 +29,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
QString aboutString(tr("Version") + " " IAITO_VERSION_FULL "<br/>"
+ tr("Using r2-") + R2_GITTAP + "<br/>"
+ buildQtVersionString()
#if 0
+ "<p><b>" + tr("Optional Features:") + "</b><br/>"
+ QString("Python: %1<br/>").arg(
#ifdef IAITO_ENABLE_PYTHON
@@ -44,11 +45,12 @@ AboutDialog::AboutDialog(QWidget *parent) :
"OFF"
#endif
)
#endif
+ "<h2>" + tr("License") + "</h2>"
+ tr("This Software is released under the GNU General Public License v3.0")
+ "<h2>" + tr("Authors") + "</h2>"
+ tr("Iaito is developed by the community and maintained by its core and development teams.<br/>")
+ tr("Check our <a href='https://github.com/radareorg/cutter/graphs/contributors'>contributors page</a> for the full list of contributors."));
+ tr("Check our <a href='https://github.com/radareorg/iaito/graphs/contributors'>contributors page</a> for the full list of contributors. Or go to <a href='https://www.radare.org/'>www.radare.org</a> for more details."));
ui->label->setText(aboutString);
}
+1 -1
View File
@@ -66,7 +66,7 @@
</sizepolicy>
</property>
<property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;iaito is a free and open-source reverse engineering platform powered by radare2&lt;/span&gt;&lt;/p&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:11pt;&quot;&gt;Read more on &lt;/span&gt;&lt;a href=&quot;https://www.radare.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#2980b9;&quot;&gt;cutter.re&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;&lt;span style=&quot; font-size:11pt; font-weight:600;&quot;&gt;iaito is a free and open-source reverse engineering platform powered by radare2&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
+88 -12
View File
@@ -150,12 +150,14 @@ void InitialOptionsDialog::loadOptions(const InitialOptions &options)
{
if (options.analCmd.isEmpty()) {
analLevel = 0;
} else if (options.analCmd.first().command == "aaa" ) {
} else if (options.analCmd.first().command == "aa" ) {
analLevel = 1;
} else if (options.analCmd.first().command == "aaaa" ) {
} else if (options.analCmd.first().command == "aaa" ) {
analLevel = 2;
} else {
} else if (options.analCmd.first().command == "aaaa" ) {
analLevel = 3;
} else {
analLevel = 4;
AnalysisCommands item;
QList<QString> commands = getAnalysisCommands(options);
foreach (item, analysisCommands){
@@ -273,8 +275,7 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList<QString> adv
options.binLoadAddr = Core()->math(ui->entry_loadOffset->text());
}
options.mapAddr = Core()->math(
ui->entry_mapOffset->text()); // Where to map the file once loaded (-m)
options.mapAddr = Core()->math(ui->entry_mapOffset->text()); // Where to map the file once loaded (-m)
options.arch = getSelectedArch();
options.cpu = getSelectedCPU();
options.bits = getSelectedBits();
@@ -301,12 +302,15 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList<QString> adv
int level = ui->analSlider->value();
switch (level) {
case 1:
options.analCmd = { {"aaa", "Auto analysis"} };
options.analCmd = { {"aa", "Auto analysis"} };
break;
case 2:
options.analCmd = { {"aaaa", "Auto analysis (experimental)"} };
options.analCmd = { {"aaa", "Auto analysis (experimental)"} };
break;
case 3:
options.analCmd = { {"aaaa", "Auto analysis (experimental)"} };
break;
case 4:
options.analCmd = getSelectedAdvancedAnalCmds();
break;
default:
@@ -315,10 +319,10 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList<QString> adv
}
MainWindow *main = this->main;
#if 0
AnalTask *analTask = new AnalTask();
analTask->setOptions(options);
MainWindow *main = this->main;
connect(analTask, &AnalTask::openFileFailed, main, &MainWindow::openNewFileFailed);
connect(analTask, &AsyncTask::finished, main, [analTask, main]() {
if (analTask->getOpenFileFailed()) {
@@ -335,8 +339,78 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList<QString> adv
taskDialog->show();
Core()->getAsyncTaskManager()->start(analTaskPtr);
#endif
done(0);
#if MONOTHREAD
int perms = R_PERM_RX;
if (options.writeEnabled) {
perms |= R_PERM_W;
emit Core()->ioModeChanged();
}
// Demangle (must be before file Core()->loadFile)
Core()->setConfig("bin.demangle", options.demangle);
// Do not reload the file if already loaded
// QJsonArray openedFiles = Core()->getOpenedFiles();
if (true) { // !openedFiles.size() && options.filename.length()) {
bool fileLoaded = Core()->loadFile(options.filename,
options.binLoadAddr,
options.mapAddr,
perms,
options.useVA,
options.loadBinCache,
options.loadBinInfo,
options.forceBinPlugin);
if (!fileLoaded) {
// emit openFileFailed();
return;
}
}
// r_core_bin_load might change asm.bits, so let's set that after the bin is loaded
Core()->setCPU(options.arch, options.cpu, options.bits);
if (!options.os.isNull()) {
Core()->setConfig("asm.os", options.os);
}
if (!options.pdbFile.isNull()) {
// log(tr("Loading PDB file..."));
Core()->loadPDB(options.pdbFile);
}
if (!options.shellcode.isNull() && options.shellcode.size() / 2 > 0) {
// log(tr("Loading shellcode..."));
Core()->cmdRaw("wx " + options.shellcode);
}
if (options.endian != InitialOptions::Endianness::Auto) {
Core()->setEndianness(options.endian == InitialOptions::Endianness::Big);
}
Core()->cmdRaw("fs *");
if (!options.script.isNull()) {
// log(tr("Executing script..."));
Core()->loadScript(options.script);
}
if (!options.analCmd.empty()) {
// log(tr("Executing analysis..."));
for (const CommandDescription &cmd : options.analCmd) {
// log(cmd.description);
// log(cmd.command + " : " + cmd.description);
// use cmd instead of cmdRaw because commands can be unexpected
Core()->cmd(cmd.command);
}
// log(tr("Analysis complete!"));
} else {
// log(tr("Skipping Analysis."));
}
#endif
main->finalizeOpen();
}
void InitialOptionsDialog::on_okButton_clicked()
@@ -357,10 +431,12 @@ QString InitialOptionsDialog::analysisDescription(int level)
case 0:
return tr("No analysis");
case 1:
return tr("Auto-Analysis (aaa)");
return tr("Auto-Analysis (aa)");
case 2:
return tr("Auto-Analysis Experimental (aaaa)");
return tr("Auto-Analysis (aaa)");
case 3:
return tr("Auto-Analysis Experimental (aaaa)");
case 4:
return tr("Advanced");
default:
return tr("Unknown");
@@ -376,7 +452,7 @@ void InitialOptionsDialog::on_analSlider_valueChanged(int value)
} else {
ui->analCheckBox->setChecked(true);
ui->analCheckBox->setText(tr("Analysis: Enabled"));
if (value == 3) {
if (value == 4) {
ui->analoptionsFrame->setVisible(true);
ui->advancedAnlysisLine->setVisible(true);
} else {
+4 -4
View File
@@ -192,7 +192,7 @@
<number>0</number>
</property>
<property name="maximum">
<number>3</number>
<number>4</number>
</property>
<property name="pageStep">
<number>1</number>
@@ -220,9 +220,9 @@
<property name="geometry">
<rect>
<x>0</x>
<y>-275</y>
<width>557</width>
<height>484</height>
<y>0</y>
<width>571</width>
<height>408</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
+16
View File
@@ -55,6 +55,22 @@ R2PluginsDialog::R2PluginsDialog(QWidget *parent) :
}
ui->RAsmTreeWidget->sortByColumn(0, Qt::AscendingOrder);
qhelpers::adjustColumns(ui->RAsmTreeWidget, 0);
// RAnal
for (const auto &plugin : Core()->getRAnalPluginDescriptions()) {
QTreeWidgetItem *item = new QTreeWidgetItem();
item->setText(0, plugin.name);
item->setText(1, plugin.architecture);
item->setText(2, plugin.version);
item->setText(3, plugin.description);
item->setText(4, plugin.license);
item->setText(5, plugin.author);
item->setText(6, plugin.cpus);
ui->RAnalTreeWidget->addTopLevelItem(item);
}
ui->RAnalTreeWidget->sortByColumn(0, Qt::AscendingOrder);
qhelpers::adjustColumns(ui->RAnalTreeWidget, 0);
}
R2PluginsDialog::~R2PluginsDialog()
+56
View File
@@ -188,6 +188,62 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="RAnalTab">
<attribute name="title">
<string>RAnal</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="RAnalLabel">
<property name="text">
<string>Analysis / Architecture plugins</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="RAnalTreeWidget">
<property name="sortingEnabled">
<bool>true</bool>
</property>
<column>
<property name="text">
<string>Name</string>
</property>
</column>
<column>
<property name="text">
<string>Architecture</string>
</property>
</column>
<column>
<property name="text">
<string>Version</string>
</property>
</column>
<column>
<property name="text">
<string>Description</string>
</property>
</column>
<column>
<property name="text">
<string>License</string>
</property>
</column>
<column>
<property name="text">
<string>Author</string>
</property>
</column>
<column>
<property name="text">
<string>CPU's</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
<item>
+1 -1
View File
@@ -315,7 +315,7 @@
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;Join our community:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;GitHub:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://github.com/radareorg/iaito&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0068da;&quot;&gt;github/radareorg&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;Twitter:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://twitter.com/radareorg&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;@radareorg&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;Telegram: &lt;/span&gt;&lt;a href=&quot;https://t.me/radare&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;https://t.me/radare&lt;/span&gt;&lt;/a&gt;&lt;a href=&quot;https://t.me/iaito&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; text-decoration: underline; color:#2980b9;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;IRC: &lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;#radare on &lt;/span&gt;&lt;a href=&quot;irc://irc.freenode.net:6697&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;irc.freenode.net&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;GitHub:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://github.com/radareorg/iaito&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0068da;&quot;&gt;github/radareorg&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;Twitter:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://twitter.com/radareorg&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;@radareorg&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;Telegram: &lt;/span&gt;&lt;a href=&quot;https://t.me/radare&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;https://t.me/radare_side&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt; font-weight:600;&quot;&gt;IRC: &lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:12pt;&quot;&gt;#radare on &lt;/span&gt;&lt;a href=&quot;irc://irc.freenode.net:6697&quot;&gt;&lt;span style=&quot; font-size:12pt; text-decoration: underline; color:#0068da;&quot;&gt;irc.freenode.net&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="textFormat">
<enum>Qt::RichText</enum>
+2 -2
View File
@@ -7,8 +7,8 @@ iaito \- manual page for iaito
.SH DESCRIPTION
A Qt and C++ GUI for radare2 reverse engineering framework.
The iaito is the continuation of the
.UR "https://cutter.re"
.BR "Cutter"
.UR "https://www.radare.org"
.BR "Iaito"
before the fork of
.BR radare2
/
+2
View File
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="194.68mm" height="194.68mm" version="1.1" viewBox="0 0 194.68 194.68" xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><metadata><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/></cc:Work></rdf:RDF></metadata><g transform="translate(-7.7021 -29.663)"><circle cx="105.04" cy="127" r="96.909" fill="#fff" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width=".85678"/><path d="m119.34 109.32c-3e-3 -7e-3 0.15688 0.0182 0.46674 0.0829 0.30986 0.0632 0.49646 0.0814 1.0907 0.24237 0.59444 0.15989 1.0778 0.23402 1.9271 0.51411 0.84939 0.2798 1.59 0.47326 2.6642 0.89118 1.074 0.41793 2.0258 0.78537 3.2935 1.3554 1.2676 0.57003 2.1949 1.0024 3.5866 1.8054 1.3917 0.80304 2.4992 1.424 3.9635 2.4755 1.4645 1.0516 2.6658 1.9352 4.1521 3.2411 1.4862 1.3059 2.6868 2.4971 4.1454 4.0539 1.4586 1.5568 2.517 2.9126 3.8138 4.7726 1.297 1.86 2.3556 3.4579 3.4246 5.5854 1.069 2.1276 2.0226 3.9894 2.8049 6.3363 0.78231 2.347 1.4206 4.5739 1.9884 7.0559 0.56788 2.4821 0.76823 4.8188 0.9701 7.4088 0.20192 2.5899 0.0572 5.0415-0.1314 7.6634-0.18848 2.6218-0.7014 5.1195-1.2855 7.693-0.58413 2.5735-1.4569 5.0497-2.4193 7.4957-0.9624 2.4461-2.1994 4.823-3.5014 7.0706-1.3021 2.2476-2.8853 4.4468-4.4719 6.4378-1.5867 1.991-3.4653 3.9528-5.2709 5.6435-1.8056 1.6907-3.9105 3.3825-5.863 4.7442-1.9527 1.3618-4.2095 2.7816-6.2346 3.8003-2.0252 1.0187-4.2769 2.023-6.2648 2.7955-1.9879 0.77247-4.3946 1.5174-6.322 1.9609-1.9273 0.44358-4.1249 0.89017-5.9121 1.1219-1.7871 0.23184-3.8715 0.42879-5.4766 0.47811-1.6051 0.0494-3.3133 0.029-4.7021 4e-3 -1.3887-0.0254-3.0977-0.2213-4.2411-0.35575-1.1435-0.13445-2.3919-0.32486-3.2729-0.47188-0.88104-0.14681-1.8654-0.34703-2.4661-0.47566-0.60078-0.12865-1.0607-0.22458-1.3696-0.28598-0.30891-0.0611-0.46686-0.0879-0.46377-0.0771 0.0059 0.0181 0.0138 0.0327 0.02178 0.0509 0.0089 0.0181 0.01891 0.0327 0.03015 0.0494 0.01094 0.0146 0.02394 0.0327 0.03784 0.0484 0.0138 0.0145 0.02867 0.0327 0.04483 0.0469 0.01597 0.0146 0.03311 0.029 0.05143 0.0458 0.01813 0.0146 0.03734 0.029 0.05735 0.0447 0.02039 0.0145 0.04099 0.029 0.06267 0.044 0.02177 0.0145 0.04434 0.029 0.06749 0.0433 0.02364 0.0146 0.0471 0.029 0.07173 0.0422 0.02473 0.0145 0.04956 0.029 0.07537 0.0418 0.02621 0.0109 0.05173 0.029 0.07833 0.0411 0.0269 0.0109 0.0536 0.0254 0.08089 0.0407 0.02759 0.0109 0.05488 0.0254 0.08277 0.0403 0.02837 0.0109 0.05597 0.0254 0.08415 0.0403 0.02837 0.0109 0.05666 0.0254 0.08484 0.04 0.02867 0.0109 0.05676 0.0254 0.08503 0.04 0.02867 0.0109 0.05676 0.0254 0.08454 0.04 0.02837 0.0109 0.05607 0.0254 0.08365 0.04 0.02798 0.0109 0.05518 0.0254 0.08218 0.0403 0.02729 0.0109 0.0537 0.0254 0.08001 0.0403 0.0265 0.0109 0.05203 0.0254 0.07725 0.0411 0.02581 0.0109 0.04986 0.029 0.07409 0.0414 0.02433 0.0146 0.04739 0.029 0.07015 0.0421 0.02286 0.0145 0.04464 0.029 0.06582 0.0428 0.02109 0.0145 0.04138 0.029 0.0609 0.0435 0.01922 0.0146 0.03784 0.029 0.05518 0.0447 0.01744 0.0146 0.03379 0.029 0.04927 0.0454 0.01528 0.0146 0.02946 0.029 0.04237 0.0465 0.01271 0.0145 0.02473 0.0327 0.03527 0.0476 0.01015 0.0145 0.01932 0.0327 0.02729 0.049 0.0079 0.0181 0.01419 0.0327 0.01892 0.0506 0.0049 0.0181 0.0089 0.0328 0.0099 0.0519-3e-3 0.0145 0.13292 0.0654 0.40092 0.1468 0.26792 0.0814 0.96548 0.24093 1.494 0.35684 0.52849 0.11592 1.4685 0.33358 2.2432 0.45575 0.7747 0.1221 1.9503 0.33358 2.9545 0.43566 1.0043 0.1021 2.4005 0.24855 3.6158 0.30706 1.2153 0.0588 2.8102 0.0865 4.2161 0.0821 1.4058-4e-3 3.4381-0.15697 5.0067-0.31977 1.5686-0.16279 3.7171-0.49088 5.4121-0.83831 1.6949-0.34739 3.9153-0.91644 5.6975-1.4671 1.7822-0.55056 4.0178-1.4084 5.8467-2.1733 1.829-0.76495 4.2364-1.9839 6.0221-3.0536 1.7857-1.0697 3.9054-2.4674 5.6458-3.7512 1.7404-1.2838 3.8626-3.0918 5.4448-4.6571 1.5822-1.5653 3.3373-3.5108 4.7886-5.2572 1.4513-1.7464 3.0184-4.0831 4.2102-6.0475 1.1919-1.9644 2.5141-4.4207 3.4017-6.5499 0.88761-2.1291 1.7843-4.5679 2.4498-6.7671 0.66578-2.1992 1.2668-4.8195 1.5887-7.0674 0.32184-2.2478 0.55532-4.7211 0.64848-6.9447 0.0932-2.2237 7e-3 -4.7281-0.22413-6.8783-0.23035-2.1503-0.58792-4.4199-1.0101-6.4581-0.42222-2.0382-1.0139-4.2158-1.6915-6.0788-0.67748-1.863-1.4109-3.7723-2.2122-5.4566-0.80115-1.6842-1.6844-3.3641-2.5722-4.849-0.8879-1.4848-1.8421-2.9327-2.7758-4.2033-0.9337-1.2706-1.878-2.504-2.814-3.5527-0.93598-1.0487-1.8461-2.0267-2.6976-2.8953-0.85154-0.86862-1.6734-1.6688-2.445-2.3193-0.77164-0.65041-1.4445-1.2628-2.0661-1.7404-0.62163-0.47763-1.1492-0.88537-1.5754-1.218-0.42622-0.33286-0.76771-0.57468-0.9925-0.74082-0.22479-0.16607-0.33732-0.25691-0.3297-0.26818 7e-3 -0.0109 0.13522 0.06 0.37568 0.20786 0.24041 0.14789 0.60238 0.37766 1.0456 0.69656 0.44318 0.31904 0.98789 0.71473 1.6268 1.182 0.63898 0.46723 1.3852 1.0608 2.1426 1.7427 0.75735 0.68178 1.6288 1.4459 2.4987 Line truncated

After

Width:  |  Height:  |  Size: 15 KiB

+42 -39
View File
@@ -13,15 +13,15 @@ py3_exe = import('python').find_installation('python3')
qt_modules = []
feature_define_args = []
if get_option('enable_python')
message('Python is enabled')
feature_define_args += ['-DIAITO_ENABLE_PYTHON']
if get_option('enable_python_bindings')
message('Python Bindings are enabled')
feature_define_args += ['-DIAITO_ENABLE_PYTHON_BINDINGS']
endif
endif
# if get_option('enable_python')
# message('Python is enabled')
# feature_define_args += ['-DIAITO_ENABLE_PYTHON']
#
# if get_option('enable_python_bindings')
# message('Python Bindings are enabled')
# feature_define_args += ['-DIAITO_ENABLE_PYTHON_BINDINGS']
# endif
# endif
add_project_arguments(feature_define_args, language: 'cpp')
add_project_arguments('-DIAITO_SOURCE_BUILD', language: 'cpp')
@@ -105,35 +105,35 @@ endif
qt5dep = dependency('qt5', modules: qt_modules, main: true)
deps = [r_core, qt5dep]
if get_option('enable_python')
py3_dep = dependency('python3')
deps += [py3_dep]
if get_option('enable_python_bindings')
shiboken_dep = dependency('shiboken2', method: 'pkg-config')
pyside_dep = dependency('pyside2', method: 'pkg-config')
pyside_inc_dep = declare_dependency(include_directories: include_directories(join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtWidgets')))
deps += [shiboken_dep, pyside_dep, pyside_inc_dep]
shiboken_exe = shiboken_dep.get_pkgconfig_variable('generator_location')
qt5core_dep = dependency('Qt5Core', method: 'pkg-config')
bindings_generate_inc = [meson.current_source_dir(),
join_paths(meson.current_source_dir(), 'core'),
join_paths(meson.current_source_dir(), 'common'),
join_paths(meson.current_source_dir(), 'widgets'),
join_paths(meson.current_source_dir(), 'plugins'),
join_paths(meson.current_source_dir(), 'menus'),
join_paths(meson.current_source_dir(), 'subprojects/radare2/libr/include'),
join_paths(meson.current_build_dir(), 'subprojects/radare2'),
qt5core_dep.get_pkgconfig_variable('includedir'),
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtWidgets')]
message('bindings_inc: @0@'.format(bindings_generate_inc))
subdir('bindings')
sources += bindings_target
endif
endif
# if get_option('enable_python')
# py3_dep = dependency('python3')
# deps += [py3_dep]
# if get_option('enable_python_bindings')
# shiboken_dep = dependency('shiboken2', method: 'pkg-config')
# pyside_dep = dependency('pyside2', method: 'pkg-config')
# pyside_inc_dep = declare_dependency(include_directories: include_directories(join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
# join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
# join_paths(pyside_dep.get_pkgconfig_variable('includedir'), 'QtWidgets')))
# deps += [shiboken_dep, pyside_dep, pyside_inc_dep]
# shiboken_exe = shiboken_dep.get_pkgconfig_variable('generator_location')
# qt5core_dep = dependency('Qt5Core', method: 'pkg-config')
# bindings_generate_inc = [meson.current_source_dir(),
# join_paths(meson.current_source_dir(), 'core'),
# join_paths(meson.current_source_dir(), 'common'),
# join_paths(meson.current_source_dir(), 'widgets'),
# join_paths(meson.current_source_dir(), 'plugins'),
# join_paths(meson.current_source_dir(), 'menus'),
# join_paths(meson.current_source_dir(), 'subprojects/radare2/libr/include'),
# join_paths(meson.current_build_dir(), 'subprojects/radare2'),
# qt5core_dep.get_pkgconfig_variable('includedir'),
# join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
# join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
# join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtWidgets')]
# message('bindings_inc: @0@'.format(bindings_generate_inc))
# subdir('bindings')
# sources += bindings_target
# endif
# endif
moc_files = qt5_mod.preprocess(
moc_headers: headers,
@@ -153,7 +153,8 @@ endif
iaito_exe = executable(
'iaito',
moc_files,
gui_app: true,
win_subsystem: 'windows',
install: true,
sources: sources,
include_directories: [
incdirs,
@@ -162,3 +163,5 @@ iaito_exe = executable(
],
dependencies: deps,
)
install_man('iaito.1')
+3 -2
View File
@@ -1,2 +1,3 @@
option('enable_python', type: 'boolean', value: false)
option('enable_python_bindings', type: 'boolean', value: false)
# both options are deprecated
# option('enable_python', type: 'boolean', value: false)
# option('enable_python_bindings', type: 'boolean', value: false)
+57 -38
View File
@@ -5,53 +5,72 @@
<project_license>GPL-3.0</project_license>
<name>iaito</name>
<summary>A Qt and C++ GUI for radare2 reverse engineering framework</summary>
<description>
<p>
iaito is a free and open-source GUI for radare2. Willing to create an advanced, customizable and free reverse engineering framework.
</p>
<p>iaito is a free and open-source GUI for radare2. Willing to create an advanced, customizable and free reverse engineering framework.</p>
</description>
<launchable type="desktop-id">org.radare.iaito.desktop</launchable>
<content_rating type="oars-1.1"/>
<screenshots>
<screenshot>
<image>https://raw.githubusercontent.com/radareorg/iaito/master/docs/source/images/screenshot.png</image>
<screenshot type="default">
<image>https://raw.githubusercontent.com/radareorg/iaito/master/screenshot.png</image>
<caption>Main UI</caption>
</screenshot>
</screenshots>
<url type="homepage">https://www.radare.org/</url>
<url type="homepage">https://radare.org/</url>
<url type="bugtracker">https://github.com/radareorg/iaito/issues</url>
<url type="contact">https://github.com/radareorg/iaito#help</url>
<url type="vcs-browser">https://github.com/radareorg/iaito</url>
<update_contact>pancake</update_contact>
<developer_name>radare2</developer_name>
<releases>
<release version="5.3.1" date="2021-07-21" />
<release version="5.2.2" date="2021-04-27" />
<release version="5.2.1" date="2021-04-21" />
<release version="5.2.0" date="2021-04-16" />
<release version="5.1.0" date="2021-01-31" />
<release version="1.12.0" date="2020-09-03" />
<release version="1.11.0" date="2020-07-24" />
<release version="1.10.3" date="2020-05-08" />
<release version="1.10.2" date="2020-03-10" />
<release version="1.10.1" date="2020-01-31" />
<release version="1.10.0" date="2019-12-20" />
<release version="1.9.0" date="2019-09-06" />
<release version="1.8.3" date="2019-07-01" />
<release version="1.8.2" date="2019-05-20" />
<release version="1.8.1" date="2019-04-14" />
<release version="1.8.0" date="2019-03-18" />
<release version="1.7.4" date="2019-01-21" />
<release version="1.7.3" date="2018-12-26" />
<release version="1.7.2" date="2018-10-07" />
<release version="1.7.1" date="2018-08-25" />
<release version="1.7" date="2018-08-17" />
<release version="1.6" date="2018-07-13" />
<release version="1.5" date="2018-07-02" />
<release version="1.4" date="2018-04-24" />
<release version="1.3" date="2018-03-09" />
<release version="1.2" date="2018-01-30" />
<release version="1.1" date="2017-12-25" />
<release version="1.0" date="2017-12-03" />
<release version="5.7.8" date="2022-10-26">
<description>
<p>Add flathub information in README</p>
<p>remove duplicate StartupNotify=true</p>
<p>Update translation install method</p>
<p>Install the manpage</p>
<p>Disable translations submodule</p>
<p>Upgrade the github runners</p>
<p>Fix all race conditions by making iaito monothread by default</p>
<p>Remove two unused shellscripts</p>
</description>
</release>
<release version="5.7.6" date="2022-09-30">
<description>
<p>Support flatpak</p>
<p>Removed python/crashreport references in acr, meson and qmake</p>
<p>Fix crash on linux and mac</p>
<p>Support r2-5.8.x (current git)</p>
</description>
</release>
<release version="5.3.1" date="2021-07-21" />
<release version="5.2.2" date="2021-04-27" />
<release version="5.2.1" date="2021-04-21" />
<release version="5.2.0" date="2021-04-16" />
<release version="5.1.0" date="2021-01-31" />
<release version="1.12.0" date="2020-09-03" />
<release version="1.11.0" date="2020-07-24" />
<release version="1.10.3" date="2020-05-08" />
<release version="1.10.2" date="2020-03-10" />
<release version="1.10.1" date="2020-01-31" />
<release version="1.10.0" date="2019-12-20" />
<release version="1.9.0" date="2019-09-06" />
<release version="1.8.3" date="2019-07-01" />
<release version="1.8.2" date="2019-05-20" />
<release version="1.8.1" date="2019-04-14" />
<release version="1.8.0" date="2019-03-18" />
<release version="1.7.4" date="2019-01-21" />
<release version="1.7.3" date="2018-12-26" />
<release version="1.7.2" date="2018-10-07" />
<release version="1.7.1" date="2018-08-25" />
<release version="1.7" date="2018-08-17" />
<release version="1.6" date="2018-07-13" />
<release version="1.5" date="2018-07-02" />
<release version="1.4" date="2018-04-24" />
<release version="1.3" date="2018-03-09" />
<release version="1.2" date="2018-01-30" />
<release version="1.1" date="2017-12-25" />
<release version="1.0" date="2017-12-03" />
</releases>
</component>
+4 -2
View File
@@ -2,10 +2,12 @@
Type=Application
Name=iaito
Exec=iaito
Icon=iaito-o
Icon=org.radare.iaito
Categories=Qt;Development;Debugger;Viewer;ComputerScience;DataVisualization;Emulator;FileTools;Security;
StartupNotify=true
GenericName=GUI to Radare2 reverse engineering platform
Comment=It can serve as disassembler, debugger, hex viewer / editor and decompiler to several binary architectures and file formats
Keywords=radare2;radare;r2;iaito;gdb;disassembler;debugger;c;c++;assembler;decompiler;binary;asm;arm;exe;viewer;
StartupNotify=true
StartupWMClass=iaito
+1 -1
View File
@@ -48,7 +48,7 @@ void ColorThemeComboBox::updateFromConfig(bool interfaceThemeChanged)
}
}
setMinimumContentsLength(maxThemeLen);
setSizeAdjustPolicy(QComboBox::AdjustToMinimumContentsLength);
setSizeAdjustPolicy(QComboBox::AdjustToContents);
}
void ColorThemeComboBox::onCurrentIndexChanged(int index)
+13
View File
@@ -226,6 +226,18 @@ void ConsoleWidget::executeCommand(const QString &command)
addOutput(cmd_line);
RVA oldOffset = Core()->getOffset();
#if MONOTHREAD
QString result = Core()->cmdHtml(command.toStdString().c_str());
if (oldOffset != Core()->getOffset()) {
Core()->updateSeek();
}
ui->outputTextEdit->appendHtml(result);
scrollOutputToEnd();
historyAdd(command);
commandTask.clear();
ui->r2InputLineEdit->setEnabled(true);
ui->r2InputLineEdit->setFocus();
#else
commandTask = QSharedPointer<CommandTask>(new CommandTask(command, CommandTask::ColorMode::MODE_256, true));
connect(commandTask.data(), &CommandTask::finished, this, [this, cmd_line,
command, oldOffset] (const QString & result) {
@@ -243,6 +255,7 @@ void ConsoleWidget::executeCommand(const QString &command)
});
Core()->getAsyncTaskManager()->start(commandTask);
#endif
}
void ConsoleWidget::sendToStdin(const QString &input)
+14
View File
@@ -264,7 +264,15 @@ void DecompilerWidget::doRefresh()
mCtxMenu->setDecompiledFunctionAddress(decompiledFunctionAddr);
connect(dec, &Decompiler::finished, this, &DecompilerWidget::decompilationFinished);
decompilerBusy = true;
#if MONOTHREAD
RCodeMeta *cm = dec->decompileSync(addr);
if (cm) {
// dec->finished(cm);
this->decompilationFinished(cm);
}
#else
dec->decompileAt(addr);
#endif
}
void DecompilerWidget::refreshDecompiler()
@@ -571,6 +579,11 @@ bool DecompilerWidget::addressInRange(RVA addr)
*/
static QString remapAnnotationOffsetsToQString(RCodeMeta &code)
{
// XXX this is slow as hell
// XXX lets just disable it for now
#if 1
QString text(code.code);
#else
QByteArray bytes(code.code);
QString text;
text.reserve(bytes.size()); // not exact but a reasonable approximation
@@ -601,6 +614,7 @@ static QString remapAnnotationOffsetsToQString(RCodeMeta &code)
annotation->start = mapPos(annotation->start);
annotation->end = mapPos(annotation->end);
}
#endif
return text;
}
+1
View File
@@ -121,6 +121,7 @@ bool ExportsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig
case ExportsModel::TypeColumn:
if (leftExp.type != rightExp.type)
return leftExp.type < rightExp.type;
break;
case ExportsModel::CommentColumn:
return Core()->getCommentAt(leftExp.vaddr) < Core()->getCommentAt(rightExp.vaddr);
default:
+16
View File
@@ -503,6 +503,21 @@ FunctionsWidget::~FunctionsWidget() {}
void FunctionsWidget::refreshTree()
{
#if MONOTHREAD
this->functions = Core()->getAllFunctions();
importAddresses.clear();
for (const ImportDescription &import : Core()->getAllImports()) {
importAddresses.insert(import.plt);
}
mainAdress = (ut64)Core()->cmdj("iMj").object()["vaddr"].toInt();
functionModel->updateCurrentIndex();
functionModel->endResetModel();
// resize offset and size columns
qhelpers::adjustColumns(ui->treeView, 3, 0);
#else
if (task) {
task->wait();
}
@@ -528,6 +543,7 @@ void FunctionsWidget::refreshTree()
qhelpers::adjustColumns(ui->treeView, 3, 0);
});
Core()->getAsyncTaskManager()->start(task);
#endif
}
void FunctionsWidget::changeSizePolicy(QSizePolicy::Policy hor, QSizePolicy::Policy ver)
+31 -26
View File
@@ -4,24 +4,22 @@
#include "core/MainWindow.h"
#include "common/Helpers.h"
/*
#include <QPainter>
#include <QPen>
#include <QShortcut>
#include <QTreeWidget>
*/
ImportsModel::ImportsModel(QList<ImportDescription> *imp, QObject *parent) :
AddressableItemModel(parent),
imports(imp)
ImportsModel::ImportsModel(QList<ImportDescription> *imp, QObject *parent)
: AddressableItemModel<QAbstractListModel>(parent),
imports(imp)
{}
int ImportsModel::rowCount(const QModelIndex &parent) const
{
#if __linux__ || R2_VERSION_NUMBER < 50609
return imports->count();
#else
/// XXX this needs to be fixed
return 0;
#endif
return parent.isValid() ? imports->count() : 0;
//return imports != NULL ? imports->count() : 0;
}
int ImportsModel::columnCount(const QModelIndex &) const
@@ -31,40 +29,41 @@ int ImportsModel::columnCount(const QModelIndex &) const
QVariant ImportsModel::data(const QModelIndex &index, int role) const
{
const ImportDescription &import = imports->at(index.row());
const ImportDescription &imp = imports->at(index.row());
eprintf ("IMPORT DATA");
switch (role) {
case Qt::ForegroundRole:
if (index.column() < ImportsModel::ColumnCount) {
// Red color for unsafe functions
if (banned.match(import.name).hasMatch())
if (banned.match(imp.name).hasMatch())
return Config()->getColor("gui.item_unsafe");
// Grey color for symbols at offset 0 which can only be filled at runtime
if (import.plt == 0)
if (imp.plt == 0)
return Config()->getColor("gui.item_invalid");
}
break;
case Qt::DisplayRole:
switch (index.column()) {
case ImportsModel::AddressColumn:
return RAddressString(import.plt);
return RAddressString(imp.plt);
case ImportsModel::TypeColumn:
return import.type;
return imp.type;
case ImportsModel::SafetyColumn:
return banned.match(import.name).hasMatch() ? tr("Unsafe") : QStringLiteral("");
return banned.match(imp.name).hasMatch() ? tr("Unsafe") : QStringLiteral("");
case ImportsModel::LibraryColumn:
return import.libname;
return imp.libname;
case ImportsModel::NameColumn:
return import.name;
return imp.name;
case ImportsModel::CommentColumn:
return Core()->getCommentAt(import.plt);
return Core()->getCommentAt(imp.plt);
default:
break;
}
break;
case ImportsModel::ImportDescriptionRole:
return QVariant::fromValue(import);
return QVariant::fromValue(imp);
case ImportsModel::AddressRole:
return QVariant::fromValue(import.plt);
return QVariant::fromValue(imp.plt);
default:
break;
}
@@ -148,7 +147,8 @@ bool ImportsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig
case ImportsModel::LibraryColumn:
if (leftImport.libname != rightImport.libname)
return leftImport.libname < rightImport.libname;
// Fallthrough. Sort by Library and then by import name
// Fallthrough. Sort by Library and then by import name
return leftImport.name < rightImport.name;
case ImportsModel::NameColumn:
return leftImport.name < rightImport.name;
case ImportsModel::CommentColumn:
@@ -166,26 +166,31 @@ bool ImportsProxyModel::lessThan(const QModelIndex &left, const QModelIndex &rig
*/
ImportsWidget::ImportsWidget(MainWindow *main) :
ListDockWidget(main),
importsModel(new ImportsModel(&imports, this)),
importsProxyModel(new ImportsProxyModel(importsModel, this))
ListDockWidget(main)
//, importsModel(new ImportsModel(&imports, this)),
//importsProxyModel(new ImportsProxyModel(importsModel, this))
{
setWindowTitle(tr("Imports"));
setObjectName("ImportsWidget");
importsModel = new ImportsModel(&imports, this);
importsProxyModel = new ImportsProxyModel(importsModel, this);
setModels(importsProxyModel);
// Sort by library name by default to create a solid context per each group of imports
ui->treeView->sortByColumn(ImportsModel::LibraryColumn, Qt::AscendingOrder);
QShortcut *toggle_shortcut = new QShortcut(widgetShortcuts["ImportsWidget"], main);
connect(toggle_shortcut, &QShortcut::activated, this, [=] (){
toggleDockWidget(true);
} );
} );
connect(Core(), &IaitoCore::codeRebased, this, &ImportsWidget::refreshImports);
connect(Core(), &IaitoCore::refreshAll, this, &ImportsWidget::refreshImports);
/*
connect(Core(), &IaitoCore::commentsChanged, this, [this]() {
qhelpers::emitColumnChanged(importsModel, ImportsModel::CommentColumn);
});
*/
}
ImportsWidget::~ImportsWidget() {}
@@ -195,5 +200,5 @@ void ImportsWidget::refreshImports()
importsModel->beginResetModel();
imports = Core()->getAllImports();
importsModel->endResetModel();
qhelpers::adjustColumns(ui->treeView, 4, 0);
qhelpers::adjustColumns(ui->treeView, ImportsModel::ColumnCount, 0);
}
+6 -4
View File
@@ -3,7 +3,8 @@
#include <memory>
#include <QAbstractTableModel>
#include <QAbstractListModel>
#include <QAbstractListModel>
#include <QSortFilterProxyModel>
#include <QRegularExpression>
#include <QStyledItemDelegate>
@@ -15,10 +16,11 @@
#include "common/AddressableItemModel.h"
class MainWindow;
class QTreeWidget;
//class QTreeWidget;
class QTreeWidgetItem;
class ImportsWidget;
class ImportsModel : public AddressableItemModel<QAbstractTableModel>
class ImportsModel : public AddressableItemModel<QAbstractListModel>
{
Q_OBJECT
@@ -83,9 +85,9 @@ public:
private slots:
void refreshImports();
private:
QList<ImportDescription> imports;
ImportsModel *importsModel;
ImportsProxyModel *importsProxyModel;
QList<ImportDescription> imports;
void highlightUnsafe();
};
+2 -6
View File
@@ -11,13 +11,9 @@ RelocsModel::RelocsModel(QList<RelocDescription> *relocs, QObject *parent) :
relocs(relocs)
{}
int RelocsModel::rowCount(const QModelIndex &parent) const
int RelocsModel::rowCount(R_UNUSED const QModelIndex &parent) const
{
#if __linux__ || R2_VERSION_NUMBER < 50609
return relocs->count();
#else
return 0;
#endif
return parent.isValid() ? relocs->count() : 0;
}
int RelocsModel::columnCount(const QModelIndex &) const
+40 -9
View File
@@ -18,19 +18,30 @@ static const int kMaxTooltipHexdumpBytes = 64;
static const QMap<QString, QString> searchBoundaries {
{"io.maps", "All maps"},
{"io.maps.x", "All executable maps"},
{"io.maps.w", "All writeable maps"},
{"io.map", "Current map"},
{"raw", "Raw"},
{"block", "Current block"},
{"bin.section", "Current mapped section"},
{"bin.sections", "All mapped sections"},
{"bin.section", "Current section"},
{"bin.sections.x", "All executable sections"},
{"bin.sections.w", "All writeable sections"},
{"bin.sections", "All sections"},
{"anal.function", "Current function"},
{"anal.bb", "Current basic block"},
};
static const QMap<QString, QString> searchBoundariesDebug {
{"dbg.maps", "All memory maps"},
{"dbg.maps.x", "All executable maps"},
{"dbg.maps.w", "All writeable maps"},
{"dbg.map", "Memory map"},
{"raw", "Raw"},
{"block", "Current block"},
{"dbg.stack", "Stack"},
{"dbg.heap", "Heap"}
{"dbg.heap", "Heap"},
{"anal.function", "Current function"},
{"anal.bb", "Current basic block"},
};
SearchModel::SearchModel(QList<SearchDescription> *search, QObject *parent)
@@ -226,7 +237,11 @@ void SearchWidget::updateSearchBoundaries()
}
mapIter = boundaries.cbegin();
ui->searchInCombo->setCurrentIndex(ui->searchInCombo->findData(mapIter.key()));
int pos = ui->searchInCombo->findData(mapIter.key());
if (pos < 0) {
pos = 0;
}
// ui->searchInCombo->setCurrentIndex(pos);
Config()->setConfig("search.in", mapIter.key());
ui->searchInCombo->blockSignals(true);
@@ -234,7 +249,9 @@ void SearchWidget::updateSearchBoundaries()
for (; mapIter != boundaries.cend(); ++mapIter) {
ui->searchInCombo->addItem(mapIter.value(), mapIter.key());
}
ui->searchInCombo->model()->sort(0, Qt::DescendingOrder);
ui->searchInCombo->blockSignals(false);
ui->searchInCombo->setCurrentIndex(1);
ui->filterLineEdit->clear();
}
@@ -247,18 +264,30 @@ void SearchWidget::searchChanged()
void SearchWidget::refreshSearchspaces()
{
int cur_idx = ui->searchspaceCombo->currentIndex();
if (cur_idx < 0)
if (cur_idx < 0) {
cur_idx = 0;
}
ui->searchspaceCombo->clear();
ui->searchspaceCombo->addItem(tr("asm code"), QVariant("/acj"));
// ui->searchspaceCombo->addItem(tr("instruction type"), QVariant("/atj"));
// ui->searchspaceCombo->addItem(tr("instruction family"), QVariant("/afj"));
ui->searchspaceCombo->addItem(tr("string"), QVariant("/j"));
ui->searchspaceCombo->addItem(tr("wide string"), QVariant("/wj"));
//ui->searchspaceCombo->addItem(tr("syscalls"), QVariant("/asj"));
//ui->searchspaceCombo->addItem(tr("code strings"), QVariant("/azj"));
// ui->searchspaceCombo->addItem(tr("magic"), QVariant("/mj"));
ui->searchspaceCombo->addItem(tr("hex string"), QVariant("/xj"));
// ui->searchspaceCombo->addItem(tr("esil xrefs"), QVariant("/re"));
ui->searchspaceCombo->addItem(tr("ROP gadgets"), QVariant("/Rj"));
ui->searchspaceCombo->addItem(tr("32bit value"), QVariant("/vj"));
ui->searchspaceCombo->addItem(tr("64bit value"), QVariant("/v8j"));
ui->searchspaceCombo->addItem(tr("32bit value"), QVariant("/v4j"));
ui->searchspaceCombo->addItem(tr("16bit value"), QVariant("/v2j"));
ui->searchspaceCombo->addItem(tr("8bit value"), QVariant("/v1j"));
if (cur_idx > 0)
if (cur_idx > 0) {
ui->searchspaceCombo->setCurrentIndex(cur_idx);
}
refreshSearch();
}
@@ -296,6 +325,8 @@ void SearchWidget::setScrollMode()
void SearchWidget::updatePlaceholderText(int index)
{
return;
#if 0
switch (index) {
case 1: // string
ui->filterLineEdit->setPlaceholderText("foobar");
@@ -312,10 +343,10 @@ void SearchWidget::updatePlaceholderText(int index)
default:
ui->filterLineEdit->setPlaceholderText("jmp rax");
}
#endif
}
void SearchWidget::on_searchInCombo_currentIndexChanged(int index)
{
Config()->setConfig("search.in",
ui->searchInCombo->itemData(index).toString());
Config()->setConfig("search.in", ui->searchInCombo->itemData(index).toString());
}
+7 -1
View File
@@ -223,14 +223,20 @@ StringsWidget::~StringsWidget() {}
void StringsWidget::refreshStrings()
{
#if MONOTHREAD
auto strings = Core()->getAllStrings();
this->strings = strings;
model->endResetModel();
tree->showItemsNumber(proxyModel->rowCount());
#else
if (task) {
task->wait();
}
task = QSharedPointer<StringsTask>(new StringsTask());
connect(task.data(), &StringsTask::stringSearchFinished, this,
&StringsWidget::stringSearchFinished);
Core()->getAsyncTaskManager()->start(task);
#endif
refreshSectionCombo();
}
-1
View File
@@ -68,7 +68,6 @@ private:
QList<SymbolDescription> symbols;
SymbolsModel *symbolsModel;
SymbolsProxyModel *symbolsProxyModel;
};
#endif // SYMBOLSWIDGET_H