Compare commits

...
188 Commits
Author SHA1 Message Date
pancake dc51d5fe16 Release 5.9.4 2024-08-08 16:54:58 +02:00
pancake b091a0902e Use portable QString instead of using asprintf 2024-07-08 20:10:03 +02:00
pancake e30f47f5de Break on invalid is not enabled by default (same as in r2) 2024-06-28 16:33:34 +02:00
pancake 469f520b30 Fix windows build 2024-05-31 17:30:12 +02:00
pancake 5ed77ef1bb EBCDIC -> PASCAL typo 2024-05-31 15:15:24 +02:00
pancake 37288d81a7 Add support for pascal and utf16 strings in the edit string dialog 2024-05-31 15:06:32 +02:00
pancake e6d52eed44 Add context menu to set the program counter from the disassembly view 2024-05-31 11:00:57 +02:00
pancake 9b23f42a0a Add cyan and magenta bb colors in the context menu 2024-05-31 10:44:49 +02:00
pancake 78bae22fb2 Fix the windows build using c++20 2024-05-24 17:12:13 +02:00
pancake 667aaff62d Add pipeline step to publish the m1 dmg 2024-05-24 02:34:54 +02:00
pancake 8a51ef8524 Release 5.9.2 2024-05-24 02:18:53 +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
pancake 1dd91e9816 Release 5.7.2 2022-07-31 21:35:19 +02:00
pancake ca5f2c49b1 Delete and rebrand more leftovers and unused scripts 2022-07-23 08:12:15 -04:00
pancake 0f6275c7d6 Add missing uninstall target 2022-07-12 16:55:29 +02:00
pancake 721886dffd Enable imports/relocs on linux as it seems to be mac specific bug 2022-07-05 18:55:51 +02:00
pancake d2f66434bd Swap config 2022-07-05 18:37:26 +02:00
pancake a20b38040f Swap default option for the decompiler colors 2022-07-05 18:26:21 +02:00
pancake 1ea689eeab Fix duplicated commandline flag warning message 2022-07-05 17:59:01 +02:00
Eduardo Novella aca7a39874 Add qt5-default as dependency on Ubuntu/Debian boxes 2022-07-05 17:38:26 +02:00
pancake 86ffdf1573 r2 version check done right 2022-07-05 17:38:05 +02:00
pancake 664010f73c Fix the Project saving with Cmd0 instead of cmdstr 2022-07-05 13:28:26 +02:00
pancake 6cc6b0ed89 Remove the fetchdeps leftovers 2022-07-05 13:28:11 +02:00
pancake 4798d300c8 Use Ps instead of P+ for saving the project 2022-06-18 13:07:03 +02:00
jjdredd 21945707ac Change prj.git to prj.vc due to the following commit in radare2:
4682d70dc0bf59cc017446446eab48d33e03310e
2022-06-17 08:01:31 +02:00
pancake 4f368aede9 Rename the default color theme to 'iaito' instead of 'cutter' 2022-06-16 17:22:31 +02:00
pancake 98927ba160 Update README 2022-06-16 12:53:29 +02:00
pancake 61251d240f Remove all the cmake references 2022-06-16 12:51:33 +02:00
jjdredd c9caa6dd31 improve build for custom radare2 install prefix 2022-06-16 02:35:29 +02:00
pancake 1c70bb035a Publish windows builds 2022-06-08 13:42:53 +02:00
pancake da28e011a6 Update ci.yml 2022-06-08 08:33:39 +02:00
pancake 683f1547b2 Fix windows CI builds and simplify build matrix
* prefer meson over cmake
2022-06-08 06:06:37 +02:00
pancake d8c4119081 Use meson/ninja for the ubuntu matrix 2022-06-07 22:48:26 +02:00
pancake d44e7202c5 CI fixes and remove the unused meson.py 2022-06-07 22:42:38 +02:00
pancake 6715ad5a71 Fix meson build 2022-06-07 20:22:44 +02:00
194 changed files with 3000 additions and 4522 deletions

No files matched your search

