Compare commits

...
156 Commits
Author SHA1 Message Date
pancake 27feb05e62 jasfdkl 2024-05-24 02:18:40 +02:00
pancake 7656eed6d2 Release 5.9.2 2024-05-24 02:09:14 +02:00
pancake 56bd22f4e3 Update to the upload-artifact v4 2024-05-24 01:27:47 +02:00
pancake 2abcacb722 Add Discord link in the README 2024-05-24 01:23:44 +02:00
pancake a727f93d0e Add macos-arm64 builds 2024-05-24 01:21:27 +02:00
pancake 272f0da513 Update the CI actions 2024-05-24 01:00:53 +02:00
pancake 64fecfbebb Implement uiaito core plugin for scripting via r2js 2024-05-24 00:54:38 +02:00
pancake 869998b58a Honor Ps/Po error code when saving/loading projects and show proper error message 2024-04-09 17:05:02 +02:00
pancake f0cef8e4f5 Zoom font size with control+wheel in the disassembly widget 2024-04-05 11:53:18 +02:00
Pau RE 2b47060190 Fix appdata metadata 2024-04-02 01:18:35 +02:00
pancake eaba7bbdad Release 5.9.0 2024-03-31 19:10:09 +02:00
Pau RE beae7d7551 Improve quality of app data for Flathub 2024-02-09 20:07:58 +01:00
jjdredd d7970177f3 Fix file dialog type, which sometimes breaks build [#152] 2024-02-04 05:56:19 +01:00
pancake cd7a2d08ca Remove unused or broken scripts 2024-02-01 20:49:04 +09:00
pancake c3409ab251 Link against r_arch when using qmake 2024-01-11 08:56:40 +01:00
Francesco Tamagni 18ac71a371 Support RBinName adding shims header for backwards compatibility 2024-01-11 08:55:18 +01:00
atom_bomb 8ccd7d9dd5 Issue #148: Make RelocsWidget constructor look the same as ExportsWidget, dodging a segfault at startup 2023-12-18 23:21:28 +01:00
pancake c15b35c74f envvar no longer needed on flatpak windows 2023-11-18 12:27:30 +01:00
pancake 272a9da194 Dont check for isValid on TableModels 2023-11-06 12:13:01 +01:00
pancake 2cd5d0109c Drop the double Ok button in the plugins preferences panel 2023-10-27 20:03:30 +02:00
pancake 8b48ce96e1 Generalize the fileopen dialog for qt6+mac via QFILEDIALOG_FLAGS 2023-10-27 19:57:34 +02:00
pancake 108c605897 Fix null deref in settings panel 2023-10-27 19:40:40 +02:00
pancake 70be993cfd Dont use the native file selector in macOS 2023-10-26 15:44:02 +02:00
pancake 09d7d62632 Blindfix for the Select crash in qt6 2023-10-26 15:39:17 +02:00
pancake 534dfde000 Just a version bump 2023-10-25 09:30:29 +02:00
pancake 75e4afe5ce Minor hint for qt6 compilation in the readme 2023-10-23 13:24:48 +02:00
pancake c0eeba3cfc Fix trash chars listed in the register ref in the debugger 2023-10-23 13:24:45 +02:00
pancake 0976bf2aa8 Rimraf twitter reference 2023-10-16 14:01:18 +02:00
pancake b658b2bbc2 Fix null deref in destruction 2023-10-09 16:27:47 +02:00
GravisZro d934619abe Fixes dependencies for Debian packages generation
* The DEPENDS variable was being nullified in the Makefile.
* The proper syntax for executing a shell script from a makefile is now being used.
2023-09-20 12:53:36 +02:00
GravisZro d68207b59e Adds a small script to build a list of dependencies and dependenct packages in CONFIG 2023-09-17 21:53:35 +02:00
FetheredSerpent 672acd902b Rename Windows release artifacts
Windows release artifacts shouldn't contain 'macos' in their name
2023-09-16 00:02:53 +02:00
FetheredSerpent 9735074c7c Fix macOS artifacts not found 2023-09-16 00:02:53 +02:00
FetheredSerpent 3b89622ba8 Fix iaito deployment for Windows ##build
* Remove legacy code from ci.yml
* These parts have already moved to ci.yml
* Create the missing directories
* Changed order of moving directories
* Update configure.bat
* Update make.bat
* Try icon support for Windows
2023-09-12 15:49:45 +02:00
pancake 77be9b82c1 Add method to unredirect console output and fix plugin mode 2023-09-02 22:09:41 +02:00
pancake 620ac0081f Dont do html when using the '>' output redirection in the console widget 2023-09-01 13:57:29 +02:00
pancake 1a0a486c71 Handle 'cls'/'clear' commands in the console widget 2023-09-01 13:37:40 +02:00
pancake 3feb7b2a93 Initial support for running iaito frominside r2 2023-08-28 13:21:01 +02:00
Dennis Goodlett d4ca777cbd Fix RBinFile->o renamed to RBinObject->bo (#137)
* Fix RBinFile->o renamed to RBinObject->bo

* Add macro for reverse compatability

* Remove extra newline
2023-08-17 09:09:45 +02:00
pancake 9101519e26 Rename Help->Documentation to Help->Website 2023-08-07 15:56:21 +02:00
pancake 1896d7ffec Fix possible null deref in core.anal.arch 2023-08-07 15:56:08 +02:00
pancake 5871f6ea1c Don't -dead_strip for portability 2023-07-12 13:26:44 +02:00
pancake d7fe9272b8 Fix build with latest r2 from git 2023-07-10 18:45:51 +02:00
pancake 40ee584fcf Add support for colorizing basic blocks in the graph
* Uses the new abc command from r2-5.8.9
2023-07-04 00:46:49 +02:00
pancake 93a24b3ad0 Add safety column in the relocs widget 2023-07-03 01:08:14 +02:00
pancake 661d273ab7 Fix relocs widget 2023-07-03 00:58:20 +02:00
pancake 3aee0c3548 Add global unsafe coloring in the imports widget 2023-07-03 00:50:42 +02:00
pancake dd60c551cd Dont check for lrelease in the configure step 2023-06-30 02:29:01 +02:00
pancake 1c984ae94b Release iaito-5.8.8 2023-06-20 11:00:26 +02:00
pancake ddac25ee39 Add --with-qmake6 configure flag when qt5+qt6 are available 2023-06-19 19:25:44 +02:00
pancake 2fe18dead5 Note how wip are the ci builds 2023-06-19 18:11:45 +02:00
pancake b16408049b Clarify the startup script dialog with one more text 2023-06-19 18:09:05 +02:00
pancake 110fa13b1d Missing symbol 2023-06-19 17:56:58 +02:00
pancake d911376774 Add 3 more analysis boundaries 2023-06-19 17:54:42 +02:00
pancake 3a246798b8 Fix warning: 'AddressableItemModelI' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor] 2023-06-19 17:34:25 +02:00
pancake 0de3f90b6c Fix meson build 2023-06-19 17:28:14 +02:00
pancake 4c7e23e0a6 Fix startup crash because of an incorrect static cast 2023-06-19 17:21:33 +02:00
pancake 9b6bce7e58 Add make asan build target 2023-06-19 17:16:19 +02:00
pancake 9e3f9f6345 Honor CFLAGS/LDFLAGS/CXXFLAGS from qmake 2023-06-19 17:14:48 +02:00
pancake a1356fbdd9 Handle the 5A command in more places 2023-06-19 03:09:13 +02:00
pancake d33a8dc7a2 Add secondary load script and show it in preferences 2023-06-19 03:08:38 +02:00
pancake e1b5e909c4 Add 'export disassembly' option in File->Export menu 2023-06-19 02:24:35 +02:00
pancake cbf7bc6a3d Show the r2 plugins (instead of iaito ones) in the Plugins panel
* iaito plugins still exist but its in deprecation process
2023-06-19 02:03:12 +02:00
pancake 1ae192e48e Flat structure in the left column of Settings 2023-06-19 01:06:12 +02:00
pancake 0dc095ff71 Dont show the 'beta' warning when entering the debug mode
* We know its buggy, but considering it beta doesnt help
2023-06-19 01:04:37 +02:00
pancake e5277f39a1 Fix crash in Settings panel 2023-06-19 00:39:03 +02:00
pancake e5444aa9e6 Honor configure's --prefix in qmake 2023-06-17 19:55:54 +02:00
pancake bbaa1abfe5 Show error dialog instead of closing when not opening a file 2023-06-17 12:18:23 +02:00
pancake a101ba7167 Be more flexible when resolving the r2 color themes path 2023-06-15 18:34:50 +02:00
pancake 33b32edb4a Fix build for the wip-abi r2-5.8.9 2023-06-12 16:13:58 +02:00
pancake ecc7d05a05 || != | 2023-06-12 16:10:45 +02:00
pancake 3efbbc85ab Improve release notes output 2023-05-24 11:23:29 +02:00
pancake 7a3e617585 Publish macOS dmg and use release mode when building for Windows 2023-05-23 17:38:41 +02:00
pancake 6767934906 Release 5.8.6 2023-05-22 12:23:57 +02:00
semgrep.dev on behalf of @trufae 85f757efb9 Add Semgrep CI 2023-03-29 10:24:51 +00:00
pancake 132ef13af6 Dont let the user open without selecting a file or uri path
* otherwise it silently fails later
2023-03-16 16:49:36 +01:00
pancake 4329e20359 Arch is required 2023-03-16 12:34:31 +01:00
pancake 6babbbdfe9 RHash made its way into RCrypto on the r2-5.8.x series 2023-03-16 11:49:55 +01:00
pancake f7318c3033 Fix #119 - Dont allow to save projects when debugging 2023-03-16 11:47:17 +01:00
pancake 80ff0a6f7b Fix meson build for r2-5.8.x 2023-03-16 10:59:13 +01:00
pancake dfb48fcf0c Use r2-5.8.4 on windows builds 2023-03-16 10:37:45 +01:00
pancake 3cd046fdd0 More qt6 deprecation fixes 2023-03-16 10:35:56 +01:00
pancake df65aa9aa6 Fix some more qt6 deprecation warnings 2023-03-16 10:29:05 +01:00
pancake 5f9a0840cc Automate release process in the CI (#130)
* Improvements for the windows ci build
2023-03-16 10:24:12 +01:00
pancake 805db97abd Release 5.8.4 2023-03-15 22:53:48 +01:00
pancake 53afe35b12 Address some more qt6 remaining fixes 2023-03-15 22:31:24 +01:00
pancake 01535f4add Massage the ColorPicker for Qt6 2023-03-15 22:11:11 +01:00
pancake ecf6b96e0f Remove unused includes 2023-03-15 22:11:03 +01:00
pancake 77b005988b Remove the job for Ubuntu 18 2023-03-15 19:35:15 +01:00
pancake db2de36a4d Support 5a analysis like in latest r2 and add checkbox for anal.vars 2023-03-15 19:35:15 +01:00
pancake c713c88749 Remove all the uses of eprintf 2023-03-03 01:09:02 +01:00
pancake 7a32c6789b Make iaito usable on qt6 2023-03-03 01:07:57 +01:00
pancake 78522cca81 Initial WIP transition to support qt5 + qt6 2023-02-15 19:19:21 +01:00
gingermouse a50927e039 Fixing an empty Import table (#126) 2023-02-08 16:21:52 +01:00
pancake e821ddc1c8 Add changelog details for the flatpak release 2023-02-01 23:33:24 +01:00
pancake 7116de1a7e Release 5.8.2 2023-02-01 17:51:30 +01:00
gingermouse 463dbccce4 Alphabetically sort io and arch comboboxes #121 2023-02-01 17:48:56 +01:00
pancake 0b8635565d Load header format structs after bin parsing 2023-01-31 17:18:50 +01:00
pancake 5b9b68bc92 Default theme is iaito 2023-01-31 16:59:39 +01:00
pancake cbf1992d78 Release 5.8.0 2022-12-23 13:00:07 +01:00
pancake f799eaf0cd Update appdata file 2022-12-23 12:48:48 +01:00
pancake 3c605a4480 pip install meson 2022-12-21 12:32:33 +01:00
pancake 6c66b28c1f Remove that super-slow job, github seems buggy 2022-12-20 13:09:35 +01:00
pancake 876858458a improve ci 2022-12-20 01:17:03 +01:00
pancake d090071923 Fix include paths for latest r2 2022-12-18 23:10:09 +01:00
pancake 2c3b4588ef Fix assert when loading without no file 2022-12-16 19:06:18 +01:00
pancake 7fb52ccd4c RAsmPlugin is no longer a thing \o/ 2022-12-09 12:02:14 +01:00
pancake b9c02025f5 Add bug report template 2022-11-14 21:41:48 +01:00
pancake e354190c31 New make dist for macos using macdeployqt. missing cocoa plugin 2022-11-14 21:35:21 +01:00
pancake 6feb079005 Fix build with r2-5.8.x 2022-11-06 18:43:53 +01:00
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
150 changed files with 2645 additions and 1221 deletions

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
---
name: Bug report
about: Create a report to help us improve
---
## Environment
```sh
# copypaste this script into your shell and replace it with the output
date
r2 -v
iaito -v
uname -ms
```
## Description
<!-- Explain what's the issue and what would you expect to see -->
## Test
<!-- Steps to reproduce the issue and provide files/links/images/.. -->
+194 -65
View File
@@ -1,7 +1,7 @@
name: iaito CI
env:
R2V: 5.7.2
R2V: 5.9.2
on:
push:
@@ -15,13 +15,13 @@ jobs:
acr-linux-r2git:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
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@v5
with:
python-version: 3.8.x
python-version: 3.11.x
- name: apt dependencies
run: |
sudo apt-get update
@@ -37,20 +37,16 @@ jobs:
- name: packaging
run: |
make -j -C dist/debian
- uses: actions/upload-artifact@v2
with:
name: iaito-amd64.deb
path: dist/debian/*/*.deb
acr-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
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@v5
with:
python-version: 3.8.x
python-version: 3.11.x
- name: apt dependencies
run: |
sudo apt-get update
@@ -69,30 +65,33 @@ jobs:
- name: packaging
run: |
make -C dist/debian
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: iaito-amd64.deb
path: dist/debian/*/*.deb
acr-macos:
runs-on: macos-latest
acr-macos-x64:
runs-on: macos-12
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
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@v5
with:
python-version: 3.8.x
python-version: 3.11.x
- name: uname
run: uname -a
- name: homebrew dependencies
run: |
brew update
brew install coreutils pkg-config qt@5
brew update || true
brew install pkg-config qt@5 || true
brew unlink qt@5 || true
brew link --force qt@5
brew link --force qt@5 || true
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,15 +105,55 @@ jobs:
- name: packaging
run: |
make -C dist/macos
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: iaito-mac-amd64.zip
path: dist/macos/iaito*.zip
name: iaito-x64.dmg
path: dist/macos/iaito.dmg
acr-macos-m1:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- uses: actions/setup-python@v5
with:
python-version: 3.11.x
- name: uname
run: uname -a
- name: homebrew dependencies
run: |
brew update || true
brew install pkg-config qt@5 || true
brew unlink qt@5 || true
brew link --force qt@5 || true
pip3 install meson
pip3 install ninja
- name: install r2
run: |
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-m1-${{env.R2V}}.pkg
sudo installer -pkg *.pkg -target /
- name: build iaito
run: |
export PATH="/usr/local/opt/qt@5/bin:$PATH"
export PATH="/opt/homebrew/opt/qt@5/bin:$PATH" # doesnt seems to be necessary
export LDFLAGS="-L/usr/local/opt/qt@5/lib"
export CPPFLAGS="-I/usr/local/opt/qt@5/include"
export PKG_CONFIG_PATH="/usr/local/opt/qt@5/lib/pkgconfig"
./configure
make -j4
- name: packaging
run: |
make -C dist/macos
- uses: actions/upload-artifact@v4
with:
name: iaito-m1.dmg
path: dist/macos/iaito.dmg
meson:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-20.04, ubuntu-18.04, macos-latest]
os: [ubuntu-22.04, ubuntu-20.04]
python-version: [3.8.x]
system-deps: [true]
cc-override: [default]
@@ -122,9 +161,9 @@ jobs:
# Prevent one job from pausing the rest
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false # 'recursive' 'true' or 'false'
persist-credentials: false
- name: apt dependencies
if: contains(matrix.os, 'ubuntu')
@@ -136,47 +175,44 @@ jobs:
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
- name: install r2
run: git clone --depth=1 https://github.com/radareorg/radare2 r2git && CFLAGS=-O0 r2git/sys/install.sh
- uses: actions/setup-python@v1
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- 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
- name: py dependencies
brew install coreutils pkg-config || true
brew install pkg-config qt@5 || true
brew unlink qt@5 || true
brew link --force qt@5 || true
pip3 install meson
pip3 install ninja
- name: macos build
if: contains(matrix.os, 'macos')
run: |
pip install meson
cd src && meson ../build
cd ../build && ninja -j4
- name: meson+ninja ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
set -euo pipefail #TODO: move to top once iaito-deps doesn't fail
if [[ "${{ matrix.cc-override }}" != "default" ]]
then
export CC="${{matrix.cc-override}}"
export CXX="${{matrix.cxx-override}}"
fi
cd src
meson ../build
cd ../build
ninja -j4
pip install meson
cd src && meson ../build
cd ../build && ninja -j4
w64-meson:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
submodules: true # 'recursive' 'true' or 'false'
submodules: false
persist-credentials: false
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
# - uses: actions/setup-python@v1
# - uses: actions/setup-python@v5
# with:
# python-version: 3.8.x
# python-version: 3.11.x
# - name: Prepare Qt
# working-directory: build
# shell: cmd
@@ -184,35 +220,128 @@ 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
# - name: install r2
# shell: bash
# run: |
# python -m wget https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-${{env.R2V}}-w64.zip -o r2.zip
# unzip r2.zip
# mv radare2-${{env.R2V}}-w64 radare2
# pwd
choco install zip
- name: install r2
shell: bash
run: |
python -m wget https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-${{env.R2V}}-w64.zip -o r2.zip
unzip r2.zip
mv radare2-${{env.R2V}}-w64 radare2
pwd
- name: w64-make
shell: cmd
run: |
SET ARCH=x64
set IAITO_DEPS=%CD%\iaito-deps
set PATH=%CD%\iaito-deps\qt\bin;%CD%\r2_dist\bin;%PATH%
pip install meson ninja wget
set PATH=%CD%\r2_dist\bin;%PATH%
call preconfigure.bat
call configure.bat
call make.bat
zip -r iaito.zip iaito
dir /s
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: iaito.exe
path: iaito\iaito.exe
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: iaito.zip
path: iaito.zip
- uses: actions/upload-artifact@v4
with:
name: ${{ env.PACKAGE_NAME }}
path: build/${{ env.PACKAGE_NAME }}
check_release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
outputs:
is_release: ${{ steps.release.outputs.is }}
tag_name: ${{ steps.release.outputs.tag }}
needs:
- acr-linux
- acr-macos-m1
- acr-macos-x64
- w64-meson
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Download all git history and tags
- name: Check if is a release
run: git describe --exact-match --tags ${{ github.sha }} | awk 'BEGIN{tag="-";r="no"}/^[0-9]+\.[0-9]+/{tag=$0;r="yes"};END{print "is="r;print "tag="tag}' >> ${GITHUB_OUTPUT}
id: release
release:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.check_release.outputs.is_release == 'yes' }}
needs:
- check_release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Download all git history and tags
- name: Extract version
run: echo "string=`./configure -qV`" >> $GITHUB_OUTPUT
id: version
- name: Prepare release notes
run: ./scripts/release-notes.sh | tee ./RELEASE_NOTES.md
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist/artifacts
- name: Display structure of downloaded files
run: find dist/artifacts
- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.check_release.outputs.tag_name }}
release_name: ${{ steps.version.outputs.string }}
body_path: ./RELEASE_NOTES.md
draft: false
prerelease: false
- name: Prepare release notes
run: ./scripts/release-notes.sh | tee ./RELEASE_NOTES.md
- name: Upload Linux asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/iaito-amd64.deb/iaito/iaito_${{ steps.version.outputs.string }}_amd64.deb
asset_name: iaito_${{ steps.version.outputs.string }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package
- name: Upload macOS asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/iaito-x64.dmg/iaito.dmg
asset_name: iaito_${{ steps.version.outputs.string }}_x64.dmg
asset_content_type: application/vnd.debian.binary-package
- name: Upload Windows QtDeploy asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/artifacts/iaito.zip/iaito.zip
asset_name: iaito-${{ steps.version.outputs.string }}-w64.zip
asset_content_type: application/zip
# - name: Upload Windows executable
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: dist/artifacts/iaito.exe/iaito.exe
# asset_name: iaito-${{ steps.version.outputs.string }}.exe
# asset_content_type: application/zip
+23
View File
@@ -0,0 +1,23 @@
on:
pull_request: {}
push:
branches:
- main
- master
paths:
- .github/workflows/semgrep.yml
schedule:
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
- cron: 45 3 * * *
name: Semgrep
jobs:
semgrep:
name: Scan
runs-on: ubuntu-20.04
env:
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@v3
- run: semgrep ci
+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
+72 -22
View File
@@ -6,66 +6,116 @@ else
BIN=build/iaito
endif
#QMAKE_FLAGS+=IAITO_ENABLE_PYTHON=false
QMAKE_FLAGS+=-config release
#install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
# @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
# plugandpaint.app/Contents/plugins/libpnp_basictools.dylib
ifeq ($(WANT_PYTHON),1)
QMAKE_FLAGS+=IAITO_ENABLE_PYTHON=true
endif
ifeq ($(WANT_PYTHON_BINDINGS),1)
QMAKE_FLAGS+=IAITO_ENABLE_PYTHON_BINDINGS=true
endif
QMAKE_FLAGS+=PREFIX=$(PREFIX)
all: iaito
clean:
CXX?=g++
mrproper: clean
QTLIBS=$(shell grep "^LIBS" build/Makefile | cut -d = -f 2-)
R2LIBS=$(shell pkg-config --cflags --libs r_core)
R2_LIBEXT=$(shell r2 -H R2_LIBEXT)
R2_USER_PLUGINS=$(shell r2 -H R2_USER_PLUGINS)
plugin core_plugin: iaito
SUBLIBS=true $(CXX) build/*.o src/CorePlugin.cpp -shared -fPIC $(QTLIBS) $(R2LIBS) -o build/CorePlugin.$(R2_LIBEXT)
mkdir -p $(R2_USER_PLUGINS)
rm -f $(R2_USER_PLUGINS)/IaitoPlugin.$(R2_LIBEXT)
cp -f build/CorePlugin.$(R2_LIBEXT) $(R2_USER_PLUGINS)/IaitoPlugin.$(R2_LIBEXT)
asan:
export CXXFLAGS=-fsanitize=address ; \
export CFLAGS=-fsanitize=address ; \
export LDFLAGS=-fsanitize=address ; \
$(MAKE) build && $(MAKE) -C build -j4
clean:
rm -rf build
.PHONY: install build run user-install clean mrproper translations
dist:
ifeq ($(shell uname),Darwin)
$(MAKE) -C dist/macos
else
$(MAKE) -C dist/debian
endif
iaito: translations
$(MAKE) -C build -j4
mrproper: clean
git clean -xdf
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 dist macos 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
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
+70 -17
View File
@@ -4,34 +4,51 @@
iaito is the official graphical interface for radare2, a libre reverse engineering framework.
* Requires radare2 and Qt-5/6
* Iaito was the original name of this GUI before being forked as Cutter.
* It's written in Qt/C++ (qt5 for now). No Qt6 support yet (contribs are welcome)
* Support latest versions, plugins and features of radare2
* Use r2 plugins (f.ex: no need for r2ghidra-iaito plugin if r2ghidra is installed)
* Focus on parity of commands, keybindings and r2-style workflows.
* Translations are community [contributed](https://crowdin.com/project/iaito)!
* Aims to support all the features from the core, not just disassembler-based ones
* Focus on simplicity, parity with commands, keybindings and r2-style workflows.
* Help with translations [contributed](https://crowdin.com/project/iaito)!
* Aims to cover other radare2 features, not just a disassembler
* forensics, networking, bindiffing, solvers, ...
[![Crowdin](https://badges.crowdin.net/iaito/localized.svg)](https://crowdin.com/project/iaito)
[![iaito CI](https://github.com/radareorg/iaito/workflows/iaito%20CI/badge.svg)](https://github.com/radareorg/iaito/actions)
[![Linux packages](https://repology.org/badge/vertical-allrepos/iaito.svg?columns=4)](https://repology.org/project/iaito/versions)
![Screenshot](https://raw.githubusercontent.com/radareorg/iaito/master/screenshot.png)
![Screenshot](https://raw.githubusercontent.com/radareorg/iaito/master/screenshots/macos-panels.png)
## Help
Get help, updates, meet the community or discuss about development in these channels:
- **Discord:** [https://discord.gg/6RwDEJFr](https://discord.gg/6RwDEJFr)
- **Telegram:** https://t.me/radare
- **Mastodon:** [@radareorg](https://infosec.exchange/@radareorg)
- **IRC:** #radare on irc.freenode.net
## Installation
There are automated CI builds and [releases](https://github.com/radareorg/iaito/releases) of iaito for Linux, macOS and Windows.
On WSL or Linux you can use these steps to install it with Flatpak:
```sh
sudo flatpak remote-add flathub https://dl.flathub.org/repo/flathub.flatpakrepo
sudo flatpak install flathub org.radare.iaito
flatpak run org.radare.iaito
```
<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>
## Source Builds
### Dependencies
iaito requires [radare2](https://github.com/radareorg/radare2) and qt5:
iaito requires [radare2](https://github.com/radareorg/radare2) and qt5 (or qt6):
```sh
$ git clone https://github.com/radareorg/radare2
$ radare2/sys/install.sh
$ git clone https://github.com/radareorg/radare2 && radare2/sys/install.sh
```
Install QT on macOS like this:
@@ -45,10 +62,15 @@ On Ubuntu/Debian
```sh
sudo apt install qttools5-dev qttools5-dev-tools qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools libqt5svg5-dev make pkg-config build-essential
```
## Building from sources
For QT6:
```sh
sudo apt install qt6-svg-dev
```
### Compilation
```sh
./configure
@@ -56,16 +78,47 @@ make
make run
```
To install the app and the translations in your home:
To install the app in your home:
```sh
make install
```
## Help
### Building iaito as an r2 plugin
Get help, updates, meet the community or discuss about development in these channels:
It is also possible to launch iaito from the r2 shell reusing the Core instance:
```
make plugin
```
The previous command will build iaito, the iaito plugin and copy it it into your home plugin directory.
```
$ r2 /bin/ls
> iaito
...
```
### Translations (Optional)
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
```
- **Telegram:** https://t.me/radare
- **IRC:** #radare on irc.freenode.net
- **Twitter:** [@radareorg](https://twitter.com/radareorg)
+5 -2
View File
@@ -24,7 +24,7 @@ else
acr -p
fi
. configure
. ./configure
sed \
-e "s,^IAITO_VERSION_MAJOR.*,IAITO_VERSION_MAJOR = ${VERSION_MAJOR}," \
@@ -34,7 +34,10 @@ sed \
mv src/Iaito.pro.sed src/Iaito.pro
${EDITOR} .github/workflows/ci.yml
echo
echo "Press enter and add a new changelog entry for the new Flatpak version"
read A
${EDITOR} src/org.radare.iaito.appdata.xml
#V=`./configure -qV | cut -d - -f -1`
# meson rewrite kwargs set project / version "$V"
# if [ -n "$1" ]; then
-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
+6 -2
View File
@@ -1,7 +1,11 @@
PREFIX=@PREFIX@
QMAKE=@QMAKE@
LRELEASE=@LRELEASE@
QMAKE=@QMAKE_BIN@
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
+60 -40
View File
@@ -1,5 +1,5 @@
#!/bin/sh
# This script was automatically generated by ACR v2.0.0
# This script was automatically generated by ACR v2.1.4
# @author: pancake <nopcode.org>
# @url: http://www.nopcode.org
# @repo: git clone https://github.com/radare/acr
@@ -18,9 +18,7 @@ control_c() {
exit 1
}
trap control_c 2
WANT_PYTHON=0
WANT_PYTHON_BINDINGS=0
WANT_CRASH_REPORTS=0
WANT_QMAKE6=0
split_host() {
S="$"
while : ; do
@@ -86,6 +84,7 @@ HOST="${BUILD}"
TARGET="${HOST}"
ETCDIR="/etc"
SYSCONFDIR=""
DESCRIPTION=""
create_environ() {
: ${EPREFIX:="${PREFIX}"}
@@ -94,6 +93,8 @@ create_environ() {
: ${SBINDIR:="${PREFIX}/sbin"}
: ${ETCDIR:="${SPREFIX}/etc"}
: ${LIBDIR:="${SPREFIX}/lib"}
: ${PKGCFG_LIBDIR:='${exec_prefix}/lib'}
: ${PKGCFG_INCDIR:='${prefix}/include'}
: ${LIBEXECDIR:="${SPREFIX}/libexec"}
: ${INCLUDEDIR:="${SPREFIX}/include"}
: ${DATADIR:="${SPREFIX}/share"}
@@ -112,12 +113,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.9.2' ; VERSION_MAJOR=5; VERSION_MINOR=9; VERSION_PATCH=2; VERSION_NUMBER=50902; 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.9.2 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
@@ -161,10 +162,7 @@ EOF2
printf "
Optional Features:
--with-python build with support for Python
--with-python-bindings
build with Python bindings
--with-crash-reports handle crashes nicely
--with-qmake6 ignore qmake in path when qmake6 is found
"
printf "
Some influential environment variables:
@@ -196,10 +194,10 @@ ocho() {
show_version() {
if [ "$QUIET" = 1 ]; then
echo "5.7.2"
echo "5.9.2"
exit 0
fi
echo "iaito-5.7.2 configuration script done with acr v2.0.0.
echo "iaito-5.9.2 configuration script done with acr v2.1.4.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
@@ -227,11 +225,13 @@ case $flag in
-V|-version|--version)
show_version ; ;;
-r|--r|--report)
echo "PKGNAME: iaito"
echo "VERSION: 5.7.2"
echo "LANGS: c++"
echo "PKG-CONFIG: r_core"
echo "FLAGS: --with-python --with-python-bindings --with-crash-reports"
echo "PKGNAME: iaito"
echo "VERSION: 5.9.2"
echo "AUTHOR: pancake"
echo "EMAIL: pancake@nopcode.org"
echo "LANGS: c++"
echo "PKGCONFIG: r_core"
echo "FLAGS: --with-qmake6"
exit 0
;;
--cache-file)
@@ -271,19 +271,19 @@ echo "FLAGS: --with-python --with-python-bindings --with-crash-reports"
--localstatedir)
LOCALSTATEDIR="$value"; ;;
--libdir)
LIBDIR="$value"; ;;
LIBDIR="$value"
PKGCFG_LIBDIR="$value"; ;;
--libpath)
LDFLAGS="${LDFLAGS} ${LIBPATH}$value"; ;;
--includedir)
PKGCFG_INCDIR="$value"
INCLUDEDIR="$value"; CFLAGS="${CFLAGS} -I$value"; ;;
--infodir)
INFODIR="$value"; ;;
--mandir)
MANDIR="$value"; ;;
"--with-python") WANT_PYTHON="1"; ;;
"--with-python-bindings") WANT_PYTHON_BINDINGS="1"; ;;
"--with-crash-reports") WANT_CRASH_REPORTS="1"; ;;
"--with-qmake6") WANT_QMAKE6="1"; ;;
*) if [ "$value" ]; then eval "`echo $flag2=$value`" ;
else echo ; echo "WARNING: Unknown flag '$flag'." >&2 ; echo ; fi ;;
esac
@@ -301,7 +301,7 @@ parse_options "$1"
shift
done
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CXX CXXFLAGS LDFLAGS HAVE_LANG_CXX CPP PKGCONFIG HAVE_R2 R2 R2_CFLAGS R2_LDFLAGS HAVE_PKGCFG_R_CORE HAVE_QMAKE QMAKE HAVE_LRELEASE LRELEASE WANT_PYTHON WANT_PYTHON_BINDINGS WANT_CRASH_REPORTS"
ENVWORDS="MANDIR DESCRIPTION INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGCFG_LIBDIR PKGCFG_INCDIR PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CXX CXXFLAGS LDFLAGS HAVE_LANG_CXX CPP PKGCONFIG HAVE_R2 R2 R2_CFLAGS R2_LDFLAGS HAVE_PKGCFG_R_CORE HAVE_QMAKE QMAKE HAVE_QMAKE6 QMAKE6 WANT_QMAKE6 QMAKE_BIN WANT_PYTHON WANT_PYTHON_BINDINGS WANT_CRASH_REPORTS"
create_environ
@@ -316,8 +316,6 @@ ocho "checking for working directories... ${WODIS}"
ocho "using prefix '${PREFIX}'"
ACR_RMFILES=" test.c test.cxx a.out a.exe"
COMPILER=CXX
HAVE_LANG_CXX=1
ochof "checking for c++ compiler... "
@@ -345,6 +343,7 @@ exit 1
if [ 0 = 0 ]; then echo ${CPP}; else
echo "ERROR: ${CPP} cannot parse sources"; fi
ochof "checking for pkg-config... "
ENVWORDS="${ENVWORDS} HAVE_PKGCONFIG"
if [ -n "$PKGCONFIG" ]; then
if [ -x "$PKGCONFIG" ]; then
_HAVE_PKGCONFIG="${PKGCONFIG}"
@@ -368,7 +367,9 @@ else
fi
if [ -n "${PKGCONFIG}" ]; then
ocho ${PKGCONFIG}
HAVE_PKGCONFIG=1
else
HAVE_PKGCONFIG=0
echo "Cannot find pkg-config or pkgconf in PATH" >&2
exit 1
ocho no; fi
@@ -440,18 +441,16 @@ if [ "" = 1 ]; then
echo "Cannot find qmake" >&2
else
echo no
fi
echo "error: This program is required." >&2
exit 1 ; fi
ochof "checking for lrelease... "
if [ -x "${LRELEASE}" ]; then
FIND=${LRELEASE}
fi ; fi
ochof "checking for qmake6... "
if [ -x "${QMAKE6}" ]; then
FIND=${QMAKE6}
else
FIND=""
IFS=:
for A in ${PATH} ; do
if [ -x "${A}/lrelease" ]; then
FIND="${A}/lrelease"
if [ -x "${A}/qmake6" ]; then
FIND="${A}/qmake6"
break;
fi
done
@@ -459,18 +458,30 @@ else
fi
if [ -n "${FIND}" ]; then
ocho ${FIND};
HAVE_LRELEASE=1
LRELEASE=${FIND}
HAVE_QMAKE6=1
QMAKE6=${FIND}
else
HAVE_LRELEASE=0
LRELEASE=lrelease
HAVE_QMAKE6=0
QMAKE6=qmake6
if [ "" = 1 ]; then
echo "Cannot find lrelease" >&2
echo "Cannot find qmake6" >&2
else
echo no
fi
echo "error: This program is required." >&2
exit 1 ; fi
fi ; fi
if [ "$WANT_QMAKE6" = "1" ]; then
QMAKE=""; fi
if [ "$HAVE_QMAKE" = "1" ]; then
QMAKE_BIN="${QMAKE}"
else
if [ "$HAVE_QMAKE6" = "1" ]; then
QMAKE_BIN="${QMAKE6}"
else
case "$undefined_variable" in 0|"") echo ; echo "ERROR: Missing qmake" >&2 ; echo ; exit 1 ;; esac; fi; fi
if [ "$QMAKE_BIN" = """" ]; then
case "$undefined_variable" in 0|"") echo ; echo "ERROR: Missing qmake" >&2 ; echo ; exit 1 ;; esac; fi
WANT_PYTHON="0"
WANT_PYTHON_BINDINGS="0"
WANT_CRASH_REPORTS="0"
SEDFLAGS=" -e '"
COUNT=0
for A in ${ENVWORDS} ; do
@@ -515,3 +526,12 @@ done
done
do_remove
if [ "$QUIET" = 0 ]; then
echo
echo "Final report:"
for A in R2 QMAKE_BIN ; do
eval VAL="\$${A}"
[ -z "${VAL}" ] && VAL="\"\""
echo " - ${A} = ${VAL}"
done
fi
+30 -3
View File
@@ -1,5 +1,5 @@
PKGNAME iaito
VERSION 5.7.2
VERSION 5.9.2
CONTACT pancake ; [email protected]
LANG_CXX!
@@ -7,11 +7,38 @@ LANG_CXX!
USE_PKGCONFIG!
CHKPRG! R2 r2
PKGCFG! R2_CFLAGS R2_LDFLAGS r_core
CHKPRG! QMAKE qmake
CHKPRG! LRELEASE lrelease
CHKPRG QMAKE qmake
CHKPRG QMAKE6 qmake6
(( CHKPRG! LRELEASE lrelease ))
ARG_WITH WANT_QMAKE6 qmake6 ignore qmake in path when qmake6 is found ;
IF WANT_QMAKE6 {
QMAKE = "" ;
}
IFEQ HAVE_QMAKE 1 ; {
QMAKE_BIN = ${QMAKE} ;
}{
IFEQ HAVE_QMAKE6 1 ; {
QMAKE_BIN = ${QMAKE6} ;
}{
DIENOW Missing qmake ;
}
}
IFEQ QMAKE_BIN "" ; {
DIENOW Missing qmake ;
}
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 ;
REPORT R2 QMAKE_BIN ;
+9 -1
View File
@@ -10,14 +10,21 @@ IF !ERRORLEVEL! NEQ 0 (
EXIT /B 1
)
SET "R2DIST=r2_dist"
SET "R2DIR=radare2"
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
rem MOVE radare2 %R2DIR%
IF NOT EXIST %BUILDDIR% (
MKDIR %BUILDDIR%
)
CD %BUILDDIR%
IF NOT DEFINED IAITO_ENABLE_CRASH_REPORTS (
@@ -26,4 +33,5 @@ SET "IAITO_ENABLE_CRASH_REPORTS=false"
ECHO Building iaito
qmake BREAKPAD_SOURCE_DIR=%BREAKPAD_SOURCE_DIR% IAITO_ENABLE_CRASH_REPORTS=%IAITO_ENABLE_CRASH_REPORTS% %* ..\src\iaito.pro -config release
COPY iaito_resource.rc ..\src
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
+1 -1
View File
@@ -1,7 +1,7 @@
NAME=iaito
SECTION=editors
PRIORITY=optional
DEPENDS=qt5-default libqt5svg5
DEPENDS=$(shell ../getpkgversions.sh radare2 libqt5core5a libqt5gui5 libqt5widgets5 libqt5network5 libqt5svg5)
MAINTAINER=pancake <[email protected]>
ARCH?=amd64
VERSION=$(shell ../../../configure -qV)
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
for pkg in "$@"
do
VERSION=$(apt show $pkg 2> /dev/null | grep -F "Version: " | sed -e 's/Version:\s\([[[:digit:]\.]\+\).*/\1/')
if [ $pkg != $1 ]; then
echo -n ", "
fi
echo -n "$pkg (>= $VERSION)"
done
+1 -2
View File
@@ -1,6 +1,5 @@
PACKAGE_DIR=$(shell pwd)
include ./CONFIG
DEPENDS=
SUDO=fakeroot
SUDO=sudo
@@ -19,7 +18,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
+4
View File
@@ -1,4 +1,8 @@
all:
rm -f ../../build/iaito.dmg
cd ../../build && macdeployqt iaito.app -dmg && cp -f iaito.dmg ../dist/macos
app:
$(SHELL) make-macos-app.sh
pkg:
+40 -3
View File
@@ -1,6 +1,7 @@
#!/bin/sh
SKIPBUILD=0
BUNDLE=1
SRC=/tmp/iaito-macos
PREFIX=/usr/local
@@ -31,13 +32,49 @@ 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
(
( # bundle
LIBS=`rabin2 -ql ${SRC}/usr/local/bin/iaito | grep -v System`
mkdir -p bundle
for a in $LIBS ; do
echo "LIB $a"
D="`basename '$a'`"
cp -f $a bundle
LIBS2=`rabin2 -ql ${a} | grep -v System`
for b in $LIBS2 ; do
D2="`basename '$a'`"
echo "$a $b"
cp $b bundle
done
done
# binary patch the binary
echo cp -f ${SRC}/usr/local/bin/iaito bundle/
cp -f ${SRC}/usr/local/bin/iaito bundle/
for a in bundle/* ; do
libs=`rabin2 -ql $a | grep -v System`
for b in $libs ; do
bn=`basename "$b"`
if ls bundle | grep -q "$bn" ; then
# its bundled
from="$b"
to="@executable_path/lib/$bn"
echo install_name_tool "$from" "$to" "$a"
install_name_tool -change "$from" "$to" "$a"
fi
done
done
rm -rf bundle/lib
mkdir -p bundle/lib
mv bundle/* bundle/lib
mv bundle/lib/iaito bundle/
# cp -f ${SRC}/usr/local/bin/iaito bundle/
exit 1
)
( # massage
cd ${SRC} && find .
mv usr/local/share/iaito/translations Applications/iaito.app/Contents/Resources || exit 1
cd Applications || exit 1
+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
+18 -14
View File
@@ -1,24 +1,28 @@
SET "R2DIST=r2_dist"
SET "R2DIR=radare2"
SET "BUILDDIR=build_%PLATFORM%"
ECHO Preparing directory
RMDIR /S /Q %BUILDDIR%
MKDIR %BUILDDIR%
CD src
meson ..\release
CD ..\release
ninja -v -j1
meson --buildtype=release ..\%BUILDDIR%
CD ..\%BUILDDIR%
ninja -j4
REM IF !ERRORLEVEL! NEQ 0 EXIT /B 1
CD ..
ECHO Deploying iaito
MKDIR iaito
COPY release\iaito.exe iaito\iaito.exe
XCOPY /S /I ..\%R2DIST%\share iaito\share
XCOPY /S /I ..\%R2DIST%\lib iaito\lib
DEL iaito\lib\*.lib
COPY ..\%R2DIST%\bin\*.dll iaito\
windeployqt iaito\iaito.exe
FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" iaito\translations
IF NOT EXIST release (
MKDIR release
)
COPY %BUILDDIR%\iaito.exe release\iaito.exe
XCOPY /S /I %R2DIR%\share release\share
XCOPY /S /I %R2DIR%\lib release\lib
DEL release\lib\*.lib
COPY %R2DIR%\bin\*.dll release\
windeployqt release\iaito.exe
FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" release\translations
IF DEFINED CI (
RENAME release iaito
)
ENDLOCAL
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
git submodule update --init
+9 -11
View File
@@ -1,6 +1,6 @@
@ECHO OFF
SET "R2V=5.7.0"
IF NOT DEFINED R2V SET "R2V=5.8.8"
SET ARCH=x64
SETLOCAL ENABLEDELAYEDEXPANSION
@@ -14,24 +14,22 @@ IF !ERRORLEVEL! NEQ 0 (
)
SET "PATH=%CD%;%PATH%"
SET "R2DIST=r2_dist"
SET "R2DIR=radare2"
IF NOT DEFINED CI (
ECHO Downloading radare2 (%PLATFORM%)
rem powershell -command "Invoke-WebRequest 'https://github.com/radareorg/radare2/releases/download/5.1.0/radare2-5.1.0_windows.zip' -OutFile 'radare2-5.1.0_windows.zip'"
pip install wget
python -m wget -o r2.zip https://github.com/radareorg/radare2/releases/download/%R2V%/radare2-%R2V%-w64.zip
curl -L -o r2.zip https://github.com/radareorg/radare2/releases/download/%R2V%/radare2-%R2V%-w64.zip
unzip r2.zip
RENAME radare2-%R2V%-w64 radare2
RMDIR /S /Q %R2DIST%
MOVE radare2-%R2V%-w64 %R2DIST%
SET "PATH=%CD%\%R2DIST%\bin;%PATH%"
RENAME radare2-%R2V%-w64 %R2DIR%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" %ARCH%
)
SET "PATH=%CD%\%R2DIR%\bin;%PATH%"
rem ECHO Building radare2 (%PLATFORM%)
rem CD radare2
rem git clean -xfd
rem RMDIR /S /Q ..\%R2DIST%
rem RMDIR /S /Q ..\%R2DIR%
rem meson -C src r2_builddir
rem meson.exe r2_builddir --buildtype=release --prefix=%CD%\..\%R2DIST% || EXIT /B 1
rem meson.exe r2_builddir --buildtype=release --prefix=%CD%\..\%R2DIR% || EXIT /B 1
rem ninja -C r2_builddir install || EXIT /B 1
rem IF !ERRORLEVEL! NEQ 0 EXIT /B 1
Binary file not shown.

After

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

-59
View File
@@ -1,59 +0,0 @@
#!/bin/bash
set -euo pipefail
if ! [[ $# -eq 3 ]]; then
echo "Usage: $0 [Python.framework] [AppBundle.app] [AppBundle.app/Contents/MacOS/Executable]"
exit 1
fi
python_version=python3.6
py_framework=$1
appbundle=$2
executable=$3
echo "Embedding $py_framework into $appbundle | $executable"
mkdir -p "$appbundle/Contents/Frameworks"
if [ ! -d "$appbundle/Contents/Frameworks/Python.framework" ]
then
cp -a -n "$py_framework" "$appbundle/Contents/Frameworks/"
echo "Cleaning up embedded Python Framework"
cd "$appbundle/Contents/Frameworks/Python.framework"
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
rm -r Versions/Current/Resources/* "Versions/Current/lib/$python_version/test" "Versions/Current/lib/$python_version/idlelib" "Versions/Current/lib/$python_version/curses" "Versions/Current/lib/$python_version/lib2to3" || echo "Couldn't remove something"
else
echo "Python.framework already exists, skipping copying"
cd "$appbundle/Contents/Frameworks/Python.framework"
fi
echo "Making executable $executable point to embedded Framework"
install_name_tool -change `otool -L "$executable" | sed -n "s/^[[:blank:]]*\([^[:blank:]]*Python\) (.*$/\1/p"` @executable_path/../Frameworks/Python.framework/Versions/Current/Python "$executable"
<<<<<<< HEAD:scripts/appbundle_embed_python.sh
echo "Cleaning up embedded Python Framework"
cd "$appbundle/Contents/Frameworks/Python.framework" || exit 1
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf || exit 1
rm -r Versions/Current/Resources/* Versions/Current/lib/python3.6/test Versions/Current/lib/python3.6/idlelib Versions/Current/lib/python3.6/curses Versions/Current/lib/python3.6/lib2to3 || exit 1
=======
>>>>>>> 29cbd06a... Run macos packaging in GHA. (#2529):dist/appbundle_embed_python.sh
echo "Checking if PySide2 is available"
pyside_prefix=$(pkg-config --variable=prefix pyside2)
if [ $? -ne 0 ]; then
echo "PySide2 is not available, ignoring."
exit 0
fi
echo "PySide is at $pyside_prefix"
if [ ! -d "Versions/Current/lib/$python_version/site-packages/PySide2" ]
then
cp -va "$pyside_prefix/lib/$python_version/" "Versions/Current/lib/$python_version"
cd .. # $appbundle/Contents/Frameworks
cp -va "$pyside_prefix/lib/"*.dylib .
else
echo "site-packages/Pyside2 exists, skipping copying"
fi
-33
View File
@@ -1,33 +0,0 @@
#!/bin/bash
if ! [[ $# -eq 1 ]]; then
echo "Usage: $0 [AppBundle.app]"
exit 1
fi
appbundle=$1
qtwebegineprocess="$1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess"
echo "Patching $appbundle to fix QtWebEngine"
if ! [[ -f "$qtwebegineprocess" ]]; then
echo "$qtwebegineprocess does not exist. Did you forget to run macdeployqt?"
exit 1
fi
install_name_tool `otool -L "$qtwebegineprocess" | sed -n "s/^[[:blank:]]*\(\/usr\/local\/Cellar[^[:blank:]]*\(Qt[A-Za-z]*\.framework[^[:blank:]]*\)\) (.*$/-change \1 @executable_path\/..\/..\/..\/..\/..\/..\/..\/\2/p"` \
$1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/MacOS/QtWebEngineProcess \
|| exit 1
mkdir -p $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks
ln -s ../../../../../../../QtCore.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
ln -s ../../../../../../../QtQuick.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
ln -s ../../../../../../../QtGui.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
ln -s ../../../../../../../QtQml.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
ln -s ../../../../../../../QtNetwork.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
ln -s ../../../../../../../QtWebChannel.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
ln -s ../../../../../../../QtPositioning.framework $1/Contents/Frameworks/QtWebEngineCore.framework/Helpers/QtWebEngineProcess.app/Contents/Frameworks/
-37
View File
@@ -1,37 +0,0 @@
#!/bin/bash
if ! [[ $# -eq 1 ]]; then
echo "Usage: $0 [appdir]"
exit 1
fi
python_version=python3.6
python_prefix=$(pkg-config --variable=prefix python3)
appdir=$1
echo "Embedding Python from prefix $python_prefix in appdir $appdir"
mkdir -p "$appdir/usr"
cd "$appdir/usr/" || exit 1
cp -RT "$python_prefix" "." || exit 1
echo "Cleaning up embedded Python"
find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
rm -r lib/$python_version/test lib/$python_version/idlelib lib/$python_version/curses lib/$python_version/lib2to3
echo "Checking if PySide2 is available"
pyside_prefix=$(pkg-config --variable=prefix pyside2)
if [ $? -ne 0 ]; then
echo "PySide2 is not available, ignoring."
exit 0
fi
echo "PySide is at $pyside_prefix"
if [ "$pyside_prefix" == "$python_prefix" ]; then
echo "Prefixes are equal, not copying anything from lib"
else
cp -RT "$pyside_prefix/lib/$python_version" "lib/$python_version" || exit 1
fi
-11
View File
@@ -1,11 +0,0 @@
#!/bin/bash
set -eu
scripts/r2ghidra.sh \
-DCMAKE_C_COMPILER=cl \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH="$APPVEYOR_BUILD_FOLDER/r2_dist;$APPVEYOR_BUILD_FOLDER/r2_dist/include/libr;$APPVEYOR_BUILD_FOLDER/r2_dist/include/libr/sdb" \
-DCMAKE_INSTALL_PREFIX="$APPVEYOR_BUILD_FOLDER/r2_dist" \
-DRADARE2_INSTALL_PLUGDIR="$APPVEYOR_BUILD_FOLDER/r2_dist/lib/plugins" \
-DBUILD_SLEIGH_PLUGIN=OFF
+3 -1
View File
@@ -1,8 +1,10 @@
# This script is deprecated and it is not going to work
# But it's kept for future work towards supporting it again
$dist = $args[0]
$python = Split-Path((Get-Command python.exe).Path)
if (-not (Test-Path -Path 'r2dec-js' -PathType Container)) {
git clone https://github.com/radareorg/r2dec-js.git --branch master --depth 1
git clone https://github.com/wargio/r2dec-js.git --branch master --depth 1
}
cd r2dec-js
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
+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
-17
View File
@@ -1,17 +0,0 @@
{
'includes': [
'../../../build/common.gypi',
],
'targets': [
{
'target_name': 'dump_syms',
'type': 'executable',
'sources': [
'dump_syms.cc',
],
'dependencies': [
'../../../common/windows/common_windows.gyp:common_windows_lib',
],
},
],
}
-26
View File
@@ -1,26 +0,0 @@
#!/bin/bash
if [ ! $# -eq 2 ]; then
echo "usage: $0 [Iaito.app] [dst]"
exit 1
fi
appbundle="$1"
dst="$2"
files="$appbundle/Contents/MacOS/Iaito.bin $appbundle/Contents/Frameworks/Python.framework/Python $(find "$appbundle" -type f -name '*.dylib')"
mkdir -p "$dst" || exit 1
for file in $files; do
echo "Dumping syms from $file"
dump_syms "$file" > "$dst/tmp.sym" || echo "Failed to dump syms from $file"
infoline=($(head -n1 "$dst/tmp.sym"))
id=${infoline[3]}
name=${infoline[4]}
dir="$dst/$name/$id"
mkdir -p "$dir"
mv "$dst/tmp.sym" "$dir/$name.sym"
done
echo "Done"
Regular → Executable
+1 -1
View File
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
import os
import re
+1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
import sys
import re
+2
View File
@@ -1,3 +1,5 @@
#!/usr/bin/env python3
import os
import sys
+92
View File
@@ -0,0 +1,92 @@
#!/bin/sh
#
# This script parses the commit messages between the last 2 git tags
# if the last commit contains the word "Release", otherwise it shows
# all the changes between the last tag and HEAD.
#
# Commits are grouped in different sections specified in the commit
# message with the middle-dot character '·'. The section names are
# arbitrary and we may be careful to use them properly but having
# in mind that this may change.
#
# Commits without any middle·dot in the message are discarted and
# displayed in the "to review" section.
#
# The tool prints Markdown, no plans to support other formats.
#
# Usage: sys/release-notes.sh 4.5.1 # from HEAD to 4.5.1
# $ sys/release-notes.sh 4.5.1 -v # same as above but include untagged commits
# $ sys/release-notes.sh 4.5.0 4.5.1 # from 4.5.0 to 4.5.1
#
# --pancake
if [ -n "`git log -n 1 | grep Release`" ]; then
VERS=`git tag --sort=committerdate | grep -v conti | tail -n 1`
PREV=`git tag --sort=committerdate | grep -v conti | tail -n 2 | head -n1`
else
VERS=HEAD
PREV=`git tag --sort=committerdate | grep -v conti | tail -n 1`
fi
[ -n "$1" ] && PREV="$1"
[ -n "$2" ] && VERS="$2"
git log ${PREV}..${VERS} > .l
# When HEAD contains a tag do this magic
if [ ! -s .l ]; then
VERS=$PREV
PREV=`git tag --sort=committerdate | grep -v conti | tail -n 2 | head -n1`
git log ${PREV}..${VERS} > .l
fi
grep ^Author .l | cut -d : -f 2- | sed -e 's,radare,pancake,' | sort -u > .A
echo "## Release Notes"
echo
echo "Version: ${VERS} (previous: ${PREV})"
N=`grep ^commit .l | wc -l`
echo "Commits: $N from `wc -l .A | awk '{print $1}'` contributors"
echo
echo "Release builds (binary assets below) are considered work-in-progress, use flatpak or your distro packaging if anything is not working"
echo
echo "## Flatpak (WSL / Linux)"
echo
echo "\`\`\`sh"
echo "sudo flatpak remote-add flathub https://dl.flathub.org/repo/flathub.flatpakrepo"
echo "sudo flatpak install flathub org.radare.iaito"
echo "export QT_QPA_PLATFORM=wayland # only mandatory on windows"
echo "flatpak run org.radare.iaito"
echo "\`\`\`"
echo
echo "## Build from Source"
echo
echo "\`\`\`sh"
echo "curl -sL https://github.com/radareorg/iaito/releases/download/${VERS}/${VERS}.tar.gz | tar xzv"
echo "iaito-${VERS}/sys/install.sh"
echo "\`\`\`"
echo
echo "## Highlights"
echo "<details><summary>More details</summary><p>"
echo
echo "## Authors"
echo
cat .A | perl -ne '/([^<]+)(.*)$/;$a=$1;$b=$2;$a=~s/^\s+|\s+$//g;$b=~s/[<>\s]//g;print "[$a](mailto:$b) "'
echo
echo
cat .x | grep -v '##' | sed -e 's,^ *,,g' | grep -v "^$" | \
perl -ne 'if (/^\*/) { print "$_"; } else { print "* $_";}'
# echo "## Changes"
# echo
# cat .l | grep -v ^commit | grep -v ^Author | grep -v ^Date > .x
# cat .x | grep '##' | perl -ne '/##([^ ]*)/; if ($1) {print "$1\n";}' | sort -u > .y
# for a in `cat .y` ; do
# echo "**$a**"
# echo
# cat .x | grep "##$a" | sed -e 's/##.*//g' | perl -ne '{ s/^\s+//; print "* $_"; }'
# echo
# done
# rm -f .x .y .l .A
echo '</p></details>'
-64
View File
@@ -1,64 +0,0 @@
# Copyright 2019 Wason Technology, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if [ $# -eq 0 ]
then
echo "No bat file specified"
return
fi
#echo `dirname "$(readlink -f "$_")"`
___update_env_func___() {
tmpbat=$(mktemp --suffix .bat)
rc=$?; if [[ $rc != 0 ]]; then
echo "Could not create temporary bat file"
return $rc
fi
echo "@echo off " >> $tmpbat
echo "call \"$@\" 1>&2 " >> $tmpbat
echo "if %errorlevel% neq 0 exit /b %errorlevel%" >> $tmpbat
echo "printenv " >> $tmpbat
echo "if %errorlevel% neq 0 exit /b %errorlevel%" >> $tmpbat
rc=$?; if [[ $rc != 0 ]]; then
echo "Could not write temporary bat file"
return $rc
fi
tmpbat_win=$(basename $tmpbat)
env_data=$(cmd "/c call %TEMP%\\$tmpbat_win ")
rc=$?; if [[ $rc != 0 ]]; then
echo "Could not run temporary bat file"
return $rc
fi
echo
echo
echo
#Space at the end is lost for some reason,
#save and restore PS1
ps1_old=$PS1
while read -r line; do
echo "export $line"
export "$line"
done <<< "$env_data"
export PS1="$ps1_old"
}
___update_env_func___ $@
unset -f ___update_env_func___
cd `pwd`
+34
View File
@@ -0,0 +1,34 @@
#include <r_core.h>
extern int main_iaito();
static int r_cmd_anal_call(void *user, const char *input) {
RCore *core = (RCore*)user;
if (r_str_startswith (input, "iaito")) {
char *n = r_str_newf ("%p", user);
r_sys_setenv ("R2COREPTR", n);
free (n);
main_iaito ();
return true;
}
return false;
}
extern "C" {
// PLUGIN Definition Info
RCorePlugin r_core_plugin_iaito = {
.meta = {
.name = (char *)"iaito",
.desc = (char *)"Start iaito GUI from the radare2 shell",
.license = (char *)"LGPL3",
},
.call = r_cmd_anal_call,
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_CORE,
.data = &r_core_plugin_iaito,
.version = R2_VERSION
};
#endif
}
+25 -37
View File
@@ -3,22 +3,28 @@ TEMPLATE = app
TARGET = iaito
IAITO_VERSION_MAJOR = 5
IAITO_VERSION_MINOR = 7
IAITO_VERSION_MINOR = 9
IAITO_VERSION_PATCH = 2
CONFIG+=app_bundle
# LIBS+= -dead_strip
CONFIG += sdk_no_version_check
unix:QMAKE_RPATHDIR += /usr/local/lib
unix:QMAKE_LFLAGS_RPATH=
unix:QMAKE_LFLAGS += "-Wl,-rpath,/usr/local/lib"
QMAKE_CXXFLAGS += $$(CXXFLAGS)
QMAKE_CFLAGS += $$(CFLAGS)
QMAKE_LFLAGS += $$(LDFLAGS)
# build with thread-sanitizer
# 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 +32,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
@@ -59,12 +41,14 @@ win32: RC_ICONS = img/iaito-o.ico
QT += core gui widgets svg network
QT_CONFIG -= no-pkg-config
greaterThan(QT_MAJOR_VERSION, 5): QT += svgwidgets
!defined(IAITO_ENABLE_CRASH_REPORTS, var) IAITO_ENABLE_CRASH_REPORTS=false
equals(IAITO_ENABLE_CRASH_REPORTS, true) CONFIG += IAITO_ENABLE_CRASH_REPORTS
!defined(IAITO_ENABLE_PYTHON, var) IAITO_ENABLE_PYTHON=false
equals(IAITO_ENABLE_PYTHON, true) CONFIG += IAITO_ENABLE_PYTHON
IAITO_ENABLE_PYTHON=false
!defined(IAITO_ENABLE_PYTHON_BINDINGS, var) IAITO_ENABLE_PYTHON_BINDINGS=false
equals(IAITO_ENABLE_PYTHON, true) {
@@ -84,25 +68,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) {
@@ -118,8 +105,8 @@ INCLUDEPATH *= . core widgets dialogs common plugins menus
win32 {
# Generate debug symbols in release mode
QMAKE_CXXFLAGS_RELEASE += -Zi # Compiler
QMAKE_LFLAGS_RELEASE += /DEBUG # Linker
# QMAKE_CXXFLAGS_RELEASE += -Zi # Compiler
# QMAKE_LFLAGS_RELEASE += /DEBUG # Linker
# Multithreaded compilation
QMAKE_CXXFLAGS += -MP
@@ -475,6 +462,7 @@ GRAPHVIZ_SOURCES = \
widgets/GraphvizLayout.cpp
HEADERS += \
common/R2Shims.h \
core/Iaito.h \
core/IaitoCommon.h \
core/IaitoDescriptions.h \
@@ -719,10 +707,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 +731,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){
+56 -34
View File
@@ -15,7 +15,9 @@
#include <QMenu>
#include <QMessageBox>
#include <QCommandLineParser>
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
#include <QTextCodec>
#endif
#include <QStringList>
#include <QProcess>
#include <QPluginLoader>
@@ -40,15 +42,15 @@ static bool versionCheck() {
QStringList la = a.split(".");
QStringList lb = b.split(".");
if (la.size() < 2 && lb.size() < 2) {
eprintf ("Invalid version string somwhere\n");
R_LOG_WARN ("Invalid version string somwhere");
return false;
}
if (la.at(0) != lb.at(0)) {
eprintf ("Major version differs\n");
R_LOG_WARN ("Major version differs");
return false;
}
if (la.at(1) != lb.at(1)) {
eprintf ("Minor version differs\n");
R_LOG_WARN ("Minor version differs");
return false;
}
return true;
@@ -91,14 +93,16 @@ IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc,
// Set QString codec to UTF-8
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8"));
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
QTextCodec::setCodecForTr(QTextCodec::codecForName("UTF-8"));
#endif
#endif
if (!parseCommandLineOptions()) {
std::exit(1);
QCoreApplication::exit();
// std::exit(1);
}
if (!versionCheck ()) {
@@ -112,7 +116,8 @@ IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc,
QObject::tr("The version used to compile Iaito (%1) does not match the binary version of radare2 (%2). This could result in unexpected behaviour. Are you sure you want to continue?")).arg(
localVersion, r2version));
if (msg.exec() == QMessageBox::No) {
std::exit(1);
QCoreApplication::exit();
// std::exit(1);
}
}
@@ -132,7 +137,7 @@ IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc,
Core()->initialize(clOptions.enableR2Plugins);
Core()->setSettings();
Config()->loadInitial();
Core()->loadIaitoRC();
Core()->loadIaitoRC(0);
Config()->setOutputRedirectionEnabled(clOptions.outputRedirectionEnabled);
@@ -167,10 +172,14 @@ IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc,
setStyle(new IaitoProxyStyle());
#endif // QT_VERSION_CHECK(5, 10, 0) < QT_VERSION
if (clOptions.args.empty()) {
RCore *kore = iaitoPluginCore();
if (kore) {
mainWindow->openCurrentCore(clOptions.fileOpenOptions, false);
} else if (clOptions.args.empty()) {
// check if this is the first execution of Iaito in this computer
// Note: the execution after the preferences been reset, will be considered as first-execution
if (Config()->isFirstExecution()) {
// TODO: add cmdline flag to show the welcome dialog
mainWindow->displayWelcomeDialog();
}
mainWindow->displayNewFileDialog();
@@ -248,27 +257,34 @@ void IaitoApplication::launchNewInstance(const QStringList &args)
process.startDetached(qApp->applicationFilePath(), allArgs);
}
bool IaitoApplication::event(QEvent *e)
{
if (e->type() == QEvent::FileOpen) {
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(e);
if (openEvent) {
if (m_FileAlreadyDropped) {
// We already dropped a file in macOS, let's spawn another instance
// (Like the File -> Open)
QString fileName = openEvent->file();
launchNewInstance({fileName});
} else {
QString fileName = openEvent->file();
m_FileAlreadyDropped = true;
mainWindow->closeNewFileDialog();
InitialOptions options;
options.filename = fileName;
mainWindow->openNewFile(options);
}
}
}
return QApplication::event(e);
bool IaitoApplication::event(QEvent *e) {
if (e->type() == QEvent::FileOpen) {
RCore *kore = iaitoPluginCore();
if (kore) {
return false;
}
QFileOpenEvent *openEvent = static_cast<QFileOpenEvent *>(e);
if (openEvent) {
if (m_FileAlreadyDropped) {
// We already dropped a file in macOS, let's spawn another instance
// (Like the File -> Open)
QString fileName = openEvent->file();
launchNewInstance({fileName});
} else {
QString fileName = openEvent->file();
// eprintf ("FILE %s\n", fileName.toStdString().c_str());
if (fileName == "") {
return false;
}
m_FileAlreadyDropped = true;
mainWindow->closeNewFileDialog();
InitialOptions options;
options.filename = fileName;
mainWindow->openNewFile(options);
}
}
}
return QApplication::event(e);
}
bool IaitoApplication::loadTranslations()
@@ -343,8 +359,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);
@@ -403,9 +419,9 @@ bool IaitoApplication::parseCommandLineOptions()
bool analLevelSpecified = false;
int analLevel = cmd_parser.value(analOption).toInt(&analLevelSpecified);
if (!analLevelSpecified || analLevel < 0 || analLevel > 2) {
if (!analLevelSpecified || analLevel < 0 || analLevel > 3) {
fprintf(stderr, "%s\n",
QObject::tr("Invalid Analysis Level. May be a value between 0 and 2.").toLocal8Bit().constData());
QObject::tr("Invalid Analysis Level. May be a value between 0 and 3.").toLocal8Bit().constData());
return false;
}
switch (analLevel) {
@@ -418,6 +434,9 @@ bool IaitoApplication::parseCommandLineOptions()
case 2:
opts.analLevel = AutomaticAnalysisLevel::AAAA;
break;
case 3:
opts.analLevel = AutomaticAnalysisLevel::AAAAA;
break;
}
}
@@ -448,7 +467,10 @@ bool IaitoApplication::parseCommandLineOptions()
opts.fileOpenOptions.analCmd = { {"aaa", "Auto analysis"} };
break;
case AutomaticAnalysisLevel::AAAA:
opts.fileOpenOptions.analCmd = { {"aaaa", "Auto analysis (experimental)"} };
opts.fileOpenOptions.analCmd = { {"aaaa", "Advanced analysis"} };
break;
case AutomaticAnalysisLevel::AAAAA:
opts.fileOpenOptions.analCmd = { {"aaaaa", "Auto analysis (experimental)"} };
break;
}
opts.fileOpenOptions.script = cmd_parser.value(scriptOption);
+1 -1
View File
@@ -9,7 +9,7 @@
#include "core/MainWindow.h"
enum class AutomaticAnalysisLevel {
Ask, None, AAA, AAAA
Ask, None, AAA, AAAA, AAAAA
};
struct IaitoCommandLineOptions {
+5 -3
View File
@@ -100,8 +100,10 @@ int main(int argc, char *argv[])
updateWorker->checkCurrentVersion(7000);
#endif
}
return a.exec();
}
int ret = a.exec();
return ret;
int main_iaito() {
char *argv[] = {(char *)"iaito"};
return main(1, argv);
}
+4
View File
@@ -3,6 +3,10 @@
#include <stdexcept>
AddressableItemModelI::~AddressableItemModelI() {
/* nothing to see */
}
AddressableFilterProxyModel::AddressableFilterProxyModel(AddressableItemModelI *sourceModel,
QObject *parent) :
AddressableItemModel<QSortFilterProxyModel>(parent)
+1
View File
@@ -11,6 +11,7 @@
class IAITO_EXPORT AddressableItemModelI
{
public:
virtual ~AddressableItemModelI() = 0;
virtual RVA address(const QModelIndex &index) const = 0;
/**
* @brief Get name for item, optional.
+1 -2
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)
@@ -70,7 +69,7 @@ void AnalTask::runTask()
if (isInterrupted()) {
return;
}
Core()->setConfig("anal.vars", options.analVars);
if (!options.os.isNull()) {
Core()->setConfig("asm.os", options.os);
}
+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"
+43 -22
View File
@@ -59,35 +59,56 @@ const QStringList ColorThemeWorker::radare2UnusedOptions = {
ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent)
{
char* szThemes = r_str_home(R2_HOME_THEMES);
customR2ThemesLocationPath = szThemes;
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)
};
if (currDir.exists()) {
standardR2ThemesLocationPath = currDir.absolutePath();
} else {
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.")
.arg(currDir.path())
);
}
#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 ()) {
// let the user place their color themes here
QDir().mkpath (customR2ThemesLocationPath);
}
// resolve system path (version specific)
QDir currDir {
QStringLiteral("%1%2%3")
.arg(r_sys_prefix(nullptr))
.arg(R_SYS_DIR)
.arg(R2_THEMES)
};
if (currDir.exists ()) {
standardR2ThemesLocationPath = currDir.absolutePath ();
} else {
// if not found just use /last/ instead of the version
QDir currDir {
QStringLiteral("%1/%3")
.arg(r_sys_prefix(nullptr))
.arg("share/radare2/last/cons")
};
if (currDir.exists ()) {
standardR2ThemesLocationPath = currDir.absolutePath ();
} else {
QMessageBox::critical (nullptr,
tr("Standard themes not found"),
tr("Cannot find radare2 console themes in '%1'. ")
.arg(currDir.path()));
}
}
}
QColor ColorThemeWorker::mergeColors(const QColor& upper, const QColor& lower) const
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
// not implemented Qt::SHIFT doesnt exist
float r1, g1, b1, a1;
float r2, g2, b2, a2;
float r, g, b, a;
#else
qreal r1, g1, b1, a1;
qreal r2, g2, b2, a2;
qreal r, g, b, a;
#endif
upper.getRgbF(&r1, &g1, &b1, &a1);
lower.getRgbF(&r2, &g2, &b2, &a2);
+8 -3
View File
@@ -68,6 +68,8 @@ const QHash<QString, QHash<ColorFlags, QColor>> Configuration::cutterOptionColor
{ LightFlag, QColor(0x00, 0x80, 0x00) }} },
{ "gui.item_unsafe", { { DarkFlag, QColor(0xff, 0x81, 0x7b) },
{ LightFlag, QColor(0xff, 0x81, 0x7b) }} },
{ "gui.item_thread_unsafe", { { DarkFlag, QColor(0x7b, 0x81, 0xff) },
{ LightFlag, QColor(0x7b, 0x81, 0xff) }} },
{ "gui.navbar.seek", { { DarkFlag, QColor(0xe9, 0x56, 0x56) },
{ LightFlag, QColor(0xff, 0x00, 0x00) }} },
{ "gui.navbar.pc", { { DarkFlag, QColor(0x42, 0xee, 0xf4) },
@@ -130,7 +132,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 +149,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}
};
@@ -696,6 +698,9 @@ QStringList Configuration::getAvailableTranslations()
for (auto j : allLocales) {
if (j.name().startsWith(localeName)) {
currLanguageName = j.nativeLanguageName();
if (currLanguageName == nullptr) {
break;
}
currLanguageName = currLanguageName.at(0).toUpper() +
currLanguageName.right(currLanguageName.length() - 1);
languages << currLanguageName;
+1 -1
View File
@@ -129,7 +129,7 @@ public:
// Asm Options
void resetToDefaultAsmOptions();
QString getColorTheme() const { return s.value("theme", "cutter").toString(); }
QString getColorTheme() const { return s.value("theme", "iaito").toString(); }
void setColorTheme(const QString &theme);
/**
* @brief Change current color theme if it doesn't much native theme's darkness.
+48
View File
@@ -28,11 +28,58 @@ 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) {
return;
}
task = new R2Task("pddj @ " + QString::number(addr));
connect(task, &R2Task::finished, this, [this]() {
QJsonObject json = task->getResultJson().object();
@@ -78,4 +125,5 @@ void R2DecDecompiler::decompileAt(RVA addr)
emit finished(code);
});
task->startTask();
}
+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);
}
};
+13 -1
View File
@@ -21,6 +21,15 @@ static QAbstractItemView::ScrollMode scrollMode()
return use_scrollperpixel ? QAbstractItemView::ScrollPerPixel : QAbstractItemView::ScrollPerItem;
}
RCore *iaitoPluginCore(void) {
char *p = r_sys_getenv ("R2COREPTR");
if (R_STR_ISNOTEMPTY (p)) {
RCore *k = (RCore *)(void*)(size_t)r_num_get (NULL, p);
free (p);
return k;
}
return nullptr;
}
namespace qhelpers {
@@ -42,13 +51,16 @@ QString formatBytecount(const uint64_t bytecount)
void adjustColumns(QTreeView *tv, int columnCount, int padding)
{
for (int i = 0; i != columnCount; ++i) {
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
for (int i = 0; i < columnCount; i++) {
tv->resizeColumnToContents(i);
if (padding > 0) {
int width = tv->columnWidth(i);
tv->setColumnWidth(i, width + padding);
}
}
#endif
}
void adjustColumns(QTreeWidget *tw, int padding)
+7
View File
@@ -30,6 +30,13 @@ class QComboBox;
#define IAITO_QT_SKIP_EMPTY_PARTS Qt::SkipEmptyParts
#endif
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define FILTER_REGEX this->filterRegularExpression()
#else
#define FILTER_REGEX filterRegExp()
#endif
RCore *iaitoPluginCore(void);
namespace qhelpers {
IAITO_EXPORT QString formatBytecount(const uint64_t bytecount);
IAITO_EXPORT void adjustColumns(QTreeView *tv, int columnCount, int padding);
+1
View File
@@ -26,6 +26,7 @@ struct InitialOptions
QString cpu;
int bits = 0;
QString os;
bool analVars = true;
Endianness endian;
+1
View File
@@ -4,6 +4,7 @@
#include <QAbstractItemModel>
#include <QJsonDocument>
#include <QtWidgets>
#include <QJsonValue>
#include <QJsonArray>
#include <QJsonObject>
+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; }
+8
View File
@@ -0,0 +1,8 @@
#ifndef R2SHIMS_H
#define R2SHIMS_H
#if R2_VERSION_NUMBER < 50809
#define r_bin_name_tostring(x) x
#endif
#endif // R2SHIMS_H
+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; }
+10 -1
View File
@@ -76,16 +76,25 @@ QString Iaito::writableLocation(QStandardPaths::StandardLocation type)
QStringList Iaito::getTranslationsDirectories()
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
QStringList result;
#else
auto result = locateAll(QStandardPaths::DataLocation, "translations",
QStandardPaths::LocateDirectory);
#endif
// 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;
-1
View File
@@ -51,7 +51,6 @@ void RichTextPainter::paintRichText(QPainter *painter, T x, T y, T w, T h, T xin
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
flags = Qt::TextBypassShaping;
#endif
painter->drawText(typename Metrics<T>::Rect(x + xinc, y, w - xinc, h), flags, curRichText.text);
if (curRichText.highlight && curRichText.highlightColor.alpha()) {
highlightPen.setColor(curRichText.highlightColor);
+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);
}
};
+15 -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);
@@ -92,12 +92,22 @@ void UpdateWorker::showUpdateDialog(bool showDontCheckForUpdatesButton)
if (ret == QMessageBox::Reset) {
Config()->setAutoUpdateEnabled(false);
} else if (ret == QMessageBox::Save) {
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
// not implemented Qt::SHIFT doesnt exist
QString fullFileName =
QFileDialog::getSaveFileName(nullptr,
tr("Choose directory for downloading"),
QString("%1").arg(r_file_home (NULL)) +
QDir::separator() + getRepositoryFileName(),
QString("%1 (*.%1)").arg(getRepositeryExt()));
#else
QString fullFileName =
QFileDialog::getSaveFileName(nullptr,
tr("Choose directory for downloading"),
QStandardPaths::writableLocation(QStandardPaths::HomeLocation) +
QDir::separator() + getRepositoryFileName(),
QString("%1 (*.%1)").arg(getRepositeryExt()));
#endif
if (!fullFileName.isEmpty()) {
QProgressDialog progressDial(tr("Downloading update..."),
tr("Cancel"),
+76
View File
@@ -0,0 +1,76 @@
#include <QMessageBox>
#include <QFileDialog>
#include <r_core.h>
#include "Iaito.h"
static int r_cmd_anal_call(void *user, const char *input) {
IaitoCore *iaito = (IaitoCore*)user;
RCore *core = iaito->core_;
if (r_str_startswith (input, "ui")) {
switch (input[2]) {
case ' ':
{
QMessageBox msgBox;
msgBox.setText (input + 3);
msgBox.exec ();
}
break;
case 'd':
{
QString filename = QFileDialog::getExistingDirectory(nullptr,
"Select directory",
"", //Config()->getRecentFolder(),
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
if (filename.isEmpty()) {
r_core_return_code (core, 1);
} else {
r_core_return_code (core, 0);
r_cons_printf ("%s\n", filename.toUtf8().constData());
}
}
break;
case 'f':
{
QString filename = QFileDialog::getOpenFileName(nullptr,
"Select file",
"", //Config()->getRecentFolder(),
"All files (*)",
// "Header files (*.h *.hpp);;All files (*)",
0, QFILEDIALOG_FLAGS);
if (filename.isEmpty()) {
r_core_return_code (core, 1);
} else {
r_core_return_code (core, 0);
r_cons_printf ("%s\n", filename.toUtf8().constData());
}
}
break;
default:
r_cons_printf ("Usage: ui[..] [..args] - uiaito interactions\n");
r_cons_printf ("| ui [message] - show popup dialog with given message\n");
r_cons_printf ("| uid ([path]) - select directory and print it\n");
r_cons_printf ("| uif ([path]) - select file and print it\n");
break;
}
return true;
}
return false;
}
extern "C" {
// PLUGIN Definition Info
RCorePlugin r_core_plugin_uiaito = {
.meta = {
.name = (char *)"ui",
.desc = (char *)"Interact with iaito UI from the r2 shell",
.license = (char *)"LGPL3",
},
.call = r_cmd_anal_call,
};
static R_API RLibStruct uiaito_radare_plugin = {
.type = R_LIB_TYPE_CORE,
.data = &r_core_plugin_uiaito,
.version = R2_VERSION
};
}
+302 -128
View File
@@ -6,6 +6,7 @@
#include <QVector>
#include <QStringList>
#include <QStandardPaths>
#include "GuiCorePlugin.cpp"
#include <cassert>
#include <memory>
@@ -15,13 +16,20 @@
#include "common/Configuration.h"
#include "common/AsyncTask.h"
#include "common/R2Task.h"
#include "common/R2Shims.h"
#include "common/Json.h"
#include "core/Iaito.h"
#include "Decompiler.h"
#include "r_asm.h"
#include "r_core.h"
#include "r_cmd.h"
#include "sdb.h"
#include <r_asm.h>
#include <r_core.h>
#include <r_cmd.h>
#if R2_VERSION_NUMBER >= 50809 // reverse compatability
#define BO bo
#else
#define BO o
#endif
Q_GLOBAL_STATIC(IaitoCore, uniqueInstance)
@@ -116,7 +124,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 +154,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();
}
@@ -182,73 +190,85 @@ IaitoCore::IaitoCore(QObject *parent):
IaitoCore *IaitoCore::instance()
{
return uniqueInstance;
return uniqueInstance;
}
void IaitoCore::initialize(bool loadPlugins)
{
core_ = r_core_new();
RCore *kore = iaitoPluginCore();
if (kore != nullptr) {
core_ = kore;
} else {
core_ = r_core_new();
}
#if R2_VERSION_NUMBER < 50609
r_core_task_sync_begin(&core_->tasks);
coreBed = r_cons_sleep_begin();
r_core_task_sync_begin (&core_->tasks);
coreBed = r_cons_sleep_begin ();
#endif
CORE_LOCK();
setConfig("dbg.wrap", true);
CORE_LOCK();
setConfig ("dbg.wrap", true);
r_event_hook(core_->anal->ev, R_EVENT_ALL, cutterREventCallback, this);
r_event_hook (core_->anal->ev, R_EVENT_ALL, cutterREventCallback, this);
#if 0
#if defined(APPIMAGE) || defined(MACOS_R2_BUNDLED)
auto prefix = QDir(QCoreApplication::applicationDirPath());
auto prefix = QDir(QCoreApplication::applicationDirPath());
#ifdef APPIMAGE
// Executable is in appdir/bin
prefix.cdUp();
qInfo() << "Setting r2 prefix =" << prefix.absolutePath() << " for AppImage.";
// Executable is in appdir/bin
prefix.cdUp();
qInfo() << "Setting r2 prefix =" << prefix.absolutePath() << " for AppImage.";
#else // MACOS_R2_BUNDLED
// Executable is in Contents/MacOS, prefix is Contents/Resources/r2
prefix.cdUp();
prefix.cd("Resources");
prefix.cd("r2");
qInfo() << "Setting r2 prefix =" << prefix.absolutePath() << " for macOS Application Bundle.";
// Executable is in Contents/MacOS, prefix is Contents/Resources/r2
prefix.cdUp();
prefix.cd("Resources");
prefix.cd("r2");
qInfo() << "Setting r2 prefix =" << prefix.absolutePath() << " for macOS Application Bundle.";
#endif
setConfig("dir.prefix", prefix.absolutePath());
setConfig("dir.prefix", prefix.absolutePath());
auto pluginsDir = prefix;
if (pluginsDir.cd("share/radare2/plugins")) {
qInfo() << "Setting r2 plugins dir =" << pluginsDir.absolutePath();
setConfig("dir.plugins", pluginsDir.absolutePath());
} else {
qInfo() << "r2 plugins dir =" << pluginsDir.absolutePath() << "does not exist!";
}
auto pluginsDir = prefix;
if (pluginsDir.cd("share/radare2/plugins")) {
qInfo() << "Setting r2 plugins dir =" << pluginsDir.absolutePath();
setConfig("dir.plugins", pluginsDir.absolutePath());
} else {
qInfo() << "r2 plugins dir =" << pluginsDir.absolutePath() << "does not exist!";
}
#endif
#endif
if (!loadPlugins) {
setConfig("cfg.plugins", false);
}
if (getConfigi("cfg.plugins")) {
r_core_loadlibs(this->core_, R_CORE_LOADLIBS_ALL, nullptr);
}
// IMPLICIT r_bin_iobind (core_->bin, core_->io);
if (!loadPlugins) {
setConfig ("cfg.plugins", false);
}
if (getConfigi("cfg.plugins")) {
r_core_loadlibs (this->core_, R_CORE_LOADLIBS_ALL, nullptr);
}
r_lib_open_ptr (this->core_->lib, "uiaito", this, &uiaito_radare_plugin);
// IMPLICIT r_bin_iobind (core_->bin, core_->io);
// Otherwise r2 may ask the user for input and Iaito would freeze
setConfig("scr.interactive", false);
// Otherwise r2 may ask the user for input and Iaito would freeze
setConfig("scr.interactive", false);
// Initialize graph node highlighter
bbHighlighter = new BasicBlockHighlighter();
// Initialize graph node highlighter
bbHighlighter = new BasicBlockHighlighter();
// Initialize Async tasks manager
asyncTaskManager = new AsyncTaskManager(this);
// Initialize Async tasks manager
asyncTaskManager = new AsyncTaskManager(this);
}
IaitoCore::~IaitoCore()
{
delete bbHighlighter;
#if R2_VERSION_NUMBER < 50609
r_cons_sleep_end(coreBed);
r_core_task_sync_end(&core_->tasks);
r_cons_sleep_end (coreBed);
r_core_task_sync_end (&core_->tasks);
#endif
r_core_free(core_);
r_cons_free();
RCore *kore = iaitoPluginCore ();
if (kore != nullptr) {
// leave qt
QCoreApplication::exit ();
} else {
// r_core_free (core_);
r_cons_free ();
}
delete bbHighlighter;
}
RCoreLocked IaitoCore::core()
@@ -261,28 +281,30 @@ QDir IaitoCore::getIaitoRCDefaultDirectory() const
return QStandardPaths::writableLocation(QStandardPaths::AppConfigLocation);
}
QVector<QString> IaitoCore::getIaitoRCFilePaths() const
QVector<QString> IaitoCore::getIaitoRCFilePaths(int n) const
{
QVector<QString> result;
result.push_back(QFileInfo(QDir::home(), ".iaitorc").absoluteFilePath());
auto filename = (n==0)? ".iaitorc": ".iaitorc2";
result.push_back(QFileInfo(QDir::home(), filename).absoluteFilePath());
QStringList locations = QStandardPaths::standardLocations(QStandardPaths::AppConfigLocation);
for (auto &location : locations) {
result.push_back(QFileInfo(QDir(location), ".iaitorc").absoluteFilePath());
for (auto &location : locations) {
result.push_back(QFileInfo(QDir(location), filename).absoluteFilePath());
}
result.push_back(QFileInfo(getIaitoRCDefaultDirectory(), "rc").absoluteFilePath()); // File in config editor is from this path
// File in config editor is from this path
result.push_back(QFileInfo(getIaitoRCDefaultDirectory(), "rc").absoluteFilePath());
return result;
}
void IaitoCore::loadIaitoRC()
void IaitoCore::loadIaitoRC(int n)
{
CORE_LOCK();
const auto result = getIaitoRCFilePaths();
for(auto &cutterRCFilePath : result){
const auto result = getIaitoRCFilePaths(n);
for (auto &cutterRCFilePath : result) {
auto cutterRCFileInfo = QFileInfo(cutterRCFilePath);
if (!cutterRCFileInfo.exists() || !cutterRCFileInfo.isFile()) {
continue;
}
qInfo() << "Loading initialization file from " << cutterRCFilePath;
qInfo() << "Loading " << n << " file from " << cutterRCFilePath;
r_core_cmd_file(core, cutterRCFilePath.toUtf8().constData());
}
}
@@ -295,10 +317,21 @@ void IaitoCore::loadDefaultIaitoRC()
if (!cutterRCFileInfo.exists() || !cutterRCFileInfo.isFile()) {
return;
}
qInfo() << "Loading initialization file from " << cutterRCFilePath;
qInfo() << "Loading initialization script from " << cutterRCFilePath;
r_core_cmd_file(core, cutterRCFilePath.toUtf8().constData());
}
void IaitoCore::loadSecondaryIaitoRC()
{
CORE_LOCK();
auto cutterRCFilePath = QFileInfo(getIaitoRCDefaultDirectory(), "rc2").absoluteFilePath();
const auto cutterRCFileInfo = QFileInfo(cutterRCFilePath);
if (!cutterRCFileInfo.exists() || !cutterRCFileInfo.isFile()) {
return;
}
qInfo() << "Loading secondary script from " << cutterRCFilePath;
r_core_cmd_file(core, cutterRCFilePath.toUtf8().constData());
}
QList<QString> IaitoCore::sdbList(QString path)
{
@@ -364,6 +397,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();
@@ -389,7 +438,7 @@ bool IaitoCore::isRedirectableDebugee()
for (QJsonValue value : openFilesArray) {
QJsonObject openFile = value.toObject();
QString URI = openFile["uri"].toString();
if (URI.contains("ptrace") | URI.contains("mach")) {
if (URI.contains("ptrace") || URI.contains("mach")) {
return true;
}
}
@@ -455,15 +504,16 @@ QString IaitoCore::cmdRawAt(const char *cmd, RVA address)
return res;
}
void IaitoCore::cmdRaw0(const QString &s) {
bool IaitoCore::cmdRaw0(const QString &s) {
(void)r_core_cmd0 (core_, s.toStdString().c_str());
return core_->rc == 0;
}
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 +532,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 +558,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)
@@ -535,18 +581,18 @@ QJsonDocument IaitoCore::parseJson(const char *res, const char *cmd)
if (jsonError.error != QJsonParseError::NoError) {
if (cmd) {
eprintf("Failed to parse JSON for command \"%s\": %s\n", cmd,
R_LOG_ERROR ("Failed to parse JSON for command \"%s\": %s", cmd,
jsonError.errorString().toLocal8Bit().constData());
} else {
eprintf("Failed to parse JSON: %s\n", jsonError.errorString().toLocal8Bit().constData());
R_LOG_ERROR ("Failed to parse JSON: %s", jsonError.errorString().toLocal8Bit().constData());
}
const int MAX_JSON_DUMP_SIZE = 8 * 1024;
if (json.length() > MAX_JSON_DUMP_SIZE) {
int originalSize = json.length();
json.resize(MAX_JSON_DUMP_SIZE);
eprintf("%d bytes total: %s ...\n", originalSize, json.constData());
R_LOG_INFO ("%d bytes total: %s", originalSize, json.constData());
} else {
eprintf("%s\n", json.constData());
R_LOG_INFO ("%s", json.constData());
}
}
@@ -567,8 +613,13 @@ QStringList IaitoCore::autocomplete(const QString &cmd, RLinePromptType promptTy
r_core_autocomplete(core(), &completion, &buf, promptType);
QStringList r;
r.reserve(r_pvector_len(&completion.args));
for (size_t i = 0; i < r_pvector_len(&completion.args); i++) {
#if R2_VERSION_NUMBER >= 50709
int amount = r_pvector_length(&completion.args);
#else
int amount = r_pvector_len(&completion.args);
#endif
r.reserve(amount);
for (int i = 0; i < amount; i++) {
r.push_back(QString::fromUtf8(reinterpret_cast<const char *>(r_pvector_at(&completion.args, i))));
}
@@ -592,38 +643,39 @@ 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);
Core()->loadIaitoRC(0);
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");
}
if (!r_core_bin_load (core, path.toUtf8().constData(), baddr)) {
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");
if (!r_core_file_open (core, path.toUtf8(), R_IO_READ | (rw ? R_IO_WRITE : 0, mapaddr))) {
R_LOG_ERROR ("Cannot open file");
} else {
// load RBin information
// XXX only for sub-bins
r_core_bin_load(core, path.toUtf8(), baddr);
r_core_bin_load (core, path.toUtf8(), baddr);
r_bin_select_idx(core->bin, NULL, idx);
}
#endif
} else {
// Not loading RBin info coz va = false
}
r_core_bin_export_info (core, R_MODE_SET);
/*
auto iod = core->io ? core->io->desc : NULL;
@@ -639,6 +691,9 @@ bool IaitoCore::loadFile(QString path, ut64 baddr, ut64 mapaddr, int perms, int
if (perms & R_PERM_W) {
r_core_cmd0 (core, "omfg+w");
}
// run script
// Core()->loadIaitoRC(1);
Core()->loadSecondaryIaitoRC();
fflush(stdout);
return true;
@@ -646,11 +701,12 @@ bool IaitoCore::loadFile(QString path, ut64 baddr, ut64 mapaddr, int perms, int
bool IaitoCore::tryFile(QString path, bool rw)
{
if (path == "") {
return false;
}
CORE_LOCK();
RIODesc *cf;
int flags = R_PERM_R;
if (rw) flags = R_PERM_RW;
cf = r_core_file_open(core, path.toUtf8().constData(), flags, 0LL);
int flags = rw? R_PERM_RW: R_PERM_R;
RIODesc *cf = r_core_file_open(core, path.toUtf8().constData(), flags, 0LL);
if (!cf) {
return false;
}
@@ -671,8 +727,8 @@ bool IaitoCore::mapFile(QString path, RVA mapaddr)
CORE_LOCK();
RVA addr = mapaddr != RVA_INVALID ? mapaddr : 0;
ut64 baddr = Core()->getFileInfo().object()["bin"].toObject()["baddr"].toVariant().toULongLong();
if (r_core_file_open(core, path.toUtf8().constData(), R_PERM_RX, addr)) {
r_core_bin_load(core, path.toUtf8().constData(), baddr);
if (r_core_file_open (core, path.toUtf8().constData(), R_PERM_RX, addr)) {
r_core_bin_load (core, path.toUtf8().constData(), baddr);
} else {
return false;
}
@@ -1028,7 +1084,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)
@@ -1101,6 +1157,19 @@ QString IaitoCore::getConfig(const char *k)
void IaitoCore::setConfig(const char *k, const QVariant &v)
{
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
switch (v.typeId()) {
case QMetaType::Bool:
setConfig(k, v.toBool());
break;
case QMetaType::Int:
setConfig(k, v.toInt());
break;
default:
setConfig(k, v.toString());
break;
}
#else
switch (v.type()) {
case QVariant::Type::Bool:
setConfig(k, v.toBool());
@@ -1112,6 +1181,7 @@ void IaitoCore::setConfig(const char *k, const QVariant &v)
setConfig(k, v.toString());
break;
}
#endif
}
void IaitoCore::setCPU(QString arch, QString cpu, int bits)
@@ -1332,7 +1402,9 @@ RefDescription IaitoCore::formatRefDesc(QJsonObject refItem)
QString str = refItem["string"].toVariant().toString();
if (!str.isEmpty()) {
desc.ref = str;
char *s = strdup (str.toStdString().c_str());
desc.ref = s; // str;
free (s);
desc.refColor = ConfigColor("comment");
} else {
QString type, string;
@@ -1445,11 +1517,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
}
}
@@ -1483,6 +1558,18 @@ QJsonObject IaitoCore::getAddrRefs(RVA addr, int depth) {
perms += "w";
}
if (type & R_ANAL_ADDR_TYPE_EXEC) {
#if R2_VERSION_NUMBER >= 50709
RAnalOp op;
buf.resize(32);
perms += "x";
// Instruction disassembly
r_io_read_at(core->io, addr, (unsigned char*)buf.data(), buf.size());
r_asm_set_pc(core->rasm, addr);
r_anal_op_init (&op);
r_asm_disassemble(core->rasm, &op, (unsigned char*)buf.data(), buf.size());
json["asm"] = op.mnemonic;
r_anal_op_fini (&op);
#else
RAsmOp op;
buf.resize(32);
perms += "x";
@@ -1491,6 +1578,7 @@ QJsonObject IaitoCore::getAddrRefs(RVA addr, int depth) {
r_asm_set_pc(core->rasm, addr);
r_asm_disassemble(core->rasm, &op, (unsigned char*)buf.data(), buf.size());
json["asm"] = r_asm_op_get_asm(&op);
#endif
}
if (!perms.isEmpty()) {
@@ -2418,10 +2506,22 @@ QStringList IaitoCore::getAsmPluginNames()
RListIter *it;
QStringList ret;
#if R2_VERSION_NUMBER >= 50809
RArchPlugin *ap;
IaitoRListForeach(core->anal->arch->plugins, it, RArchPlugin, ap) {
ret << ap->meta.name;
}
#elif R2_VERSION_NUMBER >= 50709
RArchPlugin *ap;
IaitoRListForeach(core->anal->arch->plugins, it, RArchPlugin, ap) {
ret << ap->name;
}
#else
RAsmPlugin *ap;
IaitoRListForeach(core->rasm->plugins, it, RAsmPlugin, ap) {
ret << ap->name;
}
#endif
return ret;
}
@@ -2434,7 +2534,11 @@ QStringList IaitoCore::getAnalPluginNames()
RAnalPlugin *ap;
IaitoRListForeach(core->anal->plugins, it, RAnalPlugin, ap) {
#if R2_VERSION_NUMBER >= 50809
ret << ap->meta.name;
#else
ret << ap->name;
#endif
}
return ret;
@@ -2488,7 +2592,7 @@ QList<RIOPluginDescription> IaitoCore::getRIOPluginDescriptions()
: cmdj("oLj").object()["io_plugins"].toArray();
if (plugins.size() == 0) {
eprintf ("Cannot find io plugins from r2\n");
R_LOG_ERROR ("Cannot find io plugins from r2");
}
for (const QJsonValue pluginValue : plugins) {
QJsonObject pluginObject = pluginValue.toObject();
@@ -2535,6 +2639,39 @@ QList<RAsmPluginDescription> IaitoCore::getRAsmPluginDescriptions()
RListIter *it;
QList<RAsmPluginDescription> ret;
#if R2_VERSION_NUMBER >= 50809
RArchPlugin *ap;
if (core->anal->arch != nullptr) {
IaitoRListForeach(core->anal->arch->plugins, it, RArchPlugin, ap) {
RAsmPluginDescription plugin;
plugin.name = ap->meta.name;
plugin.author = ap->meta.author;
plugin.version = ap->meta.version;
plugin.description = ap->meta.desc;
plugin.license = ap->meta.license;
plugin.architecture = ap->arch;
plugin.cpus = ap->cpus;
ret << plugin;
}
}
#elif R2_VERSION_NUMBER >= 50709
RArchPlugin *ap;
IaitoRListForeach(core->anal->arch->plugins, it, RArchPlugin, ap) {
RAsmPluginDescription plugin;
plugin.name = ap->name;
plugin.architecture = ap->arch;
plugin.author = ap->author;
plugin.version = ap->version;
plugin.cpus = ap->cpus;
plugin.description = ap->desc;
plugin.license = ap->license;
ret << plugin;
}
#else
RAsmPlugin *ap;
IaitoRListForeach(core->rasm->plugins, it, RAsmPlugin, ap) {
RAsmPluginDescription plugin;
@@ -2549,6 +2686,7 @@ QList<RAsmPluginDescription> IaitoCore::getRAsmPluginDescriptions()
ret << plugin;
}
#endif
return ret;
}
@@ -2562,14 +2700,21 @@ QList<RAsmPluginDescription> IaitoCore::getRAnalPluginDescriptions()
RAnalPlugin *ap;
IaitoRListForeach(core->anal->plugins, it, RAnalPlugin, ap) {
RAsmPluginDescription plugin;
#if R2_VERSION_NUMBER >= 50809
plugin.name = ap->meta.name;
plugin.author = ap->meta.author;
plugin.version = ap->meta.version;
plugin.description = ap->meta.desc;
plugin.license = ap->meta.license;
#else
plugin.name = ap->name;
plugin.architecture = ap->arch;
plugin.author = ap->author;
plugin.version = ap->version;
plugin.cpus = ap->cpus;
plugin.description = ap->desc;
plugin.license = ap->license;
#endif
// plugin.architecture = ap->arch;
// plugin.cpus = ap->cpus;
ret << plugin;
}
@@ -2613,6 +2758,7 @@ QList<ImportDescription> IaitoCore::getAllImports()
CORE_LOCK();
QList<ImportDescription> ret;
#if 0
QJsonArray importsArray = cmdj("iij").array();
for (const QJsonValue value : importsArray) {
@@ -2629,6 +2775,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->BO->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(r_bin_name_tostring(bi->name));
imp.bind = QString(bi->bind);
imp.type = QString(bi->type);
ret << imp;
}
#endif
return ret;
}
@@ -2666,12 +2827,12 @@ QList<SymbolDescription> IaitoCore::getAllSymbols()
QList<SymbolDescription> ret;
RBinSymbol *bs;
if (core && core->bin && core->bin->cur && core->bin->cur->o) {
IaitoRListForeach(core->bin->cur->o->symbols, it, RBinSymbol, bs) {
if (core && core->bin && core->bin->cur && core->bin->cur->BO) {
IaitoRListForeach(core->bin->cur->BO->symbols, it, RBinSymbol, bs) {
QString type = QString(bs->bind) + " " + QString(bs->type);
SymbolDescription symbol;
symbol.vaddr = bs->vaddr;
symbol.name = QString(bs->name);
symbol.name = QString(r_bin_name_tostring(bs->name));
symbol.bind = QString(bs->bind);
symbol.type = QString(bs->type);
ret << symbol;
@@ -2680,7 +2841,7 @@ QList<SymbolDescription> IaitoCore::getAllSymbols()
/* list entrypoints as symbols too */
int n = 0;
RBinAddr *entry;
IaitoRListForeach(core->bin->cur->o->entries, it, RBinAddr, entry) {
IaitoRListForeach(core->bin->cur->BO->entries, it, RBinAddr, entry) {
SymbolDescription symbol;
symbol.vaddr = entry->vaddr;
symbol.name = QString("entry") + QString::number(n++);
@@ -2774,10 +2935,10 @@ QList<RelocDescription> IaitoCore::getAllRelocs()
CORE_LOCK();
QList<RelocDescription> ret;
if (core && core->bin && core->bin->cur && core->bin->cur->o) {
if (core && core->bin && core->bin->cur && core->bin->cur->BO) {
RBinReloc *br;
#if R2_VERSION_NUMBER >= 50609
auto relocs = core->bin->cur->o->relocs;
auto relocs = core->bin->cur->BO->relocs;
//// RBIter iter;
RRBNode *iter;
r_crbtree_foreach (relocs, iter, RBinReloc, br) {
@@ -2788,7 +2949,7 @@ QList<RelocDescription> IaitoCore::getAllRelocs()
reloc.type = (br->additive ? "ADD_" : "SET_") + QString::number(br->type);
if (br->import)
reloc.name = br->import->name;
reloc.name = r_bin_name_tostring(br->import->name);
else
reloc.name = QString("reloc_%1").arg(QString::number(br->vaddr, 16));
@@ -2814,7 +2975,7 @@ QList<RelocDescription> IaitoCore::getAllRelocs()
ret << reloc;
}
#else
auto relocs = core->bin->cur->o->relocs;
auto relocs = core->bin->cur->BO->relocs;
RBIter iter;
r_rbtree_foreach (relocs, iter, br, RBinReloc, vrb) {
RelocDescription reloc;
@@ -3411,7 +3572,11 @@ QString IaitoCore::addTypes(const char *str)
{
CORE_LOCK();
char *error_msg = nullptr;
#if R2_VERSION_NUMBER >= 50709
char *parsed = r_anal_cparse (core->anal, str, &error_msg);
#else
char *parsed = r_parse_c_string(core->anal, str, &error_msg);
#endif
QString error;
if (!parsed) {
@@ -3748,27 +3913,36 @@ void IaitoCore::loadPDB(const QString &file)
void IaitoCore::openProject(const QString &name)
{
cmdRaw0(QString ("Po ") + name + "@e:scr.interactive=false");
QString notes = QString::fromUtf8(QByteArray::fromBase64(cmdRaw("Pnj").toUtf8()));
bool ok = cmdRaw0(QString ("Po ") + name + "@e:scr.interactive=false");
if (ok) {
notes = QString::fromUtf8(QByteArray::fromBase64(cmdRaw("Pnj").toUtf8()));
} else {
QMessageBox::critical(nullptr,
tr("Error"),
tr("Cannot open project. See console for details"));
}
// QString notes = QString::fromUtf8(QByteArray::fromBase64(cmdRaw("Pnj").toUtf8()));
// TODO: do something with the notes
}
void IaitoCore::saveProject(const QString &name)
{
Core()->setConfig("scr.interactive", false);
#if 1
cmdRaw0(QString ("Ps ") + name.trimmed());
const bool ok = true; // use core->rc
#else
const QString &rv = cmdRaw("Ps " + name.trimmed()).trimmed();
const bool ok = rv == name.trimmed();
#endif
const bool ok = cmdRaw0(QString ("Ps ") + name.trimmed());
if (!ok) {
QMessageBox::critical(nullptr,
tr("Error"),
tr("Cannot save project. Ensure the project name doesnt have any special or uppercase character"));
}
#if 0
cmdRaw(QString("Pnj %1").arg(QString(notes.toUtf8().toBase64())));
#endif
emit projectSaved(ok, name);
}
void IaitoCore::deleteProject(const QString &name)
{
cmdRaw("P-" + name);
cmdRaw0("P-" + name);
}
bool IaitoCore::isProjectNameValid(const QString &name)
@@ -3806,7 +3980,7 @@ QList<DisassemblyLine> IaitoCore::disassembleLines(RVA offset, int lines)
/**
* @brief return hexdump of <size> from an <offset> by a given formats
* @param address - the address from which to print the hexdump
* @param size - number of bytes to print
* @param size - number of bytes to print
* @param format - the type of hexdump (qwords, words. decimal, etc)
*/
QString IaitoCore::hexdump(RVA address, int size, HexdumpFormats format)
@@ -3985,7 +4159,7 @@ void IaitoCore::setWriteMode(bool enabled)
// New mode is the same as current and IO Cache is disabled. Do nothing.
return;
}
// Change from read-only to write-mode
if (enabled && !writeModeState) {
cmdRaw("oo+");
@@ -4012,7 +4186,7 @@ bool IaitoCore::isWriteModeEnabled()
/**
* @brief get a compact disassembly preview for tooltips
* @param address - the address from which to print the disassembly
* @param num_of_lines - number of instructions to print
* @param num_of_lines - number of instructions to print
*/
QStringList IaitoCore::getDisassemblyPreview(RVA address, int num_of_lines)
{
@@ -4050,10 +4224,10 @@ QStringList IaitoCore::getDisassemblyPreview(RVA address, int num_of_lines)
/**
* @brief get a compact hexdump preview for tooltips
* @param address - the address from which to print the hexdump
* @param size - number of bytes to print
* @param size - number of bytes to print
*/
QString IaitoCore::getHexdumpPreview(RVA address, int size)
{
{
// temporarily simplify the disasm output to get it colorful and simple to read
TempConfig tempConfig;
tempConfig
+21 -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"
@@ -28,6 +31,11 @@ class R2TaskDialog;
#include "common/Helpers.h"
#include "dialogs/R2TaskDialog.h"
#if __APPLE__ && QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define QFILEDIALOG_FLAGS QFileDialog::DontUseNativeDialog
#else
#define QFILEDIALOG_FLAGS ((QFileDialog::Option) 0)
#endif
#define Core() (IaitoCore::instance())
#if R2_VERSION_MAJOR == 5 && R2_VERSION_MINOR == 2 && R2_VERSION_PATCH == 0
@@ -44,13 +52,15 @@ class IAITO_EXPORT IaitoCore: public QObject
friend class R2Task;
public:
RCore *core_ = nullptr;
explicit IaitoCore(QObject *parent = nullptr);
~IaitoCore();
static IaitoCore *instance();
void initialize(bool loadPlugins = true);
void loadIaitoRC();
void loadIaitoRC(int n);
void loadDefaultIaitoRC();
void loadSecondaryIaitoRC();
QDir getIaitoRCDefaultDirectory() const;
AsyncTaskManager *getAsyncTaskManager() { return asyncTaskManager; }
@@ -66,6 +76,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
@@ -87,7 +98,13 @@ public:
* @return the output of the command
*/
QString cmdRaw(const char *cmd);
void cmdRaw0(const QString &s);
/**
* @brief Execute a radare2 command \a cmd. By nature, the API
* is executing raw commands, and thus ignores multiple commands and overcome command injections.
* @param cmd - a raw command to execute. Passing multiple commands (e.g "px 5; pd 7 && pdf") will result in them treated as arguments to first command.
* @return the core->rc in boolean mode, this is, true == command executed successfully, false == execution failed
*/
bool cmdRaw0(const QString &s);
/**
* @brief a wrapper around cmdRaw(const char *cmd,).
@@ -321,6 +338,7 @@ public:
QString getConfig(const char *k);
QString getConfig(const QString &k) { return getConfig(k.toUtf8().constData()); }
QString getConfigDescription(const char *k);
void extracted(QList<QString> &r, QJsonDocument &themes);
QList<QString> getColorThemes();
/* Assembly\Hexdump related methods */
@@ -721,7 +739,6 @@ private:
* Internal reference to the RCore.
* NEVER use this directly! Always use the CORE_LOCK(); macro and access it like core->...
*/
RCore *core_ = nullptr;
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
QMutex coreMutex;
#else
@@ -744,7 +761,7 @@ private:
QSharedPointer<R2Task> debugTask;
R2TaskDialog *debugTaskDialog;
QVector<QString> getIaitoRCFilePaths() const;
QVector<QString> getIaitoRCFilePaths(int n) const;
};
class IAITO_EXPORT RCoreLocked
+68 -31
View File
@@ -2,18 +2,13 @@
#include "ui_MainWindow.h"
// Common Headers
#include "common/AnalTask.h"
#include "common/BugReporting.h"
#include "common/Highlighter.h"
#include "common/Helpers.h"
#include "common/SvgIconEngine.h"
#include "common/ProgressIndicator.h"
#include "common/TempConfig.h"
#include "common/RunScriptTask.h"
#include "common/PythonManager.h"
#include "plugins/IaitoPlugin.h"
#include "plugins/PluginManager.h"
#include "IaitoConfig.h"
#include "IaitoApplication.h"
// Dialogs
@@ -33,7 +28,6 @@
#include "widgets/GraphView.h"
#include "widgets/GraphWidget.h"
#include "widgets/OverviewWidget.h"
#include "widgets/OverviewView.h"
#include "widgets/FunctionsWidget.h"
#include "widgets/SectionsWidget.h"
#include "widgets/SegmentsWidget.h"
@@ -69,7 +63,6 @@
#include "widgets/BacktraceWidget.h"
#include "widgets/HexdumpWidget.h"
#include "widgets/DecompilerWidget.h"
#include "widgets/HexWidget.h"
#include "widgets/R2GraphWidget.h"
#include "widgets/CallGraph.h"
@@ -141,7 +134,7 @@ void MainWindow::initUI()
// Initialize context menu extensions for plugins
disassemblyContextMenuExtensions = new QMenu(tr("Plugins"), this);
addressableContextMenuExtensions = new QMenu(tr("Plugins"), this);
addressableContextMenuExtensions = new QMenu(tr("Plugins"), this); // XXX both plugins?
connect(ui->actionExtraDecompiler, &QAction::triggered, this, &MainWindow::addExtraDecompiler);
connect(ui->actionExtraGraph, &QAction::triggered, this, &MainWindow::addExtraGraph);
@@ -190,14 +183,9 @@ void MainWindow::initUI()
connect(ui->actionZoomReset, &QAction::triggered, this, &MainWindow::onZoomReset);
connect(core, &IaitoCore::projectSaved, this, &MainWindow::projectSaved);
connect(core, &IaitoCore::toggleDebugView, this, &MainWindow::toggleDebugView);
connect(core, &IaitoCore::newMessage,
this->consoleDock, &ConsoleWidget::addOutput);
connect(core, &IaitoCore::newDebugMessage,
this->consoleDock, &ConsoleWidget::addDebugOutput);
connect(core, &IaitoCore::newMessage, this->consoleDock, &ConsoleWidget::addOutput);
connect(core, &IaitoCore::newDebugMessage, this->consoleDock, &ConsoleWidget::addDebugOutput);
connect(core, &IaitoCore::showMemoryWidgetRequested,
this, static_cast<void(MainWindow::*)()>(&MainWindow::showMemoryWidget));
@@ -236,7 +224,7 @@ void MainWindow::initUI()
connect(ui->actionSaveLayout, &QAction::triggered, this, &MainWindow::saveNamedLayout);
connect(ui->actionManageLayouts, &QAction::triggered, this, &MainWindow::manageLayouts);
connect(ui->actionDocumentation, &QAction::triggered, this, &MainWindow::documentationClicked);
connect(ui->actionWebsite, &QAction::triggered, this, &MainWindow::websiteClicked);
/* Setup plugins interfaces */
const auto &plugins = Plugins()->getPlugins();
@@ -266,7 +254,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("Run the analysis");
ui->menuFile->setToolTipsVisible(true);
}
@@ -529,6 +517,21 @@ void MainWindow::addMenuFileAction(QAction *action)
ui->menuFile->addAction(action);
}
void MainWindow::openCurrentCore(InitialOptions &options, bool skipOptionsDialog)
{
RCore *core = iaitoPluginCore ();
if (core == nullptr) {
return;
}
// filename taken from r_core
options.filename = r_core_cmd_strf (core, "i~^file[1]");
setFilename(options.filename);
finalizeOpen();
/* Show analysis options dialog */
// displayInitialOptionsDialog(options, skipOptionsDialog);
}
void MainWindow::openNewFile(InitialOptions &options, bool skipOptionsDialog)
{
setFilename(options.filename);
@@ -667,6 +670,7 @@ void MainWindow::finalizeOpen()
// continue looping in case there is a graph widget
}
}
consoleDock->show();
}
bool MainWindow::saveProject(bool quit)
@@ -674,14 +678,21 @@ bool MainWindow::saveProject(bool quit)
QString projectName = core->getConfig("prj.name");
if (projectName.isEmpty()) {
return saveProjectAs(quit);
} else {
core->saveProject(projectName);
return true;
}
if (core->getConfigb("cfg.debug")) {
QMessageBox::warning(this, tr("Error"), tr("You can't save a project while debugging"));
return false;
}
core->saveProject(projectName);
return true;
}
bool MainWindow::saveProjectAs(bool quit)
{
if (core->getConfigb("cfg.debug")) {
QMessageBox::warning(this, tr("Error"), tr("You can't save a project while debugging"));
return false;
}
SaveProjectDialog dialog(quit, this);
return SaveProjectDialog::Rejected != dialog.exec();
}
@@ -700,7 +711,18 @@ void MainWindow::setFilename(const QString &fn)
void MainWindow::closeEvent(QCloseEvent *event)
{
RCore *kore = iaitoPluginCore();
if (kore != nullptr) {
// TODO: restore configs :)
consoleDock->unredirectOutput();
// qApp->quit();
r_config_set_i (kore->config, "scr.color", 2);
r_config_set_i (kore->config, "scr.html", 0);
QMainWindow::closeEvent(event);
return;
}
if (this->filename == "") {
QMainWindow::closeEvent(event);
return;
}
@@ -711,6 +733,7 @@ void MainWindow::closeEvent(QCloseEvent *event)
return;
}
QMessageBox::StandardButton ret = QMessageBox::question(this, APPNAME,
tr("Do you really want to exit?\nSave your project before closing!"),
(QMessageBox::StandardButtons)(QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel));
@@ -1489,8 +1512,8 @@ void MainWindow::on_actionRun_Script_triggered()
dialog.setViewMode(QFileDialog::Detail);
dialog.setDirectory(QDir::home());
const QString &fileName = QDir::toNativeSeparators(dialog.getOpenFileName(this,
tr("Select radare2 script")));
auto fname = dialog.getOpenFileName(this, tr("Select radare2 script"), QString(), QString(), 0, QFILEDIALOG_FLAGS);
const QString &fileName = QDir::toNativeSeparators(fname);
if (fileName.isEmpty()) // Cancel was pressed
return;
@@ -1595,9 +1618,9 @@ void MainWindow::on_actionIssue_triggered()
openIssue();
}
void MainWindow::documentationClicked()
void MainWindow::websiteClicked()
{
QDesktopServices::openUrl(QUrl("https://cutter.re/docs/user-docs"));
QDesktopServices::openUrl(QUrl("https://www.radare.org"));
}
void MainWindow::on_actionRefresh_Panels_triggered()
@@ -1610,10 +1633,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 +1648,7 @@ void MainWindow::on_actionAnalyze_triggered()
connect(analTask, &AnalTask::finished, this, &MainWindow::refreshAll);
Core()->getAsyncTaskManager()->start(analTaskPtr);
#endif
}
void MainWindow::on_actionImportPDB_triggered()
@@ -1673,6 +1699,8 @@ void MainWindow::on_actionExport_as_code_triggered()
cmdMap[filters.last()] = "pca";
filters << tr(".bytes with instructions in comments (*.txt)");
cmdMap[filters.last()] = "pcA";
filters << tr("Disassembly of the current Section (*.asm)");
cmdMap[filters.last()] = "pD $SS@e:asm.lines=0@$$@e:emu.str=true@e:scr.color=0";
QFileDialog dialog(this, tr("Export as code"));
dialog.setAcceptMode(QFileDialog::AcceptSave);
@@ -1688,13 +1716,22 @@ void MainWindow::on_actionExport_as_code_triggered()
qWarning() << "Can't open file";
return;
}
TempConfig tempConfig;
tempConfig.set("io.va", false);
bool pamode = true;
QTextStream fileOut(&file);
QString &cmd = cmdMap[dialog.selectedNameFilter()];
// Use cmd because cmdRaw would not handle such input
fileOut << Core()->cmd(cmd + " $s @ 0");
if (cmd.contains("@")) {
pamode = false;
}
if (pamode) {
TempConfig tempConfig; // TODO Use RConfigHold
tempConfig.set("io.va", false);
QString &cmd = cmdMap[dialog.selectedNameFilter()];
// Use cmd because cmdRaw would not handle such input
fileOut << Core()->cmd(cmd + " $s @ 0");
} else {
// Use cmd because cmdRaw would not handle such input
fileOut << Core()->cmd(cmd);
}
}
void MainWindow::on_actionGrouped_dock_dragging_triggered(bool checked)
+4 -2
View File
@@ -69,11 +69,13 @@ public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow() override;
void openNewFile(InitialOptions &options, bool skipOptionsDialog = false);
void displayNewFileDialog();
void displayWelcomeDialog();
void closeNewFileDialog();
void openNewFile(InitialOptions &options, bool skipOptionsDialog = false);
void openProject(const QString &project_name);
void openCurrentCore(InitialOptions &options, bool skipOptionsDialog = false);
/**
* @param quit whether to show destructive button in dialog
@@ -159,7 +161,7 @@ public slots:
private slots:
void on_actionAbout_triggered();
void on_actionIssue_triggered();
void documentationClicked();
void websiteClicked();
void addExtraGraph();
void addExtraHexdump();
void addExtraDisassembly();
+9 -8
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="actionWebsite"/>
<addaction name="separator"/>
<addaction name="actionAbout"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
@@ -273,9 +274,9 @@
<string>Save layout</string>
</property>
</action>
<action name="actionDocumentation">
<action name="actionWebsite">
<property name="text">
<string>Documentation</string>
<string>Website</string>
</property>
</action>
<action name="actionMap">
@@ -750,7 +751,7 @@
</action>
<action name="actionExport_as_code">
<property name="text">
<string>Export as code</string>
<string>Export...</string>
</property>
</action>
<action name="actionExtraHexdump">
+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>
-1
View File
@@ -1,7 +1,6 @@
#include "AsyncTaskDialog.h"
#include "common/AsyncTask.h"
#include "ui_AsyncTaskDialog.h"
+1 -1
View File
@@ -155,7 +155,7 @@ bool ProcessProxyModel::filterAcceptsRow(int row, const QModelIndex &parent) con
{
QModelIndex index = sourceModel()->index(row, 0, parent);
ProcessDescription item = index.data(ProcessModel::ProcDescriptionRole).value<ProcessDescription>();
return item.path.contains(filterRegExp());
return item.path.contains(FILTER_REGEX);
}
bool ProcessProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
+103 -16
View File
@@ -47,6 +47,7 @@ InitialOptionsDialog::InitialOptionsDialog(MainWindow *main):
}
setTooltipWithConfigHelp(ui->archComboBox,"asm.arch");
ui->archComboBox->model()->sort(0);
// cpu combo box
ui->cpuComboBox->lineEdit()->setPlaceholderText(tr("Auto"));
@@ -150,12 +151,16 @@ 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 if (options.analCmd.first().command == "aaaaa" ) {
analLevel = 4;
} else {
analLevel = 5;
AnalysisCommands item;
QList<QString> commands = getAnalysisCommands(options);
foreach (item, analysisCommands){
@@ -188,9 +193,7 @@ void InitialOptionsDialog::loadOptions(const InitialOptions &options)
}
ui->writeCheckBox->setChecked(options.writeEnabled);
// TODO: all other options should also be applied to the ui
ui->varCheckBox->setChecked(Core()->getConfigb("anal.vars"));
}
@@ -273,12 +276,12 @@ 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();
options.os = getSelectedOS();
options.analVars = ui->varCheckBox->isChecked();
options.writeEnabled = ui->writeCheckBox->isChecked();
options.loadBinInfo = !ui->binCheckBox->isChecked();
options.loadBinCache = ui->binCacheCheckBox->isChecked();
@@ -301,12 +304,18 @@ 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", "Advanced Auto analysis"} };
break;
case 3:
options.analCmd = { {"aaaa", "Experimental analysis"} };
break;
case 4:
options.analCmd = { {"aaaaa", "Unstable analysis" } };
break;
case 5:
options.analCmd = getSelectedAdvancedAnalCmds();
break;
default:
@@ -315,10 +324,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 +344,84 @@ void InitialOptionsDialog::setupAndStartAnalysis(/*int level, QList<QString> adv
taskDialog->show();
Core()->getAsyncTaskManager()->start(analTaskPtr);
#endif
#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);
if (options.filename.endsWith("://") || options.filename == "") {
QMessageBox::warning(this, tr("Error"), tr("Please select a file"));
return;
}
// Do not reload the file if already loaded
// QJsonArray openedFiles = Core()->getOpenedFiles();
// if (true) { // !openedFiles.size() && options.filename.length()) {
if (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();
QMessageBox::warning(this, tr("Error"), tr("Cannot open"));
return;
}
}
done(0);
// 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);
}
ui->varCheckBox->setChecked(Core()->getConfigb("anal.vars"));
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,11 +442,13 @@ 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("Advanced Analysis (aaa)");
case 3:
return tr("Advanced");
return tr("Experimental Analysis (aaaa)");
case 4:
return tr("Cutting Edge Analysis (aaaaa)");
default:
return tr("Unknown");
}
@@ -376,7 +463,7 @@ void InitialOptionsDialog::on_analSlider_valueChanged(int value)
} else {
ui->analCheckBox->setChecked(true);
ui->analCheckBox->setText(tr("Analysis: Enabled"));
if (value == 3) {
if (value == 5) {
ui->analoptionsFrame->setVisible(true);
ui->advancedAnlysisLine->setVisible(true);
} else {
+12 -7
View File
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>598</width>
<height>524</height>
<height>558</height>
</rect>
</property>
<property name="sizePolicy">
@@ -192,7 +192,7 @@
<number>0</number>
</property>
<property name="maximum">
<number>3</number>
<number>5</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>564</width>
<height>478</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_5">
@@ -346,6 +346,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="varCheckBox">
<property name="text">
<string>Local variable analysis (anal.vars)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="vaCheckBox">
<property name="styleSheet">
@@ -405,7 +412,6 @@
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
@@ -429,7 +435,6 @@
</property>
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
+2 -1
View File
@@ -2,6 +2,7 @@
#include "ui_MapFileDialog.h"
#include "common/Configuration.h"
#include "core/MainWindow.h"
#include <QFileDialog>
@@ -17,7 +18,7 @@ MapFileDialog::~MapFileDialog() {}
void MapFileDialog::on_selectFileButton_clicked()
{
QString currentDir = Config()->getRecentFolder();
QString fileName = QFileDialog::getOpenFileName(this, tr("Select file"), currentDir);
QString fileName = QFileDialog::getOpenFileName(this, tr("Select file"), currentDir, QString(), 0, QFILEDIALOG_FLAGS);
if (!fileName.isEmpty()) {
ui->filenameLineEdit->setText(fileName);
+8 -2
View File
@@ -90,8 +90,8 @@ void NewFileDialog::on_loadFileButton_clicked()
void NewFileDialog::on_selectFileButton_clicked()
{
QString currentDir = Config()->getRecentFolder();
const QString &fileName = QDir::toNativeSeparators(QFileDialog::getOpenFileName(this,
tr("Select file"), currentDir));
auto res = QFileDialog::getOpenFileName(nullptr, tr("Select file"), currentDir, QString(), 0, QFILEDIALOG_FLAGS);
const QString &fileName = QDir::toNativeSeparators(res);
if (!fileName.isEmpty()) {
ui->newFileEdit->setText(fileName);
@@ -356,6 +356,7 @@ void NewFileDialog::fillIOPluginsList()
index++;
}
}
ui->ioPlugin->model()->sort(0);
}
void NewFileDialog::loadFile(const QString &filename)
@@ -368,6 +369,11 @@ void NewFileDialog::loadFile(const QString &filename)
msgBox.exec();
return;
}
if (filename == "" || filename.endsWith("://")) {
QMessageBox::warning(this, tr("Error"), tr("Select a file before clicking this button"));
return;
}
// Add file to recent file list
QSettings settings;
+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()
+60 -2
View File
@@ -134,13 +134,13 @@
</widget>
<widget class="QWidget" name="RAsmTab">
<attribute name="title">
<string>RAsm</string>
<string>RArch</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QLabel" name="RAsmLabel">
<property name="text">
<string>RAsm plugins</string>
<string>RArch plugins</string>
</property>
</widget>
</item>
@@ -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>
@@ -195,9 +251,11 @@
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<!--
<property name="standardButtons">
<set>QDialogButtonBox::Ok</set>
</property>
-->
</widget>
</item>
</layout>
+2 -1
View File
@@ -5,6 +5,7 @@
#include "common/Configuration.h"
#include "common/SyntaxHighlighter.h"
#include "widgets/TypesWidget.h"
#include "core/MainWindow.h"
#include <QFileDialog>
#include <QTemporaryFile>
@@ -29,7 +30,7 @@ TypesInteractionDialog::~TypesInteractionDialog() {}
void TypesInteractionDialog::on_selectFileButton_clicked()
{
QString filename = QFileDialog::getOpenFileName(this, tr("Select file"), Config()->getRecentFolder(), "Header files (*.h *.hpp);;All files (*)");
QString filename = QFileDialog::getOpenFileName(this, tr("Select file"), Config()->getRecentFolder(), "Header files (*.h *.hpp);;All files (*)", 0, QFILEDIALOG_FLAGS);
if (filename.isEmpty()) {
return;
}
+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>
+44 -2
View File
@@ -15,12 +15,52 @@ static const QHash<QString, QString> analBoundaries {
{"raw", "Raw"},
{"bin.section", "Current mapped section"},
{"bin.sections", "All mapped sections"},
{"bin.sections.x", "All executable sections"},
{"bin.segments.x", "All executable segments"},
{"dbg.maps.x", "All executable debug maps"},
#if 0
-e anal.in=?
block
bin.segment
bin.segments
bin.segments.x
bin.segments.r
bin.section
bin.sections
bin.sections.rwx
bin.sections.r
bin.sections.rw
bin.sections.rx
bin.sections.wx
bin.sections.x
io.map
io.maps
io.maps.rwx
io.maps.r
io.maps.rw
io.maps.rx
io.maps.wx
io.maps.x
dbg.stack
dbg.heap
dbg.map
dbg.maps
dbg.maps.rwx
dbg.maps.r
dbg.maps.rw
dbg.maps.rx
dbg.maps.wx
dbg.maps.x
anal.fcn
anal.bb
#endif
};
AnalOptionsWidget::AnalOptionsWidget(PreferencesDialog *dialog)
: QDialog(dialog),
ui(new Ui::AnalOptionsWidget)
{
setAttribute(Qt::WA_DeleteOnClose);
ui->setupUi(this);
checkboxes = {
@@ -43,10 +83,12 @@ AnalOptionsWidget::AnalOptionsWidget(PreferencesDialog *dialog)
connect(confCheckbox.checkBox, &QCheckBox::stateChanged, this, [this, val, &cb]() { this->checkboxEnabler(&cb, val); });
}
ui->analyzePushButton->setToolTip("Analyze the program using radare2's \"aaa\" command");
/*
ui->analyzePushButton->setToolTip("Analyze the program using radare2's `aaa` command");
auto *mainWindow = new MainWindow(this);
connect(ui->analyzePushButton, &QPushButton::clicked, mainWindow,
&MainWindow::on_actionAnalyze_triggered);
*/
connect<void (QComboBox::*)(int)>(ui->analInComboBox, &QComboBox::currentIndexChanged, this,
&AnalOptionsWidget::updateAnalIn);
connect<void (QSpinBox::*)(int)>(ui->ptrDepthSpinBox, &QSpinBox::valueChanged, this,
@@ -96,7 +138,7 @@ void AnalOptionsWidget::createAnalInOptionsList()
mapIter = analBoundaries.cbegin();
ui->analInComboBox->blockSignals(true);
ui->analInComboBox->clear();
for (; mapIter != analBoundaries.cend(); ++mapIter) {
for (; mapIter != analBoundaries.cend(); mapIter++) {
ui->analInComboBox->addItem(mapIter.value(), mapIter.key());
}
ui->analInComboBox->blockSignals(false);
@@ -257,6 +257,7 @@
</item>
</layout>
</item>
<!--
<item alignment="Qt::AlignRight">
<widget class="QPushButton" name="analyzePushButton">
<property name="sizePolicy">
@@ -270,6 +271,7 @@
</property>
</widget>
</item>
-->
<item>
<spacer name="verticalSpacer">
<property name="orientation">
@@ -21,6 +21,7 @@
#include "common/ColorThemeWorker.h"
#include "dialogs/preferences/ColorThemeEditDialog.h"
#include "core/MainWindow.h"
#include "widgets/ColorPicker.h"
AppearanceOptionsWidget::AppearanceOptionsWidget(PreferencesDialog *dialog)
@@ -180,9 +181,7 @@ void AppearanceOptionsWidget::on_deleteButton_clicked()
void AppearanceOptionsWidget::on_importButton_clicked()
{
QString fileName = QFileDialog::getOpenFileName(this,
"",
QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QString fileName = QFileDialog::getOpenFileName(this, "", QStandardPaths::writableLocation(QStandardPaths::HomeLocation), QString(), 0, QFILEDIALOG_FLAGS);
if (fileName.isEmpty()) {
return;
}
@@ -23,26 +23,37 @@ InitializationFileEditor::InitializationFileEditor(PreferencesDialog *dialog)
connect(ui->saveRC, &QDialogButtonBox::accepted, this, &InitializationFileEditor::saveIaitoRC);
connect(ui->executeNow, &QDialogButtonBox::accepted, this, &InitializationFileEditor::executeIaitoRC);
connect(ui->ConfigFileEdit, &QPlainTextEdit::modificationChanged, ui->saveRC, &QWidget::setEnabled);
connect(ui->ConfigFileEdit2, &QPlainTextEdit::modificationChanged, ui->saveRC, &QWidget::setEnabled);
const QDir cutterRCDirectory = Core()->getIaitoRCDefaultDirectory();
auto cutterRCFileInfo = QFileInfo(cutterRCDirectory, "rc");
QString cutterRCLocation = cutterRCFileInfo.absoluteFilePath();
QString iaitorcPath = cutterRCFileInfo.absoluteFilePath();
ui->cutterRCLoaded->setTextInteractionFlags(Qt::TextBrowserInteraction);
ui->cutterRCLoaded->setOpenExternalLinks(true);
ui->cutterRCLoaded->setText(tr("Script is loaded from <a href=\"%1\">%2</a>")
.arg(QUrl::fromLocalFile(cutterRCDirectory.absolutePath()).toString(), cutterRCLocation.toHtmlEscaped()));
.arg(QUrl::fromLocalFile(cutterRCDirectory.absolutePath()).toString(), iaitorcPath.toHtmlEscaped()));
ui->saveRC->setDisabled(true);
ui->executeNow->button(QDialogButtonBox::Retry)->setText("Execute");
ui->ConfigFileEdit->clear();
if(cutterRCFileInfo.exists()){
QFile cutterRC(cutterRCLocation);
if(cutterRC.open(QIODevice::ReadWrite | QIODevice::Text)){
ui->ConfigFileEdit->setPlainText(cutterRC.readAll());
QFile f(iaitorcPath);
if(f.open(QIODevice::ReadWrite | QIODevice::Text)){
ui->ConfigFileEdit->setPlainText(f.readAll());
}
cutterRC.close();
f.close();
}
ui->ConfigFileEdit2->clear();
auto rc2 = QFileInfo(cutterRCDirectory, "rc2");
if(rc2.exists()){
QString rc2file = rc2.absoluteFilePath();
QFile f(rc2file);
if(f.open(QIODevice::ReadWrite | QIODevice::Text)){
ui->ConfigFileEdit2->setPlainText(f.readAll());
}
f.close();
}
ui->saveRC->setDisabled(true);
}
InitializationFileEditor::~InitializationFileEditor() {};
@@ -54,9 +65,9 @@ void InitializationFileEditor::saveIaitoRC(){
cutterRCDirectory.mkpath(".");
}
auto cutterRCFileInfo = QFileInfo(cutterRCDirectory, "rc");
QString cutterRCLocation = cutterRCFileInfo.absoluteFilePath();
QString iaitorcPath = cutterRCFileInfo.absoluteFilePath();
QFile cutterRC(cutterRCLocation);
QFile cutterRC(iaitorcPath);
if(cutterRC.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)){
QTextStream out(&cutterRC);
QString text = ui->ConfigFileEdit->toPlainText();
@@ -64,9 +75,23 @@ void InitializationFileEditor::saveIaitoRC(){
cutterRC.close();
}
ui->ConfigFileEdit->document()->setModified(false);
// save second thing
auto rc2 = QFileInfo(cutterRCDirectory, "rc2");
QString rc2file = rc2 .absoluteFilePath();
QFile f(rc2file);
if(f.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)){
QTextStream out(&f);
QString text = ui->ConfigFileEdit2->toPlainText();
out << text;
f.close();
}
ui->ConfigFileEdit2->document()->setModified(false);
}
void InitializationFileEditor::executeIaitoRC(){
saveIaitoRC();
Core()->loadDefaultIaitoRC();
Core()->loadSecondaryIaitoRC();
}
@@ -11,17 +11,17 @@
</rect>
</property>
<property name="windowTitle">
<string>IaitoRC Editor</string>
<string>Startup Script Editor</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<item row="0" column="0">
<widget class="QLabel" name="cutterRCLoaded">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="2">
<item row="4" column="2">
<widget class="QDialogButtonBox" name="saveRC">
<property name="maximumSize">
<size>
@@ -34,10 +34,27 @@
</property>
</widget>
</item>
<item row="0" column="0" colspan="3">
<item row="0" column="0">
<widget class="QLabel" name="cutterRCLoaded">
<property name="text">
<string>Startup Script</string>
</property>
</widget>
</item>
<item row="1" column="0" colspan="3">
<widget class="QPlainTextEdit" name="ConfigFileEdit"/>
</item>
<item row="1" column="1">
<item row="2" column="0">
<widget class="QLabel" name="cutterRCLoaded">
<property name="text">
<string>OnLoad Script</string>
</property>
</widget>
</item>
<item row="3" column="0" colspan="3">
<widget class="QPlainTextEdit" name="ConfigFileEdit2"/>
</item>
<item row="4" column="1">
<widget class="QDialogButtonBox" name="executeNow">
<property name="standardButtons">
<set>QDialogButtonBox::Retry</set>
+15 -7
View File
@@ -6,6 +6,7 @@
#include "GraphOptionsWidget.h"
#include "DebugOptionsWidget.h"
#include "PluginsOptionsWidget.h"
#include "../R2PluginsDialog.h"
#include "InitializationFileEditor.h"
#include "AnalOptionsWidget.h"
@@ -30,14 +31,21 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
{
tr("Disassembly"),
new AsmOptionsWidget(this),
QIcon(":/img/icons/disas.svg"),
{
QIcon(":/img/icons/disas.svg")
/*
,{
{
"Graph",
new GraphOptionsWidget(this),
QIcon(":/img/icons/graph.svg")
},
}
*/
},
{
tr("Graph"),
new GraphOptionsWidget(this),
QIcon(":/img/icons/graph.svg")
},
{
tr("Debug"),
@@ -49,13 +57,14 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
new AppearanceOptionsWidget(this),
QIcon(":/img/icons/polar.svg")
},
{
{ // we must deprecate all the iaito plugins, just use r2 ones
tr("Plugins"),
new PluginsOptionsWidget(this),
//new PluginsOptionsWidget(this),
new R2PluginsDialog(this),
QIcon(":/img/icons/plugins.svg")
},
{
tr("Initialization Script"),
tr("Scripts"),
new InitializationFileEditor(this),
QIcon(":/img/icons/initialization.svg")
},
@@ -66,8 +75,7 @@ PreferencesDialog::PreferencesDialog(QWidget *parent)
}
};
for (auto &c : prefs)
{
for (auto &c : prefs) {
c.addItem(*ui->configCategories, *ui->configPanel);
}
+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
/
+3
View File
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg width="128" height="128" version="1.1" viewBox="0 0 33.867 33.867" xmlns="http://www.w3.org/2000/svg"><g transform="translate(-32.279 -138.64)"><circle cx="49.213" cy="155.58" r="15.875" fill="#fff"/><path d="m51.556 152.68c-4.77e-4 -9.1e-4 0.0257 3e-3 0.07645 0.0136 0.05076 0.0104 0.08132 0.0134 0.17866 0.0397 0.09737 0.0262 0.17655 0.0383 0.31568 0.0841 0.13914 0.0459 0.26046 0.0776 0.43642 0.14599 0.17594 0.0684 0.33185 0.12866 0.53951 0.22203 0.20766 0.0933 0.35954 0.16421 0.58752 0.29574 0.22797 0.13155 0.40939 0.23327 0.64927 0.40552 0.23989 0.17228 0.43668 0.317 0.68015 0.53093 0.24345 0.21392 0.44012 0.40906 0.67905 0.66407 0.23893 0.25502 0.4123 0.47711 0.62475 0.7818 0.21246 0.3047 0.38588 0.56645 0.56099 0.91496 0.17512 0.34853 0.33132 0.65351 0.45947 1.038 0.12815 0.38447 0.23271 0.74925 0.32573 1.1558 0.09303 0.40658 0.12584 0.78938 0.15891 1.2136 0.03308 0.42425 0.0094 0.82585-0.02153 1.2554-0.03088 0.42948-0.1149 0.83862-0.21058 1.2602-0.09569 0.42157-0.23865 0.82719-0.3963 1.2279-0.15765 0.4007-0.36028 0.79006-0.57356 1.1582-0.2133 0.36819-0.47264 0.72843-0.73255 1.0546-0.25991 0.32615-0.56766 0.64751-0.86343 0.92446-0.29577 0.27696-0.64058 0.5541-0.96043 0.77716-0.31987 0.22306-0.68956 0.45566-1.0213 0.62252-0.33174 0.16688-0.7006 0.33139-1.0262 0.45793-0.32563 0.12654-0.71989 0.24858-1.0356 0.32123-0.31571 0.0727-0.6757 0.14582-0.96846 0.18378-0.29275 0.0379-0.6342 0.0702-0.89712 0.0783-0.26294 8e-3 -0.54276 5e-3 -0.77026 8e-4 -0.22748-5e-3 -0.50743-0.0363-0.69474-0.0584-0.18732-0.022-0.39181-0.0532-0.53614-0.0773-0.14432-0.024-0.30557-0.0569-0.40397-0.0778-0.09841-0.0211-0.17375-0.0367-0.22435-0.0468-0.05061-0.01-0.07647-0.0145-0.07597-0.0126 9.14e-4 3e-3 0.0023 6e-3 0.0036 8e-3 0.0015 3e-3 0.0031 6e-3 0.0049 8e-3 0.0018 3e-3 4e-3 6e-3 0.0062 8e-3 0.0023 3e-3 0.0047 6e-3 0.0073 8e-3 0.0026 3e-3 0.0054 5e-3 0.0084 8e-3s0.0061 5e-3 0.0094 8e-3c0.0034 3e-3 0.0067 5e-3 0.01026 8e-3 0.0036 3e-3 0.0072 5e-3 0.01105 8e-3 0.0039 3e-3 0.0077 5e-3 0.01176 8e-3 0.0041 3e-3 0.0081 5e-3 0.01235 7e-3 0.0043 2e-3 0.0085 5e-3 0.01283 7e-3 0.0044 2e-3 0.0088 5e-3 0.01325 7e-3 0.0045 2e-3 0.0089 5e-3 0.01355 7e-3 0.0047 2e-3 0.0092 5e-3 0.01378 7e-3 0.0047 2e-3 0.0093 5e-3 0.01389 7e-3 0.0047 2e-3 0.0093 5e-3 0.01393 7e-3 0.0047 2e-3 0.0093 5e-3 0.01385 7e-3 0.0047 2e-3 0.0092 5e-3 0.01371 7e-3 0.0046 2e-3 9e-3 5e-3 0.01346 7e-3 0.0045 2e-3 0.0088 5e-3 0.01311 7e-3 0.0044 2e-3 0.0085 5e-3 0.01265 7e-3 0.0042 2e-3 0.0081 5e-3 0.01214 7e-3 4e-3 3e-3 0.0078 5e-3 0.01149 8e-3 0.0038 3e-3 0.0073 5e-3 0.01078 8e-3 0.0035 3e-3 0.0068 5e-3 0.01 8e-3 0.0031 3e-3 0.0062 5e-3 9e-3 8e-3s0.0056 5e-3 8e-3 8e-3 0.0048 5e-3 7e-3 8e-3c0.0021 3e-3 4e-3 6e-3 0.0057 8e-3 0.0016 3e-3 0.0032 6e-3 0.0045 8e-3 0.0013 3e-3 0.0023 6e-3 0.0031 8e-3 7.96e-4 3e-3 0.0015 6e-3 0.0016 8e-3 -4.77e-4 3e-3 0.02177 0.0107 0.06568 0.024 0.04389 0.0134 0.15816 0.0395 0.24473 0.0585 0.08657 0.019 0.24056 0.0547 0.36746 0.0747 0.1269 0.02 0.31948 0.0547 0.48398 0.0713 0.16452 0.0168 0.39323 0.0407 0.5923 0.0503 0.19907 0.01 0.46034 0.0142 0.69064 0.0135 0.23029-8e-4 0.5632-0.0257 0.82015-0.0523 0.25695-0.0267 0.6089-0.0805 0.88656-0.13732 0.27765-0.057 0.64136-0.15012 0.93331-0.24032 0.29195-0.0902 0.65815-0.23071 0.95775-0.35601 0.2996-0.12531 0.69397-0.32499 0.98648-0.50022 0.29251-0.17523 0.63975-0.40419 0.92485-0.61448 0.2851-0.2103 0.63273-0.50647 0.89192-0.76288 0.25919-0.25642 0.54669-0.5751 0.78443-0.8612 0.23774-0.28608 0.49445-0.66886 0.68968-0.99064 0.19525-0.3218 0.41183-0.72417 0.55723-1.073 0.1454-0.34877 0.29229-0.74827 0.40131-1.1085 0.10906-0.36026 0.20751-0.7895 0.26024-1.1577 0.05272-0.3682 0.09097-0.77335 0.10623-1.1376 0.01527-0.36427 0.0012-0.77451-0.03672-1.1268-0.03773-0.35223-0.09631-0.72402-0.16546-1.0579-0.06916-0.33387-0.16609-0.6906-0.27708-0.99577-0.11098-0.30518-0.23112-0.61795-0.36238-0.89385-0.13124-0.27588-0.27592-0.55107-0.42136-0.79431-0.14545-0.24322-0.30176-0.4804-0.4547-0.68854-0.15295-0.20814-0.30763-0.41018-0.46095-0.58198-0.15332-0.17178-0.3024-0.33199-0.4419-0.47428-0.13949-0.14228-0.27412-0.27337-0.40052-0.37991-0.1264-0.10654-0.23662-0.20687-0.33845-0.2851-0.10183-0.0782-0.18825-0.14503-0.25807-0.19953-0.06982-0.0546-0.12576-0.0941-0.16258-0.12135-0.03681-0.0272-0.05525-0.0421-0.054-0.044 0.0012-2e-3 0.02215 0.01 0.06154 0.0341 0.03938 0.0242 0.09868 0.0619 0.17127 0.11411 0.07259 0.0523 0.16183 0.11707 0.2665 0.19362 0.10467 0.0765 0.22692 0.17378 0.35098 0.28547 0.12406 0.11169 0.26681 0.23686 0.40931 0.37888 0.14251 0.14204 0.29569 0.30474 0.45201 0.47685 0.15631 0.17211 0.31562 0.38072 0.47143 0.58987 0.15582 0.20915 0.31568 0.45446 0.46377 0.6993 0.1481 0.24485 0.29492 0.52951 0.42855 0.80757 0.13363 0.27808 0.27313 0.61009 0.37118 0.92297 0.09807 0.31288 0.20238 0.66641 0.27301 1.0034 0.07063 0.33696 0.12491 0.7205 0.16365 1.0761 0.03874 0.3556 0.04223 0.78146 0.02734 1.1493-0.01489 0.36782-0.06279 0.78384-0.11561 1.1557-0.05283 0.37186-0.16942 0.81355-0.27917 1.1774-0.10978 0.36388-0.2681Line truncated

After

Width:  |  Height:  |  Size: 15 KiB

+2
View File
@@ -9,6 +9,7 @@ win32 {
LIBS += \
-lr_core \
-lr_config \
-lr_arch \
-lr_cons \
-lr_io \
-lr_util \
@@ -87,6 +88,7 @@ win32 {
-lr_core \
-lr_config \
-lr_cons \
-lr_arch \
-lr_io \
-lr_flag \
-lr_asm \
+1 -1
View File
@@ -21,7 +21,7 @@ AddressableItemContextMenu::AddressableItemContextMenu(QWidget *parent, MainWind
connect(actionCopyAddress, &QAction::triggered, this,
&AddressableItemContextMenu::onActionCopyAddress);
actionCopyAddress->setShortcuts({Qt::CTRL + Qt::SHIFT + Qt::Key_C});
actionCopyAddress->setShortcuts({Qt::CTRL | Qt::SHIFT | Qt::Key_C});
actionCopyAddress->setShortcutContext(Qt::ShortcutContext::WidgetWithChildrenShortcut);
connect(actionShowXrefs, &QAction::triggered, this,
Loaded 100 of 150 files, more files were not shown because too many files have changed in this diff. Show more