mirror of
https://github.com/radareorg/iaito.git
synced 2026-11-07 14:38:16 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc51d5fe16 | ||
|
|
b091a0902e | ||
|
|
e30f47f5de | ||
|
|
469f520b30 | ||
|
|
5ed77ef1bb | ||
|
|
37288d81a7 | ||
|
|
e6d52eed44 | ||
|
|
9b23f42a0a | ||
|
|
78bae22fb2 | ||
|
|
667aaff62d | ||
|
|
8a51ef8524 | ||
|
|
56bd22f4e3 | ||
|
|
2abcacb722 | ||
|
|
a727f93d0e | ||
|
|
272f0da513 | ||
|
|
64fecfbebb | ||
|
|
869998b58a | ||
|
|
f0cef8e4f5 | ||
|
|
2b47060190 | ||
|
|
eaba7bbdad | ||
|
|
beae7d7551 | ||
|
|
d7970177f3 | ||
|
|
cd7a2d08ca | ||
|
|
c3409ab251 | ||
|
|
18ac71a371 | ||
|
|
8ccd7d9dd5 | ||
|
|
c15b35c74f | ||
|
|
272a9da194 | ||
|
|
2cd5d0109c | ||
|
|
8b48ce96e1 | ||
|
|
108c605897 | ||
|
|
70be993cfd | ||
|
|
09d7d62632 | ||
|
|
534dfde000 | ||
|
|
75e4afe5ce | ||
|
|
c0eeba3cfc | ||
|
|
0976bf2aa8 | ||
|
|
b658b2bbc2 | ||
|
|
d934619abe | ||
|
|
d68207b59e | ||
|
|
672acd902b | ||
|
|
9735074c7c | ||
|
|
3b89622ba8 | ||
|
|
77be9b82c1 | ||
|
|
620ac0081f | ||
|
|
1a0a486c71 | ||
|
|
3feb7b2a93 | ||
|
|
d4ca777cbd | ||
|
|
9101519e26 | ||
|
|
1896d7ffec | ||
|
|
5871f6ea1c | ||
|
|
d7fe9272b8 | ||
|
|
40ee584fcf | ||
|
|
93a24b3ad0 | ||
|
|
661d273ab7 | ||
|
|
3aee0c3548 | ||
|
|
dd60c551cd | ||
|
|
1c984ae94b | ||
|
|
ddac25ee39 | ||
|
|
2fe18dead5 | ||
|
|
b16408049b | ||
|
|
110fa13b1d | ||
|
|
d911376774 | ||
|
|
3a246798b8 | ||
|
|
0de3f90b6c | ||
|
|
4c7e23e0a6 | ||
|
|
9b6bce7e58 | ||
|
|
9e3f9f6345 | ||
|
|
a1356fbdd9 | ||
|
|
d33a8dc7a2 | ||
|
|
e1b5e909c4 | ||
|
|
cbf7bc6a3d | ||
|
|
1ae192e48e | ||
|
|
0dc095ff71 | ||
|
|
e5277f39a1 | ||
|
|
e5444aa9e6 | ||
|
|
bbaa1abfe5 | ||
|
|
a101ba7167 | ||
|
|
33b32edb4a | ||
|
|
ecc7d05a05 | ||
|
|
3efbbc85ab | ||
|
|
7a3e617585 | ||
|
|
6767934906 | ||
|
|
85f757efb9 | ||
|
|
132ef13af6 | ||
|
|
4329e20359 | ||
|
|
6babbbdfe9 | ||
|
|
f7318c3033 | ||
|
|
80ff0a6f7b | ||
|
|
dfb48fcf0c | ||
|
|
3cd046fdd0 | ||
|
|
df65aa9aa6 | ||
|
|
5f9a0840cc | ||
|
|
805db97abd | ||
|
|
53afe35b12 | ||
|
|
01535f4add | ||
|
|
ecf6b96e0f | ||
|
|
77b005988b | ||
|
|
db2de36a4d | ||
|
|
c713c88749 | ||
|
|
7a32c6789b | ||
|
|
78522cca81 | ||
|
|
a50927e039 | ||
|
|
e821ddc1c8 | ||
|
|
7116de1a7e | ||
|
|
463dbccce4 | ||
|
|
0b8635565d | ||
|
|
5b9b68bc92 | ||
|
|
cbf1992d78 | ||
|
|
f799eaf0cd | ||
|
|
3c605a4480 | ||
|
|
6c66b28c1f | ||
|
|
876858458a | ||
|
|
d090071923 | ||
|
|
2c3b4588ef | ||
|
|
7fb52ccd4c | ||
|
|
b9c02025f5 | ||
|
|
e354190c31 | ||
|
|
6feb079005 | ||
|
|
cccaa3772a | ||
|
|
9ec1261ab9 | ||
|
|
e529aebeb7 | ||
|
|
a98efe0cfb | ||
|
|
269cbac239 | ||
|
|
f74826f047 | ||
|
|
a33a73009f | ||
|
|
e3cf502fe4 | ||
|
|
0764c4304a | ||
|
|
697543fcf9 | ||
|
|
16fe40f7ae | ||
|
|
c909eeecf6 | ||
|
|
148d77cf20 | ||
|
|
5472217f77 | ||
|
|
6e6d40ed7e | ||
|
|
32203ce9a0 | ||
|
|
69bce2f516 | ||
|
|
46a89eab47 | ||
|
|
f8652d9f62 | ||
|
|
960fdaa9c7 | ||
|
|
2e503d5a17 | ||
|
|
dfb16cf2ee | ||
|
|
7fbd28f918 | ||
|
|
b773f2b0c3 | ||
|
|
32cbe65a6a | ||
|
|
88227b6623 | ||
|
|
3721ec82fb | ||
|
|
5b7ae60d45 | ||
|
|
3890f557f2 | ||
|
|
2d78b57122 | ||
|
|
23d04633cd | ||
|
|
3cef6ddb48 | ||
|
|
2aa1788c47 | ||
|
|
1f2f8d2d9d | ||
|
|
1c1c21ca56 | ||
|
|
8677adc55f | ||
|
|
9790012e0b | ||
|
|
9159b74a24 | ||
|
|
f000631de3 | ||
|
|
881942a2da | ||
|
|
d2382f2277 | ||
|
|
65a1947cca | ||
|
|
765fce3cba | ||
|
|
449c68fb53 | ||
|
|
c8fb13aca7 | ||
|
|
1f9b0c2d69 | ||
|
|
1dd91e9816 | ||
|
|
ca5f2c49b1 | ||
|
|
0f6275c7d6 | ||
|
|
721886dffd | ||
|
|
d2f66434bd | ||
|
|
a20b38040f | ||
|
|
1ea689eeab | ||
|
|
aca7a39874 | ||
|
|
86ffdf1573 | ||
|
|
664010f73c | ||
|
|
6cc6b0ed89 | ||
|
|
4798d300c8 | ||
|
|
21945707ac | ||
|
|
4f368aede9 | ||
|
|
98927ba160 | ||
|
|
61251d240f | ||
|
|
c9caa6dd31 | ||
|
|
1c70bb035a | ||
|
|
da28e011a6 | ||
|
|
683f1547b2 | ||
|
|
d8c4119081 | ||
|
|
d44e7202c5 | ||
|
|
6715ad5a71 |
No files matched your search
@@ -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/.. -->
|
||||
@@ -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
@@ -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
|
||||
@@ -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
@@ -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
|
||||
@@ -1,3 +0,0 @@
|
||||
[submodule "src/translations"]
|
||||
path = src/translations
|
||||
url = https://github.com/radareorg/iaito-translations
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"ms-vscode.cpptools",
|
||||
"ms-vscode.cmake-tools",
|
||||
"twxs.cmake"
|
||||
]
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"cmake.sourceDirectory": "${workspaceFolder}/src",
|
||||
"cmake.configureSettings": {
|
||||
"IAITO_USE_BUNDLED_RADARE2": "ON"
|
||||
}
|
||||
}
|
||||
+16
-11
@@ -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.
|
||||
@@ -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
|
||||
@@ -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, ...
|
||||
|
||||
[](https://crowdin.com/project/iaito)
|
||||
[](https://github.com/radareorg/iaito/actions)
|
||||
[](https://repology.org/project/iaito/versions)
|
||||
|
||||

|
||||
|
||||

|
||||
## 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
@@ -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
|
||||
|
||||
@@ -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 ..
|
||||
@@ -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
@@ -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@
|
||||
@@ -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
@@ -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
@@ -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
|
||||
Vendored
-138
@@ -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)
|
||||
Vendored
+1
-1
@@ -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
@@ -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
|
||||
Vendored
+1
-2
@@ -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
|
||||
Vendored
+4
@@ -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:
|
||||
|
||||
Vendored
+40
-3
@@ -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
|
||||
|
||||
Vendored
+1
-2
@@ -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
@@ -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"]
|
||||
@@ -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
|
||||
@@ -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()
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/sh
|
||||
git submodule update --init
|
||||
+12
-11
@@ -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 |
@@ -1,6 +0,0 @@
|
||||
brew "p7zip"
|
||||
brew "ccache"
|
||||
brew "openssl"
|
||||
brew "xz"
|
||||
brew "llvm"
|
||||
brew "meson"
|
||||
@@ -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
|
||||
|
||||
@@ -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/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
@@ -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
|
||||
@@ -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")
|
||||
@@ -1,8 +1,10 @@
|
||||
# This script is deprecated and it is not going to work
|
||||
# But it's kept for future work towards supporting it again
|
||||
$dist = $args[0]
|
||||
$python = Split-Path((Get-Command python.exe).Path)
|
||||
|
||||
if (-not (Test-Path -Path 'r2dec-js' -PathType Container)) {
|
||||
git clone https://github.com/radareorg/r2dec-js.git --branch master --depth 1
|
||||
git clone https://github.com/wargio/r2dec-js.git --branch master --depth 1
|
||||
}
|
||||
cd r2dec-js
|
||||
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
||||
|
||||
@@ -1,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.
@@ -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.
@@ -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',
|
||||
],
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
@@ -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
@@ -1,4 +1,4 @@
|
||||
|
||||
#!/usr/bin/env python3
|
||||
import os
|
||||
import re
|
||||
|
||||
|
||||
Regular → Executable
+1
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import sys
|
||||
import re
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
@@ -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%
|
||||
@@ -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 ..
|
||||
@@ -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
|
||||
@@ -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 ../..
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Executable
+92
@@ -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>'
|
||||
@@ -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`
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include "core/MainWindow.h"
|
||||
|
||||
enum class AutomaticAnalysisLevel {
|
||||
Ask, None, AAA, AAAA
|
||||
Ask, None, AAA, AAAA, AAAAA
|
||||
};
|
||||
|
||||
struct IaitoCommandLineOptions {
|
||||
|
||||
+5
-3
@@ -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);
|
||||
}
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
@@ -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)
|
||||
@@ -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)
|
||||
@@ -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")
|
||||
@@ -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)
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -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()
|
||||
@@ -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()
|
||||
@@ -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 +0,0 @@
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/iaitoTargets.cmake")
|
||||
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
AddressableItemModelI::~AddressableItemModelI() {
|
||||
/* nothing to see */
|
||||
}
|
||||
|
||||
AddressableFilterProxyModel::AddressableFilterProxyModel(AddressableItemModelI *sourceModel,
|
||||
QObject *parent) :
|
||||
AddressableItemModel<QSortFilterProxyModel>(parent)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
@@ -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; }
|
||||
|
||||
@@ -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
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
Reference in new issue
Block a user