+7 -5
View File
@@ -4,18 +4,20 @@ about: Create a report to help us improve
---
## Environment Details
Despite we only fix issues reproducible in git-master branch, it's fine to report issues found in releases. And those will be closed when a new release comes out.
## Environment
```sh
# copypaste this script into your shell and replace it with the output
iaito -v
date
r2 -v
iaito -v
uname -ms
```
## Description
<!-- Explain what's the issue, how to repro and what you expect, we love screenshots -->
<!-- Explain what's the issue and what would you expect to see -->
## Test
<!-- Steps to reproduce the issue and provide files/links/images/.. -->
-23
View File
@@ -1,23 +0,0 @@
<!-- Filling this template is mandatory -->
**Your checklist for this pull request**
- [ ] I've read the [guidelines for contributing](https://cutter.re/docs/contributing/code/getting-started.html) to this repository
- [ ] I made sure to follow the project's [coding style](https://cutter.re/docs/contributing/code/development-guidelines.html)
- [ ] I've updated the [documentation](https://cutter.re/docs/user-docs.html) with the relevant information (if needed)
**Detailed description**
<!-- Explain the **details** for making this change. Is a new feature implemented? What existing problem does the pull request solve? How does the pull request solve these issues? Please provide enough information so that others can review your pull request. -->
**Test plan (required)**
<!-- What steps should the reviewer take to test your pull request? Demonstrate that the code is solid. Example: The exact actions you made and their outcome. Add screenshots/videos if the pull request changes UI. This is your time to re-check that everything works and that you covered all the edge cases -->
<!-- **Code formatting**
Make sure you ran astyle on your code before making the PR. Check our contribution guidelines here: https://cutter.re/docs/code.html -->
**Closing issues**
<!-- put "closes #XXXX" in your comment to auto-close the issue that your PR fixes (if such). -->
+246 -188
View File
@@ -1,7 +1,7 @@
name: iaito CI
env:
R2V: 5.7.0
R2V: 5.9.4
on:
push:
@@ -15,22 +15,21 @@ 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
sudo apt-get install libgraphviz-dev mesa-common-dev ninja-build
sudo apt-get install qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install -y libgraphviz-dev mesa-common-dev ninja-build meson
sudo apt install -y libqt5svg5-dev qttools5-dev qttools5-dev-tools
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
cd r2git && sys/install.sh
run: git clone --depth=1 https://github.com/radareorg/radare2 r2git && CFLAGS=-O0 r2git/sys/install.sh
- name: build iaito
run: |
./configure --prefix=/usr
@@ -38,25 +37,22 @@ 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
sudo apt-get install libgraphviz-dev mesa-common-dev ninja-build
sudo apt-get install qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install -y libgraphviz-dev mesa-common-dev ninja-build
sudo apt install -y libqt5svg5-dev qttools5-dev qttools5-dev-tools
sudo apt install -y qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools
- name: install r2
run: |
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2_${{env.R2V}}_amd64.deb
@@ -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,196 +105,255 @@ 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
build:
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, windows-latest]
os: [ubuntu-22.04, ubuntu-20.04]
python-version: [3.8.x]
system-deps: [false]
system-deps: [true]
cc-override: [default]
cxx-override: [default]
# 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')
run: |
sudo apt-get update
sudo apt-get install libgraphviz-dev mesa-common-dev
sudo apt-get install ninja-build
if [[ "${{ matrix.system-deps }}" = "true" ]]
then
sudo apt-get install qt5-default libqt5svg5-dev qttools5-dev qttools5-dev-tools
fi
- uses: actions/setup-python@v1
sudo apt-get install ninja-build make git patch wget
sudo apt install -y libqt5svg5-dev qttools5-dev qttools5-dev-tools
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@v5
with:
python-version: ${{ matrix.python-version }}
- name: homebrew dependencies
if: contains(matrix.os, 'macos')
run: |
rm '/usr/local/bin/2to3' # symlink to some kind of existing python2.7 installation conflicts with brew python3 which gets installed as indirect dependency
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: |
cd src && meson ../build
cd ../build && ninja -j4
- name: meson+ninja ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
pip install meson
- uses: actions/upload-artifact@v2
if: contains(matrix.os, 'ubuntu')
cd src && meson ../build
cd ../build && ninja -j4
w64-meson:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
name: iaito_amd64.deb
path: dist/debian/*/*.deb
- name: cmake ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
if [[ "${{ matrix.system-deps }}" = "false" ]]
then
scripts/fetch_deps.sh
source cutter-deps/env.sh
export PKG_CONFIG_PATH="$CUTTER_DEPS_PYTHON_PREFIX/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
export LD_LIBRARY_PATH="`llvm-config --libdir`:$LD_LIBRARY_PATH"
fi
set -euo pipefail #TODO: move to top once cutter-deps doesn't fail
if [[ "${{ matrix.cc-override }}" != "default" ]]
then
export CC="${{matrix.cc-override}}"
export CXX="${{matrix.cxx-override}}"
fi
mkdir build
cd build
cmake --version
if [[ "${{ matrix.system-deps }}" = "false" ]]
then
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DIAITO_ENABLE_PYTHON=ON \
-DPYTHON_LIBRARY="$CUTTER_DEPS_PYTHON_PREFIX/lib/libpython3.6m.so.1.0" \
-DPYTHON_INCLUDE_DIR="$CUTTER_DEPS_PYTHON_PREFIX/include/python3.6m" \
-DPYTHON_EXECUTABLE="$CUTTER_DEPS_PYTHON_PREFIX/bin/python3" \
-DIAITO_ENABLE_PYTHON_BINDINGS=OFF \
-DIAITO_ENABLE_CRASH_REPORTS=ON \
-DIAITO_USE_BUNDLED_RADARE2=ON \
../src
else
cmake \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DIAITO_USE_BUNDLED_RADARE2=ON \
../src
fi
ninja
- name: cmake macos
shell: bash
if: contains(matrix.os, 'macos')
run: |
set -euo pipefail
wget -q https://github.com/radareorg/radare2/releases/download/${{env.R2V}}/radare2-${{env.R2V}}.pkg
sudo installer -pkg *.pkg -target /
export PATH=/usr/local/opt/llvm/bin:$PATH
mkdir build
cd build
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DIAITO_ENABLE_PYTHON=ON \
-DIAITO_ENABLE_PYTHON_BINDINGS=OFF \
-DIAITO_ENABLE_CRASH_REPORTS=ON \
-DIAITO_USE_BUNDLED_RADARE2=ON \
-DIAITO_ENABLE_PACKAGING=ON \
-DIAITO_PACKAGE_DEPENDENCIES=ON \
-DIAITO_ENABLE_DEPENDENCY_DOWNLOADS=ON \
../src && \
make -j4;
make package
export IAITO_VERSION=$(python3 ../scripts/get_version.py)
echo PACKAGE_NAME=iaito-mac.tar.gz >> $GITHUB_ENV
cd .. && make -C dist/macos
- uses: actions/upload-artifact@v2
if: contains(matrix.os, 'macos')
submodules: false
persist-credentials: false
- name: Preparing msvc toolchain
uses: ilammy/msvc-dev-cmd@v1
with:
name: iaito-mac.pkg
path: dist/macos/macos-pkg/*.pkg
- name: windows dependencies
if: contains(matrix.os, 'windows-latest')
shell: bash
run: |
pip install ninja
scripts/fetch_deps.sh
choco install winflexbison3
- name: w64-make
if: contains(matrix.os, 'windows-latest')
arch: x64
# - uses: actions/setup-python@v5
# with:
# python-version: 3.11.x
# - name: Prepare Qt
# working-directory: build
# shell: cmd
# run: |
# 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@v3
- name: dependencies
shell: cmd
run: |
set ARCH=x64
set IAITO_DEPS=%CD%\cutter-deps
set PATH=%CD%\cutter-deps\qt\bin;%CD%\r2_dist\bin;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
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
- name: w64-make
shell: cmd
run: |
SET ARCH=x64
set PATH=%CD%\r2_dist\bin;%PATH%
call preconfigure.bat
call configure.bat
call make.bat
cd
mkdir build
cd build
set PACKAGE_NAME=iaito-w64
cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DIAITO_PACKAGE_DEPENDENCIES=ON ^
-DIAITO_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
-DIAITO_ENABLE_CRASH_REPORTS=ON ^
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
-DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^
-G Ninja ^
../src
cmake --build . --config Release
cmake --build . --config Release --target package
echo PACKAGE_NAME=%PACKAGE_NAME%.zip >> %GITHUB_ENV%
# -DIAITO_ENABLE_PYTHON=ON ^
# -DIAITO_ENABLE_PYTHON_BINDINGS=ON ^
- uses: actions/upload-artifact@v2
if: env.PACKAGE_NAME != null
with:
name: ${{ env.PACKAGE_NAME }}
path: build/${{ env.PACKAGE_NAME }}
- name: w64-cmake
if: contains(matrix.os, 'windows-latest')
make.bat
- name: dist
shell: cmd
run: |
set ARCH=x64
set IAITO_DEPS=%CD%\cutter-deps
set PATH=%CD%\cutter-deps\qt\bin;%CD%\r2_dist\bin;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
call preconfigure.bat
cd
mkdir build
cd build
set PACKAGE_NAME=iaito-w64
cmake ^
-DCMAKE_BUILD_TYPE=Release ^
-DIAITO_PACKAGE_DEPENDENCIES=ON ^
-DIAITO_ENABLE_DEPENDENCY_DOWNLOADS=ON ^
-DIAITO_ENABLE_CRASH_REPORTS=ON ^
-DCMAKE_PREFIX_PATH="%CUTTER_DEPS%\pyside" ^
-DCPACK_PACKAGE_FILE_NAME=%PACKAGE_NAME% ^
-G Ninja ^
../src
cmake --build . --config Release
cmake --build . --config Release --target package
echo PACKAGE_NAME=%PACKAGE_NAME%.zip >> %GITHUB_ENV%
# -DIAITO_ENABLE_PYTHON=ON ^
# -DIAITO_ENABLE_PYTHON_BINDINGS=ON ^
- uses: actions/upload-artifact@v2
if: env.PACKAGE_NAME != null
zip -r iaito.zip iaito
dir /s
- uses: actions/upload-artifact@v4
with:
name: iaito.exe
path: iaito\iaito.exe
- 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 x64 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 macOS m1 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-m1.dmg/iaito.dmg
asset_name: iaito_${{ steps.version.outputs.string }}_m1.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
+94 -96
View File
@@ -1,96 +1,94 @@
# Binaries
AStyle*
# OSX files
*.DS_Store
.AppleDouble
.LSOverride
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt files
*.qmake.cache
*.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
qrc_*.cpp
moc_*.h
ui_*.h
build*/
cmake-build-*/
/src-build/
# Build folders
Debug
Release
# QtCreator
*.autosave
*.qmlproject.user
*.qmlproject.user.*
CMakeLists.txt.user
# CLion
.idea
# Vim
*.swp
*~
# Git mergetool
~.orig
# CMake Files:
src/*_automoc.cpp
*CMakeCache.txt*
*cmake_install.cmake*
src/CMakeFiles/*
# Prepare_r2
ninja.exe
r2_dist_x86/
r2_dist_x64/
r2_dist/
*.pdb
# Mesonbuild
src/subprojects/
# Python
__pycache__
/python/
# Other
compile_commands.json
.ccls-cache
docs/source/_build
# vscode
/.vscode/*
!/.vscode/settings.json
!/.vscode/extensions.json
# Visual Studio CMake
src/out
.vs
# cutter-deps
/cutter-deps
/breakpad
# astyle backup .orig files
*.orig
# Binaries
AStyle*
# OSX files
*.DS_Store
.AppleDouble
.LSOverride
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt files
*.qmake.cache
*.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
qrc_*.cpp
moc_*.h
ui_*.h
build*/
cmake-build-*/
/src-build
# Build folders
Debug
Release
# QtCreator
*.autosave
*.qmlproject.user
*.qmlproject.user.*
CMakeLists.txt.user
# CLion
.idea
# Vim
*.swp
*~
# Git mergetool
~.orig
# CMake Files:
src/*_automoc.cpp
*CMakeCache.txt*
*cmake_install.cmake*
src/CMakeFiles/*
# Prepare_r2
ninja.exe
r2_dist_x86/
r2_dist_x64/
r2_dist/
*.pdb
# Mesonbuild
src/subprojects/
# Python
__pycache__
/python/
# Other
compile_commands.json
.ccls-cache
docs/source/_build
# vscode
/.vscode/*
!/.vscode/settings.json
!/.vscode/extensions.json
# Visual Studio CMake
src/out
.vs
# 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
-7
View File
@@ -1,7 +0,0 @@
{
"recommendations": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools",
"twxs.cmake"
]
}
-6
View File
@@ -1,6 +0,0 @@
{
"cmake.sourceDirectory": "${workspaceFolder}/src",
"cmake.configureSettings": {
"IAITO_USE_BUNDLED_RADARE2": "ON"
}
}
+16 -11
View File
@@ -1,25 +1,30 @@
# Contributing to iaito
Iaito is not in active development, the current focus of the project is in simplicity, reduce
tech debt by removing superfluous, anoying or mainly unused dependencies like python support
or plugins, breakpad, the cmake build system, crash reports or auto-updates features, as long as
the project is under low maintainance mode is good to remove stuff that distract the attention
from the core which is the one that should be handling all that stuff. Iaito focus on exposing
the capabilities of r2 instead of duplicating efforts in a GUI.
There are different ways you can help contributing to Iaito:
## Opening an issue
Make a clear description of the bug/feature, use screenshots, send binaries, etc.
This will help us improve the software for you.
You can create an issue by clicking on [this link](https://github.com/radareorg/iaito/issues/new/choose).
## Submit a Pull Request
Note that cutter is still under development and many parts of the code are to be improved.
The best way is to check the opened issues [here](https://github.com/radareorg/iaito/issues) or discuss with radareorg team.
Please follow our contribution guidelines: https://cutter.re/docs/contributing.html
If you are feeling brave, create a patch by editing the files in github web interface by pressing the pencil
button or fork the repository, create a branch and submit your changes as a pull request.
## Write Some Documentation
The documentation is something important for newcomers. As of today the documentation can be found [here](https://cutter.re/docs/) and it stands in the [docs](https://github.com/radareorg/iaito/tree/master/docs) folder.
The API Reference is automatically generated from the source code, so it is strongly advised to document your code.
Check issues marked as "Documentation" on our issues [list](https://github.com/radareorg/iaito/issues?q=is%3Aissue+is%3Aopen+label%3ADocumentation).
Feel free to use the radare discord, telegram or irc chats to discuss your ideas, proposals or changes
## Translations
You can help Iaito by adding translations to the project! We use the [Crowdin](https://crowdin.com/project/iaito) platform to help us share translations. Feel free to contribute and add translations to the project. If you need to add a language, ask any radareorg developer.
Translation files are downloaded from the [Crowdin](https://crowdin.com/project/iaito) platform, where many
users can help to review and maintain different languages.
## Backporting
It is somewhat desired to backport features or changes already available in Cutter.
+78 -45
View File
@@ -6,83 +6,116 @@ else
BIN=build/iaito
endif
# linux or win
IAITO_OS=macos
IAITO_DEPS_URL=https://github.com/rizinorg/cutter-deps/releases/download/v13/cutter-deps-$(IAITO_OS).tar.gz
#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
# cutter deps should provide deps.mk
CMAKE_FLAGS+=-DPYTHON_LIBRARY="$(IAITO_DEPS)/python/lib/libpython3.6m.so.1.0"
CMAKE_FLAGS+=-DPYTHON_INCLUDE_DIR="$(IAITO_DEPS)/include/python3.6m"
CMAKE_FLAGS+=-DPYTHON_EXECUTABLE="$(IAITO_DEPS)/bin/python3"
CMAKE_FLAGS+=-DIAITO_ENABLE_PYTHON=ON
CMAKE_FLAGS+=-DIAITO_ENABLE_PYTHON_BINDINGS=ON
endif
ifeq ($(WANT_PYTHON_BINDINGS),1)
QMAKE_FLAGS+=IAITO_ENABLE_PYTHON_BINDINGS=true
endif
ifeq ($(WANT_CRASH_REPORTS),1)
# QMAKE_FLAGS+=IAITO_ENABLE_CRASH_REPORTS=true
endif
QMAKE_FLAGS+=PREFIX=$(PREFIX)
all: iaito
#-DIAITO_ENABLE_CRASH_REPORTS=ON
cbuild:
mkdir -p cbuild
cd cbuild && cmake $(CMAKE_FLAGS) \
-DCMAKE_BUILD_TYPE=Release \
-DIAITO_USE_BUNDLED_RADARE2=OFF \
-DIAITO_APPIMAGE_BUILD=ON \
-DCMAKE_INSTALL_PREFIX=appdir/usr \
../src
CXX?=g++
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:
mrproper: clean
rm -rf build
.PHONY: cmake install build run user-install clean mrproper translations
dist:
ifeq ($(shell uname),Darwin)
$(MAKE) -C dist/macos
else
$(MAKE) -C dist/debian
endif
cmake: cbuild
$(MAKE)
mrproper: clean
git clean -xdf
iaito: translations
$(MAKE) -C build -j4
translations: build src/translations/README.md
$(MAKE) -C src/translations
# lrelease src/Iaito.pro
src/translations/README.md:
git submodule update --init
.PHONY: install run user-install 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
user-install:
uninstall:
ifeq ($(shell uname),Darwin)
rm -rf $(DESTDIR)/Applications/iaito.app
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: 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
+72 -22
View File
@@ -4,71 +4,121 @@
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
* Support latest versions and features of radare2
* Use r2 plugins (f.ex: no need for r2ghidra-iaito plugin if r2ghidra is installed)
* Focus on parity of commands and r2-style workflows.
* Translations are in the early steps, please [contribute](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/screenshots/macos-panels.png)
![Screenshot](https://raw.githubusercontent.com/radareorg/iaito/master/screenshot.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):
```
$ git clone https://github.com/radareorg/radare2
$ radare2/sys/install.sh
```sh
$ git clone https://github.com/radareorg/radare2 && radare2/sys/install.sh
```
Install QT on macOS like this:
```
```sh
brew install qt@5
echo 'export PATH="/opt/homebrew/opt/qt@5/bin:$PATH"' >> ~/.profile
```
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
make
make run
```
To install the app and the translations in your home:
To install the app in your home:
```
```sh
make install
```
## Plugins
iaito supports both Python and Native C++ plugins. For now the api is compatible with Iaito. Read the [Plugins](https://cutter.re/docs/plugins) section on their documentation.
### Building iaito as an r2 plugin
## Help
It is also possible to launch iaito from the r2 shell reusing the Core instance:
Get help, updates, meet the community or discuss about development in these channels:
```
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 "cutter_..\.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.0' ; VERSION_MAJOR=5; VERSION_MINOR=7; VERSION_PATCH=0; VERSION_NUMBER=50700; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
PKGNAME='iaito' ; VERSION='5.9.4' ; VERSION_MAJOR=5; VERSION_MINOR=9; VERSION_PATCH=4; VERSION_NUMBER=50904; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
}
show_usage() {
cat <<EOF2
'configure' configures iaito-5.7.0 to adapt to many kinds of systems.
'configure' configures iaito-5.9.4 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.0"
echo "5.9.4"
exit 0
fi
echo "iaito-5.7.0 configuration script done with acr v2.0.0.
echo "iaito-5.9.4 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.0"
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.4"
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.0
VERSION 5.9.4
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
-138
View File
@@ -1,138 +0,0 @@
set(IAITO_DEPS "${CMAKE_CURRENT_SOURCE_DIR}/../cutter-deps")
unset(RZ_GHIDRA_PREFIX_PATH)
################################################
# Windows
################################################
if(WIN32)
set(CPACK_GENERATOR "ZIP")
set(RIZIN_INSTALL_PLUGDIR "lib/plugins")
if (IAITO_PACKAGE_DEPENDENCIES)
if (IAITO_ENABLE_PYTHON)
if (IAITO_ENABLE_DEPENDENCY_DOWNLOADS)
set(CPACK_INSTALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/WindowsBundlePython.cmake)
endif()
find_package(PythonInterp REQUIRED)
install(DIRECTORY ${IAITO_DEPS}/pyside/lib/site-packages DESTINATION "python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
install(FILES ${IAITO_DEPS}/pyside/bin/shiboken2.abi3.dll ${IAITO_DEPS}/pyside/bin/pyside2.abi3.dll DESTINATION .)
endif()
install(SCRIPT WindowsBundleQt.cmake)
endif()
if (IAITO_PACKAGE_R2DEC AND IAITO_ENABLE_DEPENDENCY_DOWNLOADS)
install(CODE "
set(ENV{RZ_ALT_SRC_DIR} 1)
set(ENV{PATH} \"\${CMAKE_INSTALL_PREFIX};\$ENV{PATH}\")
execute_process(COMMAND powershell \"${CMAKE_CURRENT_SOURCE_DIR}/bundle_r2dec.ps1\" \"\${CMAKE_INSTALL_PREFIX}\"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
RESULT_VARIABLE SCRIPT_RESULT)
if (SCRIPT_RESULT)
message(FATAL_ERROR \"Failed to package r2dec\")
endif()
")
endif()
endif()
################################################
# macOS
################################################
if(APPLE)
set(CPACK_GENERATOR "Bundle")
set(CPACK_BUNDLE_NAME "iaito")
set(ICON "iaito")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist")
set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist")
set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/macos/cutter.icns")
set(CPACK_DMG_BACKGROUND_IMAGE "${CMAKE_CURRENT_SOURCE_DIR}/macos/cutter_mac_app.png")
set(CPACK_DMG_DS_STORE "${CMAKE_CURRENT_SOURCE_DIR}/macos/DS_Store_ForDMGBackground")
find_program(MACDEPLOYQT_PATH macdeployqt HINTS "${Qt5_DIR}/../../../bin")
if(NOT MACDEPLOYQT_PATH)
message(FATAL_ERROR "Failed to find macdeployqt")
endif()
unset(ADJUST_RIZIN_LIBS)
foreach(_lib ${RZ_LIBS})
list(APPEND ADJUST_RIZIN_LIBS "${RIZIN_INSTALL_DIR}/lib/lib${_lib}.dylib")
endforeach()
if(IAITO_PACKAGE_DEPENDENCIES AND IAITO_ENABLE_PYTHON)
set(EMBED_PYTHON_SH "${CMAKE_CURRENT_SOURCE_DIR}/appbundle_embed_python.sh")
set(PYTHON_FRAMEWORK_DIR "${IAITO_DEPS}/python/Python.framework")
set(PYSIDE_PREFIX "${IAITO_DEPS}/pyside")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MacOSBundlePython.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/MacOSBundlePython.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/MacOSBundlePython.cmake")
endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/MacOSSetupBundle.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/MacOSSetupBundle.cmake" @ONLY)
install(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/MacOSSetupBundle.cmake")
get_filename_component(QT_PREFIX "${MACDEPLOYQT_PATH}/../.." ABSOLUTE)
list(APPEND RZ_GHIDRA_PREFIX_PATH "${QT_PREFIX}")
set(RIZIN_INSTALL_PLUGDIR "share/rizin/plugins") # escaped backslash on purpose, should be evaluated later
endif()
################################################
# rz-ghidra
################################################
if(IAITO_PACKAGE_RZ_GHIDRA)
if(IAITO_ENABLE_DEPENDENCY_DOWNLOADS)
# Currently using external project only for downloading source
# It neeeds to link against compiled cutter so for now build it using custom install script.
# That way rz-ghidra build process is the same as with any other external plugin built against
# installed Iaito.
ExternalProject_Add(rz-ghidra
GIT_REPOSITORY https://github.com/rizinorg/rz-ghidra
GIT_TAG master
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
endif()
if (WIN32)
set (GHIDRA_OPTIONS "
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
-DIAITO_INSTALL_PLUGDIR=plugins/native")
elseif (APPLE)
set (GHIDRA_OPTIONS "
\"-DRIZIN_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/${RIZIN_INSTALL_PLUGDIR}\"
-DIAITO_INSTALL_PLUGDIR=plugins/native")
else()
set (GHIDRA_OPTIONS "")
endif()
install(CODE "
execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rz-ghidra-prefix/src/rz-ghidra-build
RESULT_VARIABLE SCRIPT_RESULT
COMMAND \${CMAKE_COMMAND}
../rz-ghidra
-DCMAKE_BUILD_TYPE=Release
\"-DCMAKE_PREFIX_PATH=\${CMAKE_INSTALL_PREFIX};\${CMAKE_INSTALL_PREFIX}/include/librz;\${CMAKE_INSTALL_PREFIX}/include/librz/sdb;${RZ_GHIDRA_PREFIX_PATH}\"
-DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX}
${GHIDRA_OPTIONS}
-DBUILD_IAITO_PLUGIN=ON
-DBUILD_SLEIGH_PLUGIN=OFF
-G Ninja
)
if (SCRIPT_RESULT)
message(FATAL_ERROR \"Failed to configure rz-ghidra\")
endif()
execute_process(WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/rz-ghidra-prefix/src/rz-ghidra-build
RESULT_VARIABLE SCRIPT_RESULT
COMMAND \${CMAKE_COMMAND} --build . --target install
)
if (SCRIPT_RESULT)
message(FATAL_ERROR \"Failed to install rz-ghidra plugin\")
endif()
")
endif()
include(CPack)
+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
+4 -3
View File
@@ -8,7 +8,8 @@ ENV DEBIAN_FRONTEND noninteractive
RUN apk add --no-cache \
bash \
build-base \
cmake \
meson \
ninja \
curl \
git \
linux-headers \
@@ -23,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
@@ -58,4 +59,4 @@ RUN apk add --no-cache \
WORKDIR /home/r2
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
+23 -13
View File
@@ -1,20 +1,30 @@
SET "R2DIST=r2_dist"
SET "R2DIR=radare2"
SET "BUILDDIR=build_%PLATFORM%"
ECHO Preparing directory
RMDIR /S /Q %BUILDDIR%
MKDIR %BUILDDIR%
nmake
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
CD src
meson --buildtype=release ..\%BUILDDIR%
CD ..\%BUILDDIR%
ninja -j4
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
-102
View File
@@ -1,102 +0,0 @@
import argparse
import importlib.util
import logging
import os
import subprocess
import sys
ROOT = None
log = None
r2_meson_mod = None
def import_r2_meson_mod():
"""Import radare2/sys/meson.py"""
global r2_meson_mod
folder = os.path.dirname(__file__)
r2_meson_path = os.path.join(folder, 'radare2', 'sys', 'meson.py')
r2_meson_spec = importlib.util.spec_from_file_location('meson', r2_meson_path)
r2_meson_mod = importlib.util.module_from_spec(r2_meson_spec)
r2_meson_spec.loader.exec_module(r2_meson_mod)
def set_global_vars():
global log
global ROOT
ROOT = os.path.abspath(os.path.dirname(__file__))
logging.basicConfig(format='[%(name)s][%(levelname)s]: %(message)s',
level=logging.DEBUG)
log = logging.getLogger('cutter-meson')
log.debug('ROOT: %s', ROOT)
r2_meson_mod.set_global_variables()
def win_dist(args):
os.makedirs(args.dist)
r2_meson_mod.copy(os.path.join(args.dir, 'iaito.exe'), args.dist)
log.debug('Deploying Qt5')
subprocess.call(['windeployqt', '--release', os.path.join(args.dist, 'iaito.exe')])
log.debug('Deploying libr2')
r2_meson_mod.PATH_FMT.update(r2_meson_mod.R2_PATH)
r2_meson_mod.meson('install', options=[['-C', '{}'.format(args.dir)], '--no-rebuild'])
def build(args):
cutter_builddir = os.path.join(ROOT, args.dir)
if not os.path.exists(cutter_builddir):
defines = ['-Denable_python=%s' % str(args.python).lower(),
'-Denable_python_bindings=%s' % str(args.python_bindings).lower()]
if os.name == 'nt':
defines.append('-Dradare2:r2_incdir=radare2/include')
defines.append('-Dradare2:r2_libdir=radare2/lib')
defines.append('-Dradare2:r2_datdir=radare2/share')
defines.append('-Dc_args=-D_UNICODE -DUNICODE')
r2_meson_mod.meson('setup', rootdir=os.path.join(ROOT, 'src'), builddir=args.dir,
prefix=os.path.abspath(args.dist), backend=args.backend,
release=args.release, shared=False, options=defines)
if not args.nobuild:
log.info('Building cutter')
if args.backend == 'ninja':
r2_meson_mod.ninja(cutter_builddir)
else:
project = os.path.join(cutter_builddir, 'iaito.sln')
r2_meson_mod.msbuild(project, '/m')
def main():
set_global_vars()
parser = argparse.ArgumentParser(description='Meson script for iaito')
parser.add_argument('--backend', choices=r2_meson_mod.BACKENDS,
default='ninja', help='Choose build backend')
parser.add_argument('--dir', default='build',
help='Destination build directory')
parser.add_argument('--python', action='store_true',
help='Enable Python support')
parser.add_argument('--python-bindings', action='store_true',
help='Enable Python Bindings')
parser.add_argument('--release', action='store_true',
help='Set the build as Release (remove debug info)')
parser.add_argument('--nobuild', action='store_true',
help='Only run meson and do not build.')
if os.name == 'nt':
parser.add_argument('--dist', help='dist directory')
args = parser.parse_args()
if os.name == 'nt' and not args.dist:
args.dist = args.dir
args.dist = os.path.abspath(args.dist)
args.dir = os.path.abspath(args.dir)
if hasattr(args, 'dist') and args.dist and os.path.exists(args.dist):
log.error('%s already exists', args.dist)
sys.exit(1)
log.debug('Arguments: %s', args)
build(args)
if os.name == 'nt' and hasattr(args, 'dist') and args.dist:
win_dist(args)
import_r2_meson_mod()
if __name__ == '__main__':
main()
-2
View File
@@ -1,2 +0,0 @@
#!/bin/sh
git submodule update --init
+12 -11
View File
@@ -1,6 +1,7 @@
@ECHO OFF
SET "R2V=5.7.0"
IF NOT DEFINED R2V SET "R2V=5.8.8"
SET ARCH=x64
SETLOCAL ENABLEDELAYEDEXPANSION
@@ -13,22 +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
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 rem python sys\meson.py --release --shared --install --prefix=%CD%\..\%R2DIST% --options "r2_datdir=radare2/share" "r2_libdir=radare2/lib" #"c_args=-D_UNICODE -DUNICODE"
rem meson.exe r2_builddir --buildtype=release --prefix=%CD%\..\%R2DIST% || EXIT /B 1
rem RMDIR /S /Q ..\%R2DIR%
rem meson -C src r2_builddir
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

-6
View File
@@ -1,6 +0,0 @@
brew "p7zip"
brew "ccache"
brew "openssl"
brew "xz"
brew "llvm"
brew "meson"
-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
-34
View File
@@ -1,34 +0,0 @@
{
'includes': [
'../../build/common.gypi'
],
'targets': [
{
'target_name': 'build_all',
'type': 'none',
'dependencies': [
'./crash_generation/crash_generation.gyp:*',
'./handler/exception_handler.gyp:*',
'./sender/crash_report_sender.gyp:*',
]
},
{
'target_name': 'common',
'type': 'static_library',
'include_dirs': [
'<(DEPTH)',
],
'direct_dependent_settings': {
'include_dirs': [
'<(DEPTH)',
]
},
'sources': [
'<(DEPTH)/common/windows/guid_string.cc',
'<(DEPTH)/common/windows/guid_string.h',
'<(DEPTH)/common/windows/http_upload.h',
'<(DEPTH)/common/windows/string_utils.cc',
]
}
]
}
@@ -1,55 +0,0 @@
import sys
import os
import subprocess
import re
import atexit
if len(sys.argv) != 3:
print(f"usage: {sys.argv[0]} [Iaito.AppImage] [symbols dir]")
exit(1)
root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
def store_syms(syms, syms_dir):
m = re.match(b"MODULE ([^ ]+) ([^ ]+) ([^ ]+) (.+)\n.*", syms)
if m is None:
print("Invalid dump_syms output")
return
(modos, modarch, modhash, modname) = m.groups()
modname = modname.decode("utf-8")
modhash = modhash.decode("utf-8")
symdir = os.path.join(syms_dir, modname, modhash)
symfile = f"{modname}.sym"
os.makedirs(symdir)
symfile_path = os.path.join(symdir, symfile)
with open(symfile_path, "wb") as f:
f.write(syms)
print(symfile_path)
def dump_syms(binary, syms_dir):
dump_syms_exec = os.path.join(root, "breakpad/src/tools/linux/dump_syms/dump_syms")
syms = subprocess.run([dump_syms_exec, binary], capture_output=True).stdout
store_syms(syms, syms_dir)
appimage = sys.argv[1]
syms_dst = sys.argv[2]
# stdbuf workaround is needed before https://github.com/AppImage/AppImageKit/commit/e827baa719f5444aeef7202fe1f71c97d4200dde
appimage_p = subprocess.Popen(["stdbuf", "-oL", appimage, "--appimage-mount"], stdout=subprocess.PIPE)
def kill_appimage():
appimage_p.kill()
atexit.register(kill_appimage)
mount_dir = appimage_p.stdout.readline().strip().decode("utf-8")
binaries = [ os.path.join(mount_dir, "usr/bin/Iaito") ]
for f in os.scandir(os.path.join(mount_dir, "usr/lib")):
if f.is_dir() or f.is_symlink():
continue
binaries.append(f.path)
for b in binaries:
dump_syms(b, syms_dst)
File diff suppressed because it is too large. Load diff
-6
View File
@@ -1,6 +0,0 @@
$arch = $args[0]
$dist = $args[1]
$libpath = If ($arch -eq "x64") {"C:\OpenSSL-Win64\bin"} Else {"C:\OpenSSL-Win32\bin"}
Copy-Item $libpath\libeay32.dll -Destination $dist
Copy-Item $libpath\ssleay32.dll -Destination $dist
-17
View File
@@ -1,17 +0,0 @@
$arch = $args[0]
$dist = $args[1]
$py_version = (python --version).Split()[1]
$py_base = "python" + $py_version[0] + $py_version[2]
$py_platform = If ($arch -eq "x64") {"amd64"} Else {"win32"}
$py_url = "https://www.python.org/ftp/python/${py_version}/python-${py_version}-embed-${py_platform}.zip"
Remove-Item .\python_embed -Recurse -ErrorAction SilentlyContinue
$ErrorActionPreference = 'Stop'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget ${py_url} -OutFile python_embed.zip; Expand-Archive .\python_embed.zip -DestinationPath .\python_embed
New-Item -ItemType directory -Force -Path $dist\$py_base
Copy-Item .\python_embed\${py_base}.zip -Destination $dist\$py_base
Copy-Item .\python_embed\*.pyd -Destination $dist\$py_base
Copy-Item .\python_embed\sqlite3.dll -Destination $dist\$py_base
Copy-Item .\python_embed\python*.dll -Destination $dist
[System.IO.File]::WriteAllLines("${dist}\${py_base}._pth", "${py_base}`r`n${py_base}\${py_base}.zip`r`n${py_base}\site-packages")
+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
-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
cd $(dirname "${BASH_SOURCE[0]}")/..
cutter_timestamp=$(git show -s --format=%ct)
cutter_commit="$(git show -s --format="%H %s")"
echo "Cloning current cutter.re"
git clone --depth 1 [email protected]:radareorg/cutter.re.git || exit 1
echo "Updating docs"
rm -rf cutter.re/docs
cp -a docs/build/html cutter.re/docs || exit 1
echo "Committing new changes"
cd cutter.re || exit 1
docs_timestamp=$(git show -s --format=%ct)
if [ $docs_timestamp -ge $cutter_timestamp ]; then
echo "Last commit on cutter.re is newer than this commit on cutter. Skipping."
exit 0
fi
git add . || exit 1
git diff --cached --quiet && echo "No changes." && exit 0
printf "Update docs from radareorg/cutter\n\nOriginal Commit:\n$cutter_commit" | git commit -F -
git push origin master || exit 1
Binary file not shown.
+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
Binary file not shown.
-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"
-56
View File
@@ -1,56 +0,0 @@
#!/bin/bash
cd $(dirname "${BASH_SOURCE[0]}")/..
mkdir -p cutter-deps && cd cutter-deps
LINUX_FILE="cutter-deps-linux.tar.gz"
LINUX_MD5=31fd19443a3405d6b6097cbbd4c11fba
LINUX_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-linux.tar.gz
MACOS_FILE="cutter-deps-macos.tar.gz"
MACOS_MD5=e75041c04fc806437723a399028402af
MACOS_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-macos.tar.gz
WIN_FILE="cutter-deps-win.tar.gz"
WIN_MD5=7c755404140f2e9945bfc13d2e645bb1
WIN_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-win.tar.gz
if [ "$OS" == "Windows_NT" ]; then
FILE="${WIN_FILE}"
MD5="${WIN_MD5}"
URL="${WIN_URL}"
else
UNAME_S="$(uname -s)"
if [ "$UNAME_S" == "Linux" ]; then
FILE="${LINUX_FILE}"
MD5="${LINUX_MD5}"
URL="${LINUX_URL}"
elif [ "$UNAME_S" == "Darwin" ]; then
FILE="${MACOS_FILE}"
MD5="${MACOS_MD5}"
URL="${MACOS_URL}"
else
echo "Unsupported Platform: uname -s => $UNAME_S, \$OS => $OS"
exit 1
fi
fi
curl -L "$URL" -o "$FILE" || exit 1
if [ "$UNAME_S" == "Darwin" ]; then
if [ "$(md5 -r "$FILE")" != "$MD5 $FILE" ]; then \
echo "MD5 mismatch for file $FILE"; \
exit 1; \
else \
echo "$FILE OK"; \
fi
else
echo "$MD5 $FILE" | md5sum -c - || exit 1
fi
tar -xf "$FILE" || exit 1
if [ -f relocate.sh ]; then
./relocate.sh || exit 1
fi
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
-33
View File
@@ -1,33 +0,0 @@
@ECHO OFF
SET ROOT_DIR=%CD%
powershell -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; wget https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip "
7z -bd x %ROOT_DIR%\depot_tools.zip -odepot_tools
powershell -Command "depot_tools\update_depot_tools"
SET BUFF_PATH=%PATH%
SET DEPOT_TOOLS=%ROOT_DIR%\depot_tools
set PATH=%DEPOT_TOOLS%;%BUFF_PATH%
mkdir %ROOT_DIR%\src\breakpad
CD %ROOT_DIR%\src\breakpad
powershell -Command "fetch breakpad"
powershell -Command "gclient sync"
CD %ROOT_DIR%\src\breakpad\src
powershell -Command "git reset --hard 756daa536ad819eff80172aaab262fb71d1e89fd"
CD %ROOT_DIR%\src\breakpad\src\src\client\windows
DEL %CD%\breakpad_client.gyp
DEL %CD%\breakpad_client.sln
DEL %CD%\common.vcxproj
DEL %CD%\common.vcxproj.filters
DEL %CD%\build_all.vcxproj
COPY %ROOT_DIR%\scripts\breakpad_client.gyp %CD%
CD %ROOT_DIR%\src\breakpad\src\src
SET GYP_MSVS_VERSION=2017
powershell -Command "tools\gyp\gyp.bat --no-circular-check client\windows\breakpad_client.gyp -Dwin_release_RuntimeLibrary=2 -Dwin_debug_RuntimeLibrary=2 -Dplatform=%ARCH% -Dconfiguration=release"
devenv client\windows\breakpad_client.sln /upgrade
set PATH=%BUFF_PATH%
msbuild /m %CD%\client\windows\breakpad_client.sln /p:Configuration=release /p:Platform=%ARCH% || exit /b 1
CD %ROOT_DIR%
-11
View File
@@ -1,11 +0,0 @@
#!/bin/sh
set -euo pipefail
git clone https://github.com/google/breakpad.git
cd breakpad
git clone https://chromium.googlesource.com/linux-syscall-support src/third_party/lss
CFLAGS=-w CXXFLAGS=-w ./configure --disable-tools --prefix=`pwd`/prefix && make -j4 && make install || exit 1
export CUSTOM_BREAKPAD_PREFIX="`pwd`/prefix"
cd ..
-24
View File
@@ -1,24 +0,0 @@
#!/bin/sh
set -euo pipefail
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
DIR="$SCRIPTPATH/.."
cd "$DIR"
BREAKPAD_FRAMEWORK_DIR="$DIR/breakpad/framework"
BREAKPAD_DUMP_SYMS_DIR="$DIR/breakpad/bin"
git clone https://github.com/google/breakpad.git
mkdir $BREAKPAD_FRAMEWORK_DIR
mkdir $BREAKPAD_DUMP_SYMS_DIR
cd breakpad
git checkout 4d550cceca107f36c4bc1ea1126b7d32cc50f424
git apply "$SCRIPTPATH/breakpad_macos.patch"
cd src/client/mac/ && xcodebuild -sdk macosx
cp -R build/Release/Breakpad.framework "$BREAKPAD_FRAMEWORK_DIR"
cd $DIR/breakpad
cp -R src/. framework/Breakpad.framework/Headers
export BREAKPAD_FRAMEWORK_DIR=$BREAKPAD_FRAMEWORK_DIR
cd $DIR
-25
View File
@@ -1,25 +0,0 @@
#!/bin/bash
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
mkdir python && cd python
wget "https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tar.xz" || exit 1
tar -xf Python-3.6.4.tar.xz || exit 1
export PYTHON_FRAMEWORK_DIR="`pwd`/framework"
cd Python-3.6.4 || exit 1
CPPFLAGS="-I$(brew --prefix openssl)/include" LDFLAGS="-L$(brew --prefix openssl)/lib" ./configure --enable-framework=$PYTHON_FRAMEWORK_DIR || exit 1
# Patch for https://github.com/radareorg/cutter/issues/424
sed -i ".original" "s/#define HAVE_GETENTROPY 1/#define HAVE_GETENTROPY 0/" pyconfig.h
make -j4 || exit 1
make frameworkinstallframework > /dev/null || exit 1
PYTHONHOME=$PYTHON_FRAMEWORK_DIR/Python.framework/Versions/Current \
$PYTHON_FRAMEWORK_DIR/Python.framework/Versions/Current/bin/pip3 install -r "$SCRIPTPATH/pip_requirements.txt" || exit 1
cd ../..
-22
View File
@@ -1,22 +0,0 @@
#!/bin/bash
set -e
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.."
if [[ ! -d r2dec-js ]]; then
git clone https://github.com/radareorg/r2dec-js.git --depth 1 --branch master
#cd r2dec-js
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
#cd ..
fi
cd r2dec-js
rm -rf build
mkdir build && cd build
meson --buildtype=release --libdir=share/radare2/plugins --datadir=share/radare2/plugins "$@" ../p
ninja
ninja install
-22
View File
@@ -1,22 +0,0 @@
#!/bin/bash
set -e
SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.."
if [[ ! -d r2ghidra ]]; then
# remove depth, branch and uncomment lines bellow to use specifc commit
git clone --recurse-submodules https://github.com/radareorg/r2ghidra.git --depth 1 --branch master || exit 1
#pushd r2ghidra
#git checkout --recurse-submodules 5e845f4b50e8559bd51af03b22b6586e8cc5c35c
#popd
fi
cd r2ghidra || exit 1
mkdir build && cd build || exit 1
cmake -G Ninja "$@" .. || exit 1
ninja || exit 1
ninja install || exit 1
+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`
-46
View File
@@ -1,46 +0,0 @@
import sys
import os
import requests
import re
import subprocess
platforms = ["linux", "macos", "win"]
if sys.platform == "darwin":
md5sum_cmd = ["md5", "-r"]
else:
md5sum_cmd = ["md5sum"]
fetch_deps_path = os.path.join(os.path.dirname(sys.argv[0]), "fetch_deps.sh")
print("Fetching latest release")
json = requests.get("https://api.github.com/repos/radareorg/cutter-deps/releases/latest").json()
release_url = json["assets"][0]["browser_download_url"]
for platform in platforms:
release_url = release_url.replace(platform, "${PLATFORM}")
with open(fetch_deps_path) as f:
fetch_deps = f.read()
md5 = {}
for platform in platforms:
platform_url = release_url.replace("${PLATFORM}", platform)
print(f"Getting MD5 for {platform_url}")
curl = subprocess.Popen(["curl", "-fL", platform_url], stdout=subprocess.PIPE)
md5sum = subprocess.run(md5sum_cmd, stdin=curl.stdout, capture_output=True, encoding="utf-8").stdout
curl.wait()
if curl.returncode != 0:
print(f"Failed to download {platform_url}, skipping.")
continue
md5sum = re.fullmatch("([a-zA-Z0-9]+)( +-)?\n?", md5sum).group(1)
print(f"MD5: {md5sum}")
fetch_deps = re.sub(f"^{platform.upper()}_URL=.*$", f"{platform.upper()}_URL={platform_url}".replace("\\", r"\\"), fetch_deps, flags=re.MULTILINE)
fetch_deps = re.sub(f"^{platform.upper()}_MD5=.*$", f"{platform.upper()}_MD5={md5sum}".replace("\\", r"\\"), fetch_deps, flags=re.MULTILINE)
with open(fetch_deps_path, "w") as f:
f.write(fetch_deps)
-316
View File
@@ -1,316 +0,0 @@
cmake_minimum_required(VERSION 3.5)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(DisallowInSource)
include(Utils)
set(IAITO_PYTHON_MIN 3.5)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
option(IAITO_USE_BUNDLED_RADARE2 "Use radare2 from src/radare2 submodule instead of searching for it on the system" OFF)
option(IAITO_USE_ADDITIONAL_RADARE2_PATHS "Search radare2 in additional paths which are not part of default system library paths.\
Disable this option if you are linking against radare2 pacakged as proper system library or in a custom path and additional are paths causing problems." ON)
option(IAITO_ENABLE_PYTHON "Enable Python integration. Requires Python >= ${IAITO_PYTHON_MIN}." OFF)
option(IAITO_ENABLE_PYTHON_BINDINGS "Enable generating Python bindings with Shiboken2. Unused if IAITO_ENABLE_PYTHON=OFF." OFF)
option(IAITO_ENABLE_CRASH_REPORTS "Enable crash report system. Unused if IAITO_ENABLE_CRASH_REPORTS=OFF" OFF)
option(IAITO_APPIMAGE_BUILD "Enable Appimage specific changes. Doesn't cause building of Appimage itself." OFF)
tri_option(IAITO_ENABLE_KSYNTAXHIGHLIGHTING "Use KSyntaxHighlighting" AUTO)
tri_option(IAITO_ENABLE_GRAPHVIZ "Enable use of graphviz for graph layout" AUTO)
set(SHIBOKEN_EXTRA_OPTIONS "" CACHE STRING "Extra options for shiboken generator")
set(IAITO_EXTRA_PLUGIN_DIRS "" CACHE STRING "List of addition plugin locations")
option(IAITO_ENABLE_DEPENDENCY_DOWNLOADS "Enable downloading of dependencies. Setting to OFF doesn't affect any downloads done by r2 build." OFF)
option(IAITO_PACKAGE_DEPENDENCIES "During install step include the third party dependencies." OFF)
option(IAITO_PACKAGE_R2GHIDRA "Compile and install r2ghidra during install step." OFF)
option(IAITO_PACKAGE_R2DEC "Compile and install r2dec during install step." OFF)
OPTION(IAITO_QT6 "Use QT6" OFF)
if(NOT IAITO_ENABLE_PYTHON)
set(IAITO_ENABLE_PYTHON_BINDINGS OFF)
endif()
# Parse Iaito.pro to get filenames
include(QMakeProParse)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Iaito.pro"
"${CMAKE_CURRENT_BINARY_DIR}/Iaito.pro"
COPYONLY) # trigger reconfigure if Iaito.pro changes
parse_qmake_pro("${CMAKE_CURRENT_BINARY_DIR}/Iaito.pro" IAITO_PRO)
set(SOURCE_FILES ${IAITO_PRO_SOURCES})
set(HEADER_FILES ${IAITO_PRO_HEADERS})
set(UI_FILES ${IAITO_PRO_FORMS})
set(QRC_FILES ${IAITO_PRO_RESOURCES})
set(IAITO_VERSION_MAJOR "${IAITO_PRO_IAITO_VERSION_MAJOR}")
set(IAITO_VERSION_MINOR "${IAITO_PRO_IAITO_VERSION_MINOR}")
set(IAITO_VERSION_PATCH "${IAITO_PRO_IAITO_VERSION_PATCH}")
set(IAITO_VERSION_FULL "${IAITO_VERSION_MAJOR}.${IAITO_VERSION_MINOR}.${IAITO_VERSION_PATCH}")
project(iaito VERSION "${IAITO_VERSION_FULL}")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
if (IAITO_QT6)
set(QT_PREFIX Qt6)
else()
set(QT_PREFIX Qt5)
endif()
find_package(${QT_PREFIX} REQUIRED COMPONENTS Core Widgets Gui Svg Network)
include(IaitoInstallDirs)
if(IAITO_USE_BUNDLED_RADARE2)
include(BundledRadare2)
set(RADARE2_TARGET Radare2)
else()
find_package(Radare2 REQUIRED)
set(RADARE2_TARGET Radare2::libr)
endif()
if(IAITO_ENABLE_PYTHON)
find_package(PythonInterp REQUIRED)
find_package(PythonLibs ${IAITO_PYTHON_MIN} REQUIRED)
include_directories(${PYTHON_INCLUDE_DIRS})
add_definitions(-DIAITO_ENABLE_PYTHON)
if(IAITO_ENABLE_PYTHON_BINDINGS)
# 5.12.3 => 5.12
if("${Qt5_VERSION}" MATCHES "^([0-9]+\\.[0-9]+)\\.[0-9]+")
set(Shiboken2_VERSION_REQUIRED "${CMAKE_MATCH_1}")
else()
message(FATAL_ERROR "Failed to recognize Qt version")
endif()
find_package(Shiboken2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED)
find_package(PySide2 "${Shiboken2_VERSION_REQUIRED}" REQUIRED)
get_target_property(PYSIDE_INCLUDE_DIR PySide2::pyside2 INTERFACE_INCLUDE_DIRECTORIES)
list(GET PYSIDE_INCLUDE_DIR 0 PYSIDE_INCLUDE_DIR)
include_directories(${PYSIDE_INCLUDE_DIR}
${PYSIDE_INCLUDE_DIR}/QtCore
${PYSIDE_INCLUDE_DIR}/QtGui
${PYSIDE_INCLUDE_DIR}/QtWidgets)
add_definitions(-DIAITO_ENABLE_PYTHON_BINDINGS)
endif()
endif()
if(IAITO_ENABLE_KSYNTAXHIGHLIGHTING)
if(IAITO_ENABLE_KSYNTAXHIGHLIGHTING STREQUAL AUTO)
find_package(KF5SyntaxHighlighting)
if(KF5SyntaxHighlighting_FOUND)
set(KSYNTAXHIGHLIGHTING_STATUS ON)
else()
set(KSYNTAXHIGHLIGHTING_STATUS "OFF (KSyntaxHighlighting not found)")
endif()
else()
find_package(KF5SyntaxHighlighting REQUIRED)
set(KSYNTAXHIGHLIGHTING_STATUS ON)
endif()
else()
set(KSYNTAXHIGHLIGHTING_STATUS OFF)
endif()
if (IAITO_ENABLE_GRAPHVIZ)
if (IAITO_ENABLE_GRAPHVIZ STREQUAL AUTO)
find_package(Graphviz)
else()
find_package(Graphviz REQUIRED)
endif()
set (IAITO_ENABLE_GRAPHVIZ ${Graphviz_FOUND})
endif()
message(STATUS "")
message(STATUS "Building Iaito version ${IAITO_VERSION_FULL}")
message(STATUS "Options:")
message(STATUS "- Bundled radare2: ${IAITO_USE_BUNDLED_RADARE2}")
message(STATUS "- Python: ${IAITO_ENABLE_PYTHON}")
message(STATUS "- Python Bindings: ${IAITO_ENABLE_PYTHON_BINDINGS}")
message(STATUS "- Crash Handling: ${IAITO_ENABLE_CRASH_REPORTS}")
message(STATUS "- KSyntaxHighlighting: ${KSYNTAXHIGHLIGHTING_STATUS}")
message(STATUS "- Graphviz: ${IAITO_ENABLE_GRAPHVIZ}")
message(STATUS "")
include(QMakeConfigureFile)
qmake_configure_file("${CMAKE_CURRENT_SOURCE_DIR}/IaitoConfig.h.in"
"${CMAKE_CURRENT_BINARY_DIR}/IaitoConfig.h")
if(IAITO_ENABLE_PYTHON_BINDINGS)
set(BINDINGS_SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/bindings")
set(BINDINGS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/bindings")
configure_file("${BINDINGS_SRC_DIR}/bindings.xml" "${BINDINGS_BUILD_DIR}/bindings.xml" COPYONLY) # trigger reconfigure if file changes
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "${BINDINGS_SRC_DIR}/src_list.py" cmake "${BINDINGS_BUILD_DIR}" OUTPUT_VARIABLE BINDINGS_SOURCE)
set_property(SOURCE ${BINDINGS_SOURCE} PROPERTY SKIP_AUTOGEN ON)
include_directories("${BINDINGS_BUILD_DIR}/IaitoBindings")
set(SHIBOKEN_OPTIONS)
if (WIN32)
list(APPEND SHIBOKEN_OPTIONS --avoid-protected-hack)
endif()
add_custom_command(OUTPUT ${BINDINGS_SOURCE}
COMMAND Shiboken2::shiboken2 --project-file="${BINDINGS_BUILD_DIR}/bindings.txt" ${SHIBOKEN_OPTIONS} ${SHIBOKEN_EXTRA_OPTIONS}
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/bindings/bindings.xml" "${BINDINGS_BUILD_DIR}/bindings.txt"
IMPLICIT_DEPENDS CXX "${CMAKE_CURRENT_SOURCE_DIR}/bindings/bindings.h"
COMMENT "Generating Python bindings with shiboken2")
else()
set(BINDINGS_SOURCE "")
endif()
if (TARGET Graphviz::GVC)
list(APPEND SOURCE_FILES ${IAITO_PRO_GRAPHVIZ_SOURCES})
list(APPEND HEADER_FILES ${IAITO_PRO_GRAPHVIZ_HEADERS})
endif()
if (WIN32)
set(PLATFORM_RESOURCES "img/iaito.rc")
else()
set(PLATFORM_RESOURCES "")
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU"
OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
add_definitions(-Wall -Wextra)
set_source_files_properties(${BINDINGS_SOURCE} PROPERTIES COMPILE_FLAGS -w)
endif()
add_executable(iaito MACOSX_BUNDLE ${UI_FILES} ${QRC_FILES} ${PLATFORM_RESOURCES} ${SOURCE_FILES} ${HEADER_FILES} ${BINDINGS_SOURCE})
set_target_properties(iaito PROPERTIES
ENABLE_EXPORTS ON
CXX_VISIBILITY_PRESET hidden
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist")
target_compile_definitions(iaito PRIVATE IAITO_SOURCE_BUILD)
set(IAITO_INCLUDE_DIRECTORIES core widgets common plugins menus .)
foreach(_dir ${IAITO_INCLUDE_DIRECTORIES})
target_include_directories(iaito PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/${_dir}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/iaito/${_dir}>
)
endforeach()
if (TARGET Graphviz::GVC)
target_link_libraries(iaito PRIVATE Graphviz::GVC)
target_compile_definitions(iaito PRIVATE IAITO_ENABLE_GRAPHVIZ)
endif()
if(IAITO_ENABLE_CRASH_REPORTS)
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(iaito PRIVATE Threads::Threads)
add_definitions(-DIAITO_ENABLE_CRASH_REPORTS)
if (NOT WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ")
endif()
find_package(Breakpad)
target_link_libraries(iaito PRIVATE Breakpad::client)
endif()
target_link_libraries(iaito PUBLIC ${QT_PREFIX}::Core ${QT_PREFIX}::Widgets ${QT_PREFIX}::Gui PRIVATE ${QT_PREFIX}::Svg ${QT_PREFIX}::Network)
target_link_libraries(iaito PUBLIC ${RADARE2_TARGET})
if(IAITO_ENABLE_PYTHON)
if (WIN32)
# On windows some of the Python STABLE API functions are in seperate library
# which isn't added by CMake.
get_filename_component(_PYTHON_LIB_DIR ${PYTHON_LIBRARIES} DIRECTORY)
target_link_directories(iaito PRIVATE ${_PYTHON_LIB_DIR})
endif()
target_link_libraries(iaito PRIVATE ${PYTHON_LIBRARIES})
if(IAITO_ENABLE_PYTHON_BINDINGS)
target_link_libraries(iaito PRIVATE Shiboken2::libshiboken PySide2::pyside2)
get_target_property(RAW_BINDINGS_INCLUDE_DIRS iaito INCLUDE_DIRECTORIES)
set(BINDINGS_INCLUDE_DIRS "")
foreach(_dir ${RAW_BINDINGS_INCLUDE_DIRS})
string(REGEX REPLACE "\\$<BUILD_INTERFACE:(.*)>" "\\1" _dir ${_dir})
string(REGEX REPLACE "\\$<INSTALL_INTERFACE:(.*)>" "" _dir ${_dir})
if (NOT "${_dir}" STREQUAL "")
list(APPEND BINDINGS_INCLUDE_DIRS "${_dir}")
endif()
endforeach()
if(APPLE AND _qt5Core_install_prefix)
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include")
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtCore")
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtGui")
list(APPEND BINDINGS_INCLUDE_DIRS "${_qt5Core_install_prefix}/include/QtWidgets")
endif()
list(APPEND BINDINGS_INCLUDE_DIRS ${Qt5Core_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Gui_INCLUDE_DIRS})
list(APPEND BINDINGS_INCLUDE_DIRS ${Radare2_INCLUDE_DIRS})
list(APPEND BINDINGS_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}")
if (NOT WIN32)
string(REPLACE ";" ":" BINDINGS_INCLUDE_DIRS "${BINDINGS_INCLUDE_DIRS}")
endif()
qmake_configure_file("${BINDINGS_SRC_DIR}/bindings.txt.in" "${BINDINGS_BUILD_DIR}/bindings.txt")
add_compile_definitions(WIN32_LEAN_AND_MEAN)
endif()
endif()
if(TARGET KF5::SyntaxHighlighting)
target_link_libraries(iaito PRIVATE KF5::SyntaxHighlighting)
target_compile_definitions(iaito PRIVATE IAITO_ENABLE_KSYNTAXHIGHLIGHTING)
endif()
if (IAITO_APPIMAGE_BUILD)
target_compile_definitions(iaito PRIVATE APPIMAGE)
endif()
if (IAITO_PACKAGE_R2DEC)
target_compile_definitions(iaito PRIVATE IAITO_APPVEYOR_R2DEC)
endif()
include(Translations)
# Install files
install(TARGETS iaito
EXPORT iaitoTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
BUNDLE DESTINATION "." # needs to be tested
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT Devel
)
install(EXPORT iaitoTargets
NAMESPACE iaito::
DESTINATION ${ConfigPackageLocation}
COMPONENT Devel)
install(FILES
cmake/iaitoConfig.cmake
DESTINATION ${ConfigPackageLocation}
COMPONENT Devel
)
foreach(_file ${HEADER_FILES})
# Can't use target PUBLIC_HEADER option for installing due to multiple directories
get_filename_component(_header_dir "${_file}" DIRECTORY)
install (FILES "${_file}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/iaito/${_header_dir}" COMPONENT Devel)
endforeach()
if(UNIX AND NOT APPLE)
install (FILES "img/iaito-o.svg"
DESTINATION "share/icons/hicolor/scalable/apps/")
install(FILES "org.radare.iaito.desktop"
DESTINATION "share/applications")
install(FILES "org.radare.iaito.appdata.xml"
DESTINATION "share/metainfo")
install(FILES "iaito.1"
DESTINATION "share/man/man1")
endif()
include(Packaging)
+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
}
+30 -40
View File
@@ -3,8 +3,11 @@ TEMPLATE = app
TARGET = iaito
IAITO_VERSION_MAJOR = 5
IAITO_VERSION_MINOR = 7
IAITO_VERSION_PATCH = 0
IAITO_VERSION_MINOR = 9
IAITO_VERSION_PATCH = 4
CONFIG+=app_bundle
# LIBS+= -dead_strip
CONFIG += sdk_no_version_check
@@ -12,11 +15,16 @@ 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
QMAKE_CXXFLAGS += -g -O0
#QMAKE_CXXFLAGS += -O0 -fsanitize=address
#QMAKE_LFLAGS += -fsanitize=address
VERSION = $${IAITO_VERSION_MAJOR}.$${IAITO_VERSION_MINOR}.$${IAITO_VERSION_PATCH}
@@ -24,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
@@ -57,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) {
@@ -82,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) {
@@ -116,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
@@ -311,9 +300,9 @@ IAITO_APPVEYOR_R2DEC {
IAITO_R2GHIDRA_STATIC {
message("Building with static r2ghidra support")
DEFINES += IAITO_R2GHIDRA_STATIC
SOURCES += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.cpp
HEADERS += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.h
INCLUDEPATH += $$R2GHIDRA_SOURCE/cutter-plugin
SOURCES += $$R2GHIDRA_SOURCE/iaito-plugin/R2GhidraDecompiler.cpp
HEADERS += $$R2GHIDRA_SOURCE/iaito-plugin/R2GhidraDecompiler.h
INCLUDEPATH += $$R2GHIDRA_SOURCE/iaito-plugin
LIBS += -L$$R2GHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp
QMAKE_LFLAGS += /delayload:core_ghidra.dll
}
@@ -473,6 +462,7 @@ GRAPHVIZ_SOURCES = \
widgets/GraphvizLayout.cpp
HEADERS += \
common/R2Shims.h \
core/Iaito.h \
core/IaitoCommon.h \
core/IaitoDescriptions.h \
@@ -717,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
@@ -741,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){
+80 -40
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>
@@ -33,6 +35,27 @@
#include <R2GhidraDecompiler.h>
#endif
static bool versionCheck() {
// Check r2 version
QString a = r_core_version (); // runtime library version
QString b = "" R2_GITTAP; // compiled version
QStringList la = a.split(".");
QStringList lb = b.split(".");
if (la.size() < 2 && lb.size() < 2) {
R_LOG_WARN ("Invalid version string somwhere");
return false;
}
if (la.at(0) != lb.at(0)) {
R_LOG_WARN ("Major version differs");
return false;
}
if (la.at(1) != lb.at(1)) {
R_LOG_WARN ("Minor version differs");
return false;
}
return true;
}
IaitoApplication::IaitoApplication(int &argc, char **argv) : QApplication(argc, argv)
{
// Setup application information
@@ -70,29 +93,31 @@ 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);
}
// Check r2 version
QString r2version = r_core_version();
QString localVersion = "" R2_GITTAP;
if (localVersion != "" && r2version != "" && r2version != localVersion) {
if (!versionCheck ()) {
QMessageBox msg;
msg.setIcon(QMessageBox::Critical);
msg.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msg.setWindowTitle(QObject::tr("Version mismatch!"));
QString localVersion = r_core_version ();
QString r2version = R2_GITTAP;
msg.setText(QString(
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);
}
}
@@ -112,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);
@@ -147,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();
@@ -228,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()
@@ -323,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);
@@ -343,13 +379,11 @@ bool IaitoApplication::parseCommandLineOptions()
QObject::tr("file"));
cmd_parser.addOption(scriptOption);
QCommandLineOption writeModeOption({"w", "writemode"},
QObject::tr("Open file in write mode"));
QCommandLineOption writeModeOption({"w", "writemode"}, QObject::tr("Open file in write mode"));
cmd_parser.addOption(writeModeOption);
QCommandLineOption binCacheOption({"c", "bincache"},
QObject::tr("Enable bin.cache to make relocs work"));
cmd_parser.addOption(writeModeOption);
QCommandLineOption binCacheOption({"c", "bincache"}, QObject::tr("Enable bin.cache to make relocs work"));
cmd_parser.addOption(binCacheOption);
QCommandLineOption pythonHomeOption("pythonhome",
@@ -385,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) {
@@ -400,6 +434,9 @@ bool IaitoApplication::parseCommandLineOptions()
case 2:
opts.analLevel = AutomaticAnalysisLevel::AAAA;
break;
case 3:
opts.analLevel = AutomaticAnalysisLevel::AAAAA;
break;
}
}
@@ -430,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);
}
-75
View File
@@ -1,75 +0,0 @@
# TODO: move this into the radare2 repository
include(ExternalProject)
set(RADARE2_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../radare2")
if(WIN32)
set(RADARE2_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}")
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(RADARE2_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>")
endif()
set(RADARE2_INSTALL_BINPATH ".")
set(MESON_OPTIONS "--prefix=${RADARE2_INSTALL_DIR}" "--bindir=${RADARE2_INSTALL_BINPATH}" "-Dr2_incdir=include/libr")
else()
set(RADARE2_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/Radare2-prefix")
set(MESON_OPTIONS "--prefix=${RADARE2_INSTALL_DIR}" --libdir=lib)
endif()
find_program(MESON meson)
if(NOT MESON)
message(FATAL_ERROR "Failed to find meson, which is required to build bundled radare2")
endif()
find_program(NINJA ninja)
if(NOT NINJA)
message(FATAL_ERROR "Failed to find ninja, which is required to build bundled radare2")
endif()
ExternalProject_Add(Radare2-Bundled
SOURCE_DIR "${RADARE2_SOURCE_DIR}"
CONFIGURE_COMMAND "${MESON}" "<SOURCE_DIR>" ${MESON_OPTIONS} && "${MESON}" configure ${MESON_OPTIONS} --buildtype "$<$<CONFIG:Debug>:debug>$<$<NOT:$<CONFIG:Debug>>:release>"
BUILD_COMMAND "${NINJA}"
INSTALL_COMMAND "${NINJA}" install)
set(Radare2_INCLUDE_DIRS "${RADARE2_INSTALL_DIR}/include/libr" "${RADARE2_INSTALL_DIR}/include/libr/sdb")
add_library(Radare2 INTERFACE)
add_dependencies(Radare2 Radare2-Bundled)
if(NOT (${CMAKE_VERSION} VERSION_LESS "3.13.0"))
target_link_directories(Radare2 INTERFACE
$<BUILD_INTERFACE:${RADARE2_INSTALL_DIR}/lib>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_LIBDIR}>)
else()
link_directories("${RADARE2_INSTALL_DIR}/lib")
endif()
set (R2_LIBS r_core r_config r_cons r_io r_util r_flag r_asm r_debug
r_hash r_bin r_lang r_io r_anal r_parse r_bp r_egg r_reg
r_search r_syscall r_socket r_fs r_magic r_crypto)
set (R2_EXTRA_LIBS r_main)
set (R2_BIN r2pm ravc2 r2agent rabin2 radare2 radiff2 rafind2 ragg2 rahash2 rarun2 rasm2 rax2)
target_link_libraries(Radare2 INTERFACE
${R2_LIBS})
target_include_directories(Radare2 INTERFACE
"$<BUILD_INTERFACE:${Radare2_INCLUDE_DIRS}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libr>")
install(TARGETS Radare2 EXPORT iaitoTargets)
if (APPLE)
elseif (WIN32)
foreach(_lib ${R2_LIBS} ${R2_EXTRA_LIBS})
install(FILES "${RADARE2_INSTALL_DIR}/${R2_INSTALL_BINPATH}/${_lib}.dll" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endforeach()
foreach(_exe ${R2_BIN})
install(FILES "${RADARE2_INSTALL_DIR}/${R2_INSTALL_BINPATH}/${_exe}.exe" DESTINATION "${CMAKE_INSTALL_BINDIR}")
endforeach()
install(DIRECTORY "${RADARE2_INSTALL_DIR}/share" DESTINATION ".")
install(DIRECTORY "${RADARE2_INSTALL_DIR}/include" DESTINATION "."
COMPONENT Devel)
install(DIRECTORY "${RADARE2_INSTALL_DIR}/lib" DESTINATION "."
COMPONENT Devel
PATTERN "*.pdb" EXCLUDE)
else ()
install(DIRECTORY "${RADARE2_INSTALL_DIR}/" DESTINATION ".")
endif()
-13
View File
@@ -1,13 +0,0 @@
function(DisallowInSource)
get_filename_component(SRC_DIR_REALPATH "${CMAKE_SOURCE_DIR}" REALPATH)
get_filename_component(BINARY_DIR_REALPATH "${CMAKE_BINARY_DIR}" REALPATH)
if(SRC_DIR_REALPATH STREQUAL BINARY_DIR_REALPATH)
message(FATAL_ERROR " In-source builds are not allowed.
Please create a directory and run cmake from there:
mkdir build && cd build && cmake ..
This process created the file CMakeCache.txt and the directory CMakeFiles in ${CMAKE_SOURCE_DIR}.
Please delete them manually!")
endif()
endfunction()
DisallowInSource()
-65
View File
@@ -1,65 +0,0 @@
# - Find Breakpad
#
# Breakpad_FOUND - True if Breakpad has been found.
# Breakpad_INCLUDE_DIRS - Breakpad include directory
# Breakpad_LIBRARIES - List of libraries when using Breakpad.
set(Breakpad_LIBRARIES_VARS "")
if(WIN32)
find_path(Breakpad_INCLUDE_DIRS
client/windows/handler/exception_handler.h
HINTS
"${CMAKE_CURRENT_SOURCE_DIR}/Breakpad/src/src")
set(Breakpad_LIBRARY_NAMES
exception_handler
crash_generation_client
common
)
set(Breakpad_LIBRARIES "")
foreach(libname ${Breakpad_LIBRARY_NAMES})
find_library(Breakpad_LIBRARY_${libname}
${libname}
HINTS
"${CMAKE_CURRENT_SOURCE_DIR}/Breakpad/src/src/client/windows/Release/lib"
REQUIRED)
list(APPEND Breakpad_LIBRARIES ${Breakpad_LIBRARY_${libname}})
list(APPEND Breakpad_LIBRARIES_VARS "Breakpad_LIBRARY_${libname}")
endforeach()
set (Breakpad_LINK_LIBRARIES ${Breakpad_LIBRARIES})
set(Breakpad_LIBRARY_DIRS "")
elseif(APPLE)
find_library(Breakpad_LINK_LIBRARIES Breakpad REQUIRED)
set(Breakpad_LIBRARIES ${Breakpad_LINK_LIBRARIES})
# Assumes Breakpad is packed as Framework
set(Breakpad_INCLUDE_DIRS "${Breakpad_LINK_LIBRARIES}/Headers")
else()
set(Breakpad_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH})
list(APPEND CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/Breakpad/prefix")
find_package(PkgConfig REQUIRED)
pkg_search_module(Breakpad breakpad-client)
# reset CMAKE_PREFIX_PATH
set(CMAKE_PREFIX_PATH ${Breakpad_CMAKE_PREFIX_PATH_TEMP})
mark_as_advanced(Breakpad_CMAKE_PREFIX_PATH_TEMP)
endif()
# could be simplified in > cmake 3.11 using pkg_search_module IMPORTED_TARGET [GLOBAL] but this would still be required for windows
add_library(Breakpad::client INTERFACE IMPORTED)
set_target_properties(Breakpad::client PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Breakpad_INCLUDE_DIRS}")
set_target_properties(Breakpad::client PROPERTIES
INTERFACE_LINK_LIBRARIES "${Breakpad_LINK_LIBRARIES}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Breakpad REQUIRED_VARS Breakpad_LIBRARIES Breakpad_INCLUDE_DIRS ${Breakpad_LIBRARIES_VARS})
mark_as_advanced(Breakpad_LIBRARIES_VARS)
-29
View File
@@ -1,29 +0,0 @@
set (_module Graphviz)
find_package(PkgConfig)
if (PkgConfig_FOUND)
if (NOT (CMAKE_VERSION VERSION_LESS "3.12.0"))
pkg_check_modules(GVC IMPORTED_TARGET GLOBAL libgvc)
elseif (NOT (CMAKE_VERSION VERSION_LESS "3.11.0"))
pkg_check_modules(GVC IMPORTED_TARGET libgvc)
else()
pkg_check_modules(GVC libgvc)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${_module}
FOUND_VAR ${_module}_FOUND
REQUIRED_VARS GVC_INCLUDE_DIRS)
if (${GVC_FOUND})
if (CMAKE_VERSION VERSION_LESS "3.11.0")
add_library(${_module}::GVC INTERFACE IMPORTED)
set_target_properties(${_module}::GVC PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${GVC_INCLUDE_DIRS}")
set_target_properties(${_module}::GVC PROPERTIES
INTERFACE_LINK_LIBRARIES "${GVC_LIBRARIES}")
else()
add_library(${_module}::GVC ALIAS PkgConfig::GVC)
endif()
endif()
-68
View File
@@ -1,68 +0,0 @@
set(_module PySide2)
find_package(${_module} ${${_module}_FIND_VERSION} CONFIG QUIET)
set(_lib_target ${_module}::pyside2)
if(NOT ${_module}_FOUND)
include(PythonInfo)
find_python_site_packages(PYTHON_SITE_PACKAGES)
get_python_extension_suffix(PYTHON_EXTENSION_SUFFIX)
find_library(PYSIDE_LIBRARY
NAMES
"pyside2${PYTHON_EXTENSION_SUFFIX}"
"pyside2${PYTHON_EXTENSION_SUFFIX}.${${_module}_FIND_VERSION_MAJOR}.${${_module}_FIND_VERSION_MINOR}"
PATH_SUFFIXES "${PYTHON_SITE_PACKAGES}/PySide2")
find_path(PYSIDE_INCLUDE_DIR
pyside.h
PATH_SUFFIXES "${PYTHON_SITE_PACKAGES}/PySide2/include")
find_path(PYSIDE_TYPESYSTEMS
typesystem_core.xml
PATH_SUFFIXES "${PYTHON_SITE_PACKAGES}/PySide2/typesystems")
endif()
if(TARGET ${_lib_target})
get_target_property(_is_imported ${_lib_target} IMPORTED)
if(_is_imported)
get_target_property(_imported_location ${_lib_target} IMPORTED_LOCATION)
if(NOT _imported_location)
message(STATUS "Target ${_lib_target} does not specify its IMPORTED_LOCATION! Trying to find it ourselves...")
set(_find_args)
if(${_module}_CONFIG)
get_filename_component(_pyside2_lib_dir "${${_module}_CONFIG}/../../../" ABSOLUTE)
set(_find_args PATHS "${_pyside2_lib_dir}")
endif()
find_library(PYSIDE_LIBRARY
NAMES
"pyside2${PYTHON_CONFIG_SUFFIX}"
"pyside2${PYTHON_CONFIG_SUFFIX}.${${_module}_FIND_VERSION_MAJOR}.${${_module}_FIND_VERSION_MINOR}"
${_find_args})
if(NOT PYSIDE_LIBRARY)
set(_message_type WARNING)
if(${_module}_FIND_REQUIRED)
set(_message_type FATAL_ERROR)
endif()
message(${_message_type} "Failed to manually find library for ${_module}")
return()
endif()
message(STATUS "IMPORTED_LOCATION for ${_lib_target} found: ${PYSIDE_LIBRARY}")
set_target_properties(${_lib_target} PROPERTIES IMPORTED_LOCATION "${PYSIDE_LIBRARY}")
endif()
endif()
else()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${_module}
FOUND_VAR ${_module}_FOUND
REQUIRED_VARS PYSIDE_LIBRARY PYSIDE_INCLUDE_DIR PYSIDE_TYPESYSTEMS
VERSION_VAR ${_module}_VERSION)
add_library(${_module}::pyside2 INTERFACE IMPORTED)
set_target_properties(${_module}::pyside2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PYSIDE_INCLUDE_DIR}"
INTERFACE_LINK_LIBRARIES "${PYSIDE_LIBRARY}")
endif()
mark_as_advanced(PYSIDE_INCLUDE_DIR PYSIDE_LIBRARY PYSIDE_BINARY)
-120
View File
@@ -1,120 +0,0 @@
# - Find Radare2 (libr)
#
# This module provides the following imported targets, if found:
#
# Radare2::libr
#
# This will define the following variables:
# (but don't use them if you don't know what you are doing, use Radare2::libr)
#
# Radare2_FOUND - True if libr has been found.
# Radare2_INCLUDE_DIRS - libr include directory
# Radare2_LIBRARIES - List of libraries when using libr.
# Radare2_LIBRARY_DIRS - libr library directories
#
# If libr was found using find_library and not pkg-config, the following variables will also be set:
# Radare2_LIBRARY_<name> - Path to library r_<name>
if(WIN32)
find_path(Radare2_INCLUDE_DIRS
NAMES r_core.h r_bin.h r_util.h
HINTS
../r2_dist/include/libr
"$ENV{HOME}/bin/prefix/radare2/include/libr"
/usr/local/include/libr
/usr/include/libr)
find_path(SDB_INCLUDE_DIR
NAMES sdb.h sdbht.h sdb_version.h
HINTS
../r2_dist/include/libr/sdb
"$ENV{HOME}/bin/prefix/radare2/include/libr/sdb"
/usr/local/include/libr/sdb
/usr/include/libr/sdb)
list(APPEND Radare2_INCLUDE_DIRS ${SDB_INCLUDE_DIR})
set(Radare2_LIBRARY_NAMES
core
config
cons
io
util
flag
asm
debug
hash
bin
lang
io
anal
parse
bp
egg
reg
search
syscall
socket
fs
magic
crypto)
set(Radare2_LIBRARIES "")
set(Radare2_LIBRARIES_VARS "")
foreach(libname ${Radare2_LIBRARY_NAMES})
find_library(Radare2_LIBRARY_${libname}
r_${libname}
HINTS
../r2_dist/lib
"$ENV{HOME}/bin/prefix/radare2/lib"
/usr/local/lib
/usr/lib)
list(APPEND Radare2_LIBRARIES ${Radare2_LIBRARY_${libname}})
list(APPEND Radare2_LIBRARIES_VARS "Radare2_LIBRARY_${libname}")
endforeach()
set(Radare2_LIBRARY_DIRS "")
add_library(Radare2::libr UNKNOWN IMPORTED)
set_target_properties(Radare2::libr PROPERTIES
IMPORTED_LOCATION "${Radare2_LIBRARY_core}"
IMPORTED_LINK_INTERFACE_LIBRARIES "${Radare2_LIBRARIES}"
INTERFACE_LINK_DIRECTORIES "${Radare2_LIBRARY_DIRS}"
INTERFACE_INCLUDE_DIRECTORIES "${Radare2_INCLUDE_DIRS}")
set(Radare2_TARGET Radare2::libr)
else()
# support installation locations used by r2 scripts like sys/user.sh and sys/install.sh
if(IAITO_USE_ADDITIONAL_RADARE2_PATHS)
set(Radare2_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH})
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/bin/prefix/radare2") # sys/user.sh
list(APPEND CMAKE_PREFIX_PATH "/usr/local") # sys/install.sh
endif()
find_package(PkgConfig REQUIRED)
if(CMAKE_VERSION VERSION_LESS "3.6")
pkg_search_module(Radare2 REQUIRED r_core)
else()
pkg_search_module(Radare2 IMPORTED_TARGET REQUIRED r_core)
endif()
# reset CMAKE_PREFIX_PATH
if(IAITO_USE_ADDITIONAL_RADARE2_PATHS)
set(CMAKE_PREFIX_PATH ${Radare2_CMAKE_PREFIX_PATH_TEMP})
endif()
if((TARGET PkgConfig::Radare2) AND (NOT CMAKE_VERSION VERSION_LESS "3.11.0"))
set_target_properties(PkgConfig::Radare2 PROPERTIES IMPORTED_GLOBAL ON)
add_library(Radare2::libr ALIAS PkgConfig::Radare2)
set(Radare2_TARGET Radare2::libr)
elseif(Radare2_FOUND)
add_library(Radare2::libr INTERFACE IMPORTED)
set_target_properties(Radare2::libr PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${Radare2_INCLUDE_DIRS}")
set_target_properties(Radare2::libr PROPERTIES
INTERFACE_LINK_LIBRARIES "${Radare2_LIBRARIES}")
set(Radare2_TARGET Radare2::libr)
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Radare2 REQUIRED_VARS Radare2_TARGET Radare2_LIBRARIES Radare2_INCLUDE_DIRS)
-23
View File
@@ -1,23 +0,0 @@
set(IAITO_DIR_NAME "RadareOrg/iaito")
if(WIN32)
set(CMAKE_INSTALL_BINDIR "." CACHE PATH "Executable install directory")
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "Include install directory")
set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Library install directory")
set(CMAKE_INSTALL_DATAROOTDIR "./" CACHE PATH "Resource installation directory")
set(IAITO_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}" CACHE PATH "Resource installation directory")
elseif(APPLE)
if (IAITO_ENABLE_PACKAGING)
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "Include install directory")
set(CMAKE_INSTALL_LIBDIR "lib" CACHE PATH "Library install directory")
set(CMAKE_INSTALL_DATAROOTDIR "./" CACHE PATH "Resource installation directory")
set(CMAKE_INSTALL_BINDIR "../MacOS" CACHE PATH "Executable install directory") # BUNDLE step sets prefix to Resources
set(IAITO_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}" CACHE PATH "Resource installation directory")
else()
include(GNUInstallDirs)
set(IAITO_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}/${IAITO_DIR_NAME}" CACHE PATH "Resource installation directory")
endif()
else()
include(GNUInstallDirs)
set(IAITO_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}/${IAITO_DIR_NAME}" CACHE PATH "Resource installation directory")
endif()
set(ConfigPackageLocation "${CMAKE_INSTALL_LIBDIR}/iaito" CACHE PATH "Cmake file install location")
-69
View File
@@ -1,69 +0,0 @@
set(IAITO_DEPS "${CMAKE_CURRENT_SOURCE_DIR}/../cutter-deps")
if(WIN32)
set(CPACK_GENERATOR "ZIP")
if (IAITO_PACKAGE_DEPENDENCIES)
if (IAITO_ENABLE_PYTHON)
if (IAITO_ENABLE_DEPENDENCY_DOWNLOADS)
set(CPACK_INSTALL_SCRIPTS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/WindowsBundlePython.cmake)
endif()
find_package(PythonInterp REQUIRED)
install(DIRECTORY ${IAITO_DEPS}/pyside/lib/site-packages DESTINATION "python${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
install(FILES ${IAITO_DEPS}/pyside/bin/shiboken2.abi3.dll ${IAITO_DEPS}/pyside/bin/pyside2.abi3.dll DESTINATION .)
endif()
install(SCRIPT cmake/WindowsBundleQt.cmake)
endif()
if (IAITO_PACKAGE_R2GHIDRA)
if (IAITO_ENABLE_DEPENDENCY_DOWNLOADS)
# Currently using external project only for downloading source
# It neeeds to link against compiled iaito so for now build it using custom install script.
# That way r2ghidra build process is the same as with any other external plugin built against
# installed Iaito.
ExternalProject_Add(R2Ghidra
GIT_REPOSITORY https://github.com/radareorg/r2ghidra.git
GIT_TAG master
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
endif()
install(CODE "
execute_process(
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/R2Ghidra-prefix/src/R2Ghidra-build
RESULT_VARIABLE SCRIPT_RESULT
COMMAND \${CMAKE_COMMAND}
../R2Ghidra
-DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=\"\${CMAKE_INSTALL_PREFIX}\;\${CMAKE_INSTALL_PREFIX}/include/libr\;\${CMAKE_INSTALL_PREFIX}/include/libr/sdb\"
-DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX}
-DRADARE2_INSTALL_PLUGDIR=\${CMAKE_INSTALL_PREFIX}/lib/plugins
-DIAITO_INSTALL_PLUGDIR=plugins/native
-DBUILD_IAITO_PLUGIN=ON
-DBUILD_SLEIGH_PLUGIN=OFF
-G Ninja
)
if (SCRIPT_RESULT)
message(FATAL_ERROR \"Failed to configure r2ghidra\")
endif()
execute_process(WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/R2Ghidra-prefix/src/R2Ghidra-build
RESULT_VARIABLE SCRIPT_RESULT
COMMAND \${CMAKE_COMMAND} --build . --target install
)
if (SCRIPT_RESULT)
message(FATAL_ERROR \"Failed to install r2ghidra plugin\")
endif()
")
endif()
if (IAITO_PACKAGE_R2DEC AND IAITO_ENABLE_DEPENDENCY_DOWNLOADS)
install(CODE "
set(ENV{R_ALT_SRC_DIR} 1)
set(ENV{PATH} \"\${CMAKE_INSTALL_PREFIX};\$ENV{PATH}\")
execute_process(COMMAND powershell ../scripts/bundle_r2dec.ps1 \"\${CMAKE_INSTALL_PREFIX}\"
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
RESULT_VARIABLE SCRIPT_RESULT)
if (SCRIPT_RESULT)
message(FATAL_ERROR \"Failed to package r2dec\")
endif()
")
endif()
endif()
include(CPack)
-38
View File
@@ -1,38 +0,0 @@
function(find_python_site_packages VAR)
if(Python_SITELIB)
set("${VAR}" "${Python_SITELIB}" PARENT_SCOPE)
return()
endif()
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "if True:
from distutils import sysconfig
print(sysconfig.get_python_lib(prefix='', plat_specific=True))"
OUTPUT_VARIABLE "${VAR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
set("${VAR}" "${${VAR}}" PARENT_SCOPE)
endfunction()
function(get_python_extension_suffix VAR)
# from PySide2 CMakeLists.txt
# Result of imp.get_suffixes() depends on the platform, but generally looks something like:
# [('.cpython-34m-x86_64-linux-gnu.so', 'rb', 3), ('.cpython-34m.so', 'rb', 3),
# ('.abi3.so', 'rb', 3), ('.so', 'rb', 3), ('.py', 'r', 1), ('.pyc', 'rb', 2)]
# We pick the first most detailed one, strip of the file extension part.
execute_process(
COMMAND "${PYTHON_EXECUTABLE}" -c "if True:
import importlib.machinery, re
first_suffix = importlib.machinery.EXTENSION_SUFFIXES[0]
res = re.search(r'^(.+)\\.', first_suffix)
if res:
first_suffix = res.group(1)
else:
first_suffix = ''
print(first_suffix)
"
OUTPUT_VARIABLE "${VAR}"
OUTPUT_STRIP_TRAILING_WHITESPACE)
set("${VAR}" "${${VAR}}" PARENT_SCOPE)
endfunction()
-26
View File
@@ -1,26 +0,0 @@
# ------------------------
# QMakeConfigureFile.cmake
# ------------------------
function(_prepare_qmake_configure_file INPUT OUTPUT)
# copyonly configure once to trigger re-running cmake on changes
configure_file("${INPUT}" "${OUTPUT}.qmake.in" COPYONLY)
file(READ "${INPUT}" CONTENT)
# replace \" with "
string(REPLACE "\\\"" "\"" CONTENT "${CONTENT}")
# replace variables
string(REGEX REPLACE "\\\$\\\$([A-Za-z0-9_]+)" "\${\\1}" CONTENT "${CONTENT}")
string(REGEX REPLACE "\\\$\\\${([A-Za-z0-9_]+)}" "\${\\1}" CONTENT "${CONTENT}")
file(WRITE "${OUTPUT}.cmake.in" "${CONTENT}")
endfunction()
# qmake_configure_file(<INPUT> <OUTPUT>)
#
# like configure_file, but using qmake syntax
#
macro(qmake_configure_file INPUT OUTPUT)
_prepare_qmake_configure_file("${INPUT}" "${OUTPUT}")
configure_file("${OUTPUT}.cmake.in" "${OUTPUT}")
endmacro()
-49
View File
@@ -1,49 +0,0 @@
# -------------------
# QMakeProParse.cmake
# -------------------
#
# qmake project parsing utilities
#
# parse_qmake_pro(<PRO_FILE> <PREFIX>)
#
# parse qmake .pro file PRO_FILE and set cmake variables <PREFIX>_<VAR_NAME>
# to content of variable VAR_NAME in the .pro file.
#
# supported qmake syntax:
# - VARIABLE = values
# - VARIABLE += values
#
# not (yet) supported:
# - VARIABLE -= values
# - scopes
#
function(parse_qmake_pro PRO_FILE PREFIX)
file(READ ${PRO_FILE} PRO_CONTENT)
# concatenate lines with backslashes
string(REGEX REPLACE "\\\\\ *\n" "" PRO_CONTENT "${PRO_CONTENT}")
# separate lines
string(REGEX MATCHALL "[^\n]+(\n|$)" PRO_LINES "${PRO_CONTENT}")
foreach(LINE IN LISTS PRO_LINES)
string(STRIP "${LINE}" LINE)
# VARIABLE = some values ...
string(REGEX MATCH "^([a-zA-Z_]+)\ *=(.*)" VAR_SET "${LINE}")
if(CMAKE_MATCH_1)
separate_arguments(VALUES UNIX_COMMAND ${CMAKE_MATCH_2})
set(${PREFIX}_${CMAKE_MATCH_1} "${VALUES}" PARENT_SCOPE)
endif()
# VARIABLE += some values ...
string(REGEX MATCH "^([a-zA-Z_]+)\ *\\+=(.*)" VAR_SET "${LINE}")
if(CMAKE_MATCH_1)
separate_arguments(VALUES UNIX_COMMAND ${CMAKE_MATCH_2})
set(VAR_NAME ${PREFIX}_${CMAKE_MATCH_1})
set(${VAR_NAME} "${${VAR_NAME}}" "${VALUES}" PARENT_SCOPE)
endif()
endforeach()
endfunction()
-33
View File
@@ -1,33 +0,0 @@
set(TS_FILES
translations/ar/iaito_ar.ts
translations/ca/iaito_ca.ts
translations/de/iaito_de.ts
translations/es-ES/iaito_es.ts
translations/fa/iaito_fa.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/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
set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/translations)
find_package(Qt5LinguistTools REQUIRED)
qt5_add_translation(qmFiles ${TS_FILES})
add_custom_target(translations ALL DEPENDS ${qmFiles} SOURCES ${TS_FILES})
install(FILES
${qmFiles}
# For Linux it might be more correct to use ${MAKE_INSTALL_LOCALEDIR}, but that
# uses share/locale_name/software_name layout instead of share/software_name/locale_files.
DESTINATION ${IAITO_INSTALL_DATADIR}/translations
)
-6
View File
@@ -1,6 +0,0 @@
# Like option(), but the value can also be AUTO
macro(tri_option name desc default)
set("${name}" "${default}" CACHE STRING "${desc}")
set_property(CACHE "${name}" PROPERTY STRINGS AUTO ON OFF)
endmacro()
-6
View File
@@ -1,6 +0,0 @@
execute_process(COMMAND powershell "${CMAKE_CURRENT_LIST_DIR}/../../scripts/bundle_python.ps1" x64 "${CMAKE_INSTALL_PREFIX}"
WORKING_DIRECTORY ${CPACK_PACKAGE_DIRECTORY}
RESULT_VARIABLE SCRIPT_RESULT)
if (SCRIPT_RESULT)
message(FATAL_ERROR "Failed to bundle python")
endif()
-10
View File
@@ -1,10 +0,0 @@
message("Running windeployqt")
execute_process(COMMAND windeployqt iaito.exe
--plugindir "qtplugins"
--no-translations # iaito currently isn't loading Qt translation file
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
RESULT_VARIABLE SCRIPT_RESULT)
if (SCRIPT_RESULT)
message(FATAL_ERROR "Failed to bundle python")
endif()
file(WRITE "${CMAKE_INSTALL_PREFIX}/qt.conf" "[PATHS]\nPlugins = qtplugins")
-1
View File
@@ -1 +0,0 @@
include("${CMAKE_CURRENT_LIST_DIR}/iaitoTargets.cmake")
+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);
+12 -7
View File
@@ -43,7 +43,7 @@ const QHash<QString, ColorFlags> Configuration::relevantThemes = {
{ "twilight", DarkFlag },
{ "zenburn", DarkFlag },
// light themes
{ "cutter", LightFlag },
{ "iaito", LightFlag },
{ "dark", LightFlag },
{ "matrix", LightFlag },
{ "rasta", LightFlag },
@@ -51,7 +51,7 @@ const QHash<QString, ColorFlags> Configuration::relevantThemes = {
{ "white", LightFlag },
{ "white2", LightFlag }
};
static const QString DEFAULT_LIGHT_COLOR_THEME = "cutter";
static const QString DEFAULT_LIGHT_COLOR_THEME = "iaito";
static const QString DEFAULT_DARK_COLOR_THEME = "ayu";
@@ -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,9 +149,9 @@ static const QHash<QString, QVariant> asmOptions = {
{ "asm.marks", false },
{ "asm.refptr", false },
{ "asm.flags.real", true },
{ "asm.reloff", false },
{ "asm.reloff.flags", false },
{ "esil.breakoninvalid",true },
{ "asm.offset.relative",false },
{ "asm.offset.flags", false },
{ "esil.breakoninvalid",false },
{ "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;
@@ -743,7 +748,7 @@ void Configuration::setDecompilerAutoRefreshEnabled(bool enabled)
void Configuration::enableDecompilerAnnotationHighlighter(bool useDecompilerHighlighter)
{
s.setValue("decompilerAnnotationHighlighter", useDecompilerHighlighter);
s.setValue("decompilerAnnotationHighlighter", !useDecompilerHighlighter);
emit colorsUpdated();
}
+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;
Loaded 100 of 194 files, more files were not shown because too many files have changed in this diff. Show more