mirror of
https://github.com/rizinorg/cutter.git
synced 2024-11-23 04:49:49 +00:00
More R2/Radare -> Rizin renames (#2516)
This commit is contained in:
parent
58745547a2
commit
70cef2c1af
@ -6,20 +6,20 @@ There are different ways you can help contributing to Cutter:
|
||||
|
||||
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/cutter/issues/new/choose).
|
||||
You can create an issue by clicking on [this link](https://github.com/rizinorg/cutter/issues/new/choose).
|
||||
|
||||
## Contributing to the code
|
||||
|
||||
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/cutter/issues) or discuss with radareorg team.
|
||||
The best way is to check the opened issues [here](https://github.com/rizinorg/cutter/issues) or discuss with rizinorg team.
|
||||
Please follow our contribution guidelines: https://cutter.re/docs/contributing.html
|
||||
|
||||
## Contributing to the 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/cutter/tree/master/docs) folder.
|
||||
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/rizinorg/cutter/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/cutter/issues?q=is%3Aissue+is%3Aopen+label%3ADocumentation).
|
||||
Check issues marked as "Documentation" on our issues [list](https://github.com/rizinorg/cutter/issues?q=is%3Aissue+is%3Aopen+label%3ADocumentation).
|
||||
|
||||
## Translations
|
||||
|
||||
You can help Cutter by adding translations to the project! We use the [Crowdin](https://crowdin.com/project/cutter) 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.
|
||||
You can help Cutter by adding translations to the project! We use the [Crowdin](https://crowdin.com/project/cutter) 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 rizinorg developer.
|
||||
|
@ -20,4 +20,4 @@ If you have not received a reply to your email within 48 hours, or have not hear
|
||||
|
||||
**Important:** Don't disclose any information regarding the issue itself in the public chats.
|
||||
|
||||
Please note that the Cutter Security team isn't handling security issues on the radare2 repository.
|
||||
Please note that the Cutter Security team isn't handling security issues on the rizin repository.
|
||||
|
@ -10,7 +10,7 @@ IF !ERRORLEVEL! NEQ 0 (
|
||||
EXIT /B 1
|
||||
)
|
||||
|
||||
SET "R2DIST=r2_dist"
|
||||
SET "RZDIST=rz_dist"
|
||||
SET "BUILDDIR=build_%PLATFORM%"
|
||||
SET "BREAKPAD_SOURCE_DIR=%CD%\src\breakpad\src\src"
|
||||
|
||||
@ -36,10 +36,10 @@ IF !ERRORLEVEL! NEQ 0 EXIT /B 1
|
||||
ECHO Deploying cutter
|
||||
MKDIR cutter
|
||||
COPY release\cutter.exe cutter\cutter.exe
|
||||
XCOPY /S /I ..\%R2DIST%\share cutter\share
|
||||
XCOPY /S /I ..\%R2DIST%\lib cutter\lib
|
||||
XCOPY /S /I ..\%RZDIST%\share cutter\share
|
||||
XCOPY /S /I ..\%RZDIST%\lib cutter\lib
|
||||
DEL cutter\lib\*.lib
|
||||
COPY ..\%R2DIST%\bin\*.dll cutter\
|
||||
COPY ..\%RZDIST%\bin\*.dll cutter\
|
||||
windeployqt cutter\cutter.exe
|
||||
FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" cutter\translations
|
||||
|
||||
|
24
build.sh
24
build.sh
@ -10,12 +10,12 @@ BUILD="$(pwd)/build"
|
||||
QMAKE_CONF=$*
|
||||
ROOT_DIR=$(pwd)
|
||||
|
||||
check_r2() {
|
||||
r2 -v >/dev/null 2>&1
|
||||
check_rizin() {
|
||||
rizin -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
|
||||
RZCOMMIT=$(rizin -v | tail -n1 | sed "s,commit: \\(.*\\) build.*,\\1,")
|
||||
SUBMODULE=$(git submodule | grep "rizin" | awk '{print $1}')
|
||||
if [ "$RZCOMMIT" = "$SUBMODULE" ]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
@ -78,23 +78,23 @@ prepare_breakpad() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Build radare2
|
||||
check_r2
|
||||
# Build rizin
|
||||
check_rizin
|
||||
if [ $? -eq 1 ]; then
|
||||
printf "A (new?) version of radare2 will be installed. Do you agree? [Y/n] "
|
||||
printf "A (new?) version of rizin will be installed. Do you agree? [Y/n] "
|
||||
read -r answer
|
||||
if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
|
||||
R2PREFIX=${1:-"/usr"}
|
||||
RZPREFIX=${1:-"/usr"}
|
||||
git submodule init && git submodule update
|
||||
cd radare2 || exit 1
|
||||
./sys/install.sh "$R2PREFIX"
|
||||
cd rizin || exit 1
|
||||
./sys/install.sh "$RZPREFIX"
|
||||
cd ..
|
||||
else
|
||||
echo "Sorry but this script won't work otherwise. Read the README."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Correct radare2 version found, skipping..."
|
||||
echo "Correct rizin version found, skipping..."
|
||||
fi
|
||||
|
||||
# Create translations
|
||||
|
@ -59,7 +59,7 @@ if(WIN32)
|
||||
set(Rizin_LIBRARIES_VARS "")
|
||||
foreach(libname ${Rizin_LIBRARY_NAMES})
|
||||
find_library(Rizin_LIBRARY_${libname}
|
||||
r_${libname}
|
||||
rz_${libname}
|
||||
HINTS
|
||||
"$ENV{HOME}/bin/prefix/rizin/lib"
|
||||
/usr/local/lib
|
||||
@ -79,7 +79,7 @@ if(WIN32)
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${Rizin_INCLUDE_DIRS}")
|
||||
set(Rizin_TARGET Rizin::librz)
|
||||
else()
|
||||
# support installation locations used by r2 scripts like sys/user.sh and sys/install.sh
|
||||
# support installation locations used by rizin scripts like sys/user.sh and sys/install.sh
|
||||
if(CUTTER_USE_ADDITIONAL_RIZIN_PATHS)
|
||||
set(Rizin_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH})
|
||||
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/bin/prefix/rizin") # sys/user.sh
|
||||
|
2
dist/bundle_r2dec.ps1
vendored
2
dist/bundle_r2dec.ps1
vendored
@ -2,7 +2,7 @@ $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/rizinorg/r2dec-js.git --branch master --depth 1
|
||||
}
|
||||
cd r2dec-js
|
||||
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
||||
|
@ -21,7 +21,7 @@ RUN apk add --no-cache \
|
||||
wget
|
||||
|
||||
# Get, compile and test Cutter from master branch
|
||||
RUN git clone --recurse-submodules https://github.com/radareorg/cutter.git /opt/cutter
|
||||
RUN git clone --recurse-submodules https://github.com/rizinorg/cutter.git /opt/cutter
|
||||
RUN cd /opt/cutter && \
|
||||
bash build.sh && \
|
||||
bash -c 'if [[ ! -x "/opt/cutter/build/Cutter" ]]; then exit -1; fi'
|
||||
@ -38,25 +38,25 @@ RUN apk add --no-cache \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
# Get the compiled Cutter, r2 libs and bins from the builder
|
||||
# Get the compiled Cutter, rizin libs and bins from the builder
|
||||
COPY --from=builder /opt/cutter /opt/cutter
|
||||
COPY --from=builder /usr/lib /usr/lib
|
||||
COPY --from=builder /usr/share/radare2 /usr/share/radare2
|
||||
RUN cd /opt/cutter/radare2/binr && \
|
||||
COPY --from=builder /usr/share/rizin /usr/share/rizin
|
||||
RUN cd /opt/cutter/rizin/binr && \
|
||||
make install && \
|
||||
make symstall install-symlink
|
||||
|
||||
# Add r2 user
|
||||
RUN useradd r2
|
||||
# Add rizin user
|
||||
RUN useradd rizin
|
||||
|
||||
# Prepare files to mount configurations later on
|
||||
RUN mkdir /var/sharedFolder && \
|
||||
mkdir -p /home/r2/.config/radare2 && \
|
||||
touch /home/r2/.radare2rc && \
|
||||
chown -R r2:r2 /var/sharedFolder && \
|
||||
chown -R r2:r2 /home/r2/
|
||||
mkdir -p /home/rizin/.config/rizin && \
|
||||
touch /home/rizin/.rizinrc && \
|
||||
chown -R rizin:rizin /var/sharedFolder && \
|
||||
chown -R rizin:rizin /home/rizin/
|
||||
|
||||
WORKDIR /home/r2
|
||||
WORKDIR /home/rizin
|
||||
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
|
@ -22,12 +22,12 @@ RUN apk add --no-cache \
|
||||
unzip \
|
||||
wget
|
||||
|
||||
# install radare2 first
|
||||
COPY docker/build_radare2.sh /opt/cutter/
|
||||
COPY radare2 /opt/cutter/radare2
|
||||
# install rizin first
|
||||
COPY docker/build_rizin.sh /opt/cutter/
|
||||
COPY rizin /opt/cutter/rizin
|
||||
|
||||
WORKDIR /opt/cutter
|
||||
RUN bash build_radare2.sh
|
||||
RUN bash build_rizin.sh
|
||||
|
||||
COPY docker/build_cutter.sh /opt/cutter/
|
||||
COPY scripts /opt/cutter/scripts
|
||||
@ -49,22 +49,22 @@ RUN apk add --no-cache \
|
||||
shadow \
|
||||
su-exec
|
||||
|
||||
# Add r2 user
|
||||
RUN useradd r2
|
||||
# Add rizin user
|
||||
RUN useradd rizin
|
||||
|
||||
# Prepare files to mount configurations later on
|
||||
RUN mkdir /var/sharedFolder && \
|
||||
mkdir -p /home/r2/.config/radare2 && \
|
||||
touch /home/r2/.radare2rc && \
|
||||
chown -R r2:r2 /var/sharedFolder && \
|
||||
chown -R r2:r2 /home/r2/
|
||||
mkdir -p /home/rizin/.config/rizin && \
|
||||
touch /home/rizin/.rizinrc && \
|
||||
chown -R rizin:rizin /var/sharedFolder && \
|
||||
chown -R rizin:rizin /home/rizin/
|
||||
|
||||
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
|
||||
# Get the compiled Cutter, r2 libs and bins from the builder
|
||||
# Get the compiled Cutter, rizin libs and bins from the builder
|
||||
COPY --from=builder /opt/cutter /opt/cutter
|
||||
COPY --from=builder /usr/lib /usr/lib
|
||||
COPY --from=builder /usr/share/radare2 /usr/share/radare2
|
||||
WORKDIR /opt/cutter/radare2/binr
|
||||
COPY --from=builder /usr/share/rizin /usr/share/rizin
|
||||
WORKDIR /opt/cutter/rizin/binrz
|
||||
RUN make install && \
|
||||
make symstall install-symlink
|
||||
|
@ -9,12 +9,12 @@ LGID := $(shell id -g)
|
||||
|
||||
# To mount a specific binary using BINARY=/absolute/path/to/binary
|
||||
ifdef BINARY
|
||||
MOUNTFLAGS += -v $(BINARY):/home/r2/$(shell basename $(BINARY)):ro
|
||||
RUNFLAGS += /home/r2/$(shell basename $(BINARY))
|
||||
MOUNTFLAGS += -v $(BINARY):/home/rizin/$(shell basename $(BINARY)):ro
|
||||
RUNFLAGS += /home/rizin/$(shell basename $(BINARY))
|
||||
endif
|
||||
|
||||
VERSION ?= latest
|
||||
IMAGE_NAME ?= radareorg/cutter
|
||||
IMAGE_NAME ?= rizinorg/cutter
|
||||
CONTAINER_NAME ?= cutter
|
||||
|
||||
LOCAL_DEV ?= n
|
||||
@ -37,11 +37,11 @@ build-nc: ## Build the container without caching
|
||||
|
||||
run: ## Run container
|
||||
XSOCK=/tmp/.X11-unix && \
|
||||
XAUTH=$(shell mktemp /tmp/r2cutter_tmp.XXX.xauth) && \
|
||||
XAUTH=$(shell mktemp /tmp/rzcutter_tmp.XXX.xauth) && \
|
||||
xauth nlist $$DISPLAY | sed -e 's/^..../ffff/' | xauth -f $$XAUTH nmerge - && \
|
||||
chmod 644 $$XAUTH && \
|
||||
touch $(DIR)/radare2rc && \
|
||||
mkdir -p $(DIR)/r2-config && \
|
||||
touch $(DIR)/rizinrc && \
|
||||
mkdir -p $(DIR)/rizin-config && \
|
||||
mkdir -p $(DIR)/sharedFolder && \
|
||||
sudo docker run \
|
||||
-it \
|
||||
@ -55,8 +55,8 @@ run: ## Run container
|
||||
-v $$XAUTH:$$XAUTH \
|
||||
$(MOUNTFLAGS) \
|
||||
-v $(DIR)/sharedFolder:/var/sharedFolder \
|
||||
-v $(DIR)/radare2rc:/home/r2/.radare2rc \
|
||||
-v $(DIR)/r2-config:/home/r2/.config/radare2 \
|
||||
-v $(DIR)/rizinrc:/home/rizin/.rizinrc \
|
||||
-v $(DIR)/rizin-config:/home/rizin/.config/rizin \
|
||||
$(IMAGE_NAME):$(VERSION) $(RUNFLAGS) && \
|
||||
rm $$XAUTH
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
# Docker Configuration for Cutter
|
||||
|
||||
These files provide an easy way to deploy *Cutter* in a Docker container. After additional configuration you may want to apply to the `Makefile`, execute `make run`. By default, the *Cutter* image on [Docker Hub](https://hub.docker.com/r/radareorg/cutter/) will be used along with additional UID, capability, X and mount settings:
|
||||
These files provide an easy way to deploy *Cutter* in a Docker container. After additional configuration you may want to apply to the `Makefile`, execute `make run`. By default, the *Cutter* image on [Docker Hub](https://hub.docker.com/r/rizinorg/cutter/) will be used along with additional UID, capability, X and mount settings:
|
||||
|
||||
- Xauthority settings which avoid using potentially insecure `xhost` directives. The settings have been adapted from [this post](https://stackoverflow.com/questions/16296753/can-you-run-gui-apps-in-a-docker-container/25280523#25280523).
|
||||
- Mount directives to mount a shared folder and radare2 configuration files.
|
||||
- Mount directives to mount a shared folder and rizin configuration files.
|
||||
- The UID and GID of the user executing `make run` will also be used for the internal container user to avoid permission problems when sharing files.
|
||||
|
||||
## Using Local Files
|
||||
@ -16,5 +16,5 @@ The `Makefile` allows mounting a single binary file as read-only, which will als
|
||||
|
||||
## Additional Notes
|
||||
|
||||
- The internal container user doesn't use superuser privileges and is called `r2`.
|
||||
- The internal container user doesn't use superuser privileges and is called `rizin`.
|
||||
- To check for more options of the `Makefile`, execute `make`.
|
||||
|
@ -1,32 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
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
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build radare2
|
||||
check_r2
|
||||
if [ $? -eq 1 ]; then
|
||||
printf "A (new?) version of radare2 will be installed. Do you agree? [Y/n] "
|
||||
read -r answer
|
||||
if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
|
||||
R2PREFIX=${1:-"/usr"}
|
||||
git submodule init && git submodule update
|
||||
cd radare2 || exit 1
|
||||
./sys/install.sh "$R2PREFIX"
|
||||
cd ..
|
||||
else
|
||||
echo "Sorry but this script won't work otherwise. Read the README."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Correct radare2 version found, skipping..."
|
||||
fi
|
32
docker/build_rizin.sh
Executable file
32
docker/build_rizin.sh
Executable file
@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
check_rizin() {
|
||||
rizin -v >/dev/null 2>&1
|
||||
if [ $? = 0 ]; then
|
||||
RZCOMMIT=$(rizin -v | tail -n1 | sed "s,commit: \\(.*\\) build.*,\\1,")
|
||||
SUBMODULE=$(git submodule | grep "rizin" | awk '{print $1}')
|
||||
if [ "$RZCOMMIT" = "$SUBMODULE" ]; then
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
# Build rizin
|
||||
check_rizin
|
||||
if [ $? -eq 1 ]; then
|
||||
printf "A (new?) version of rizin will be installed. Do you agree? [Y/n] "
|
||||
read -r answer
|
||||
if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
|
||||
RZPREFIX=${1:-"/usr"}
|
||||
git submodule init && git submodule update
|
||||
cd rizin || exit 1
|
||||
./sys/install.sh "$RZPREFIX"
|
||||
cd ..
|
||||
else
|
||||
echo "Sorry but this script won't work otherwise. Read the README."
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "Correct rizin version found, skipping..."
|
||||
fi
|
@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
USERNAME="r2"
|
||||
USERNAME="rizin"
|
||||
|
||||
echo "Cutter: Starting with UID:GID $LOCAL_USER_ID:$LOCAL_GROUP_ID"
|
||||
usermod -u $LOCAL_USER_ID $USERNAME
|
||||
|
@ -70,12 +70,12 @@ Options
|
||||
|
||||
.. option:: --no-plugins
|
||||
|
||||
Start cutter with all plugins disabled. Implies :option:`--no-cutter-plugins` and :option:`--no-r2-plugins`.
|
||||
Start cutter with all plugins disabled. Implies :option:`--no-cutter-plugins` and :option:`--no-rizin-plugins`.
|
||||
|
||||
.. option:: --no-cutter-plugins
|
||||
|
||||
Start cutter with cutter plugins disabled.
|
||||
|
||||
.. option:: --no-r2-plugins
|
||||
.. option:: --no-rizin-plugins
|
||||
|
||||
Start cutter with r2 plugins disabled.
|
||||
Start cutter with rizin plugins disabled.
|
||||
|
@ -2,7 +2,7 @@ Features
|
||||
========
|
||||
This section in the user docs gives a more detailed information about different features in Cutter. These are the different
|
||||
utilities and views that can be used and controlled by you during your session. As more familiar and comfort you feel with the
|
||||
different features in Cutter, the more efficient and effective you are during your reverse-engineering experience.
|
||||
different features in Cutter, the more efficient and effective you are during your reverse-engineering experience.
|
||||
|
||||
Decompiler
|
||||
----------
|
||||
@ -16,4 +16,4 @@ Here's an image that compares one of the decompiler Cutter supports with the Cut
|
||||
Cutter provides an interface that supports plugins of multiple decompilers including Ghidra, RetDec and R2Dec. The interface receives data from the decompiler and presenting the decompiler code in a context-sensitive decompiler widget. Check the `Decompilers <https://github.com/rizinorg/cutter-plugins#decompilers>`_ section on our Plugins repository to know more about the decompilers we support.
|
||||
|
||||
|
||||
Out of the decompiler plugins that we support, the one that's officially maintained by the developers of Cutter is R2Ghidra. :doc:`Click here <menus/decompiler-context-menu>` to learn more about the functionalities we provide in the decompiler.
|
||||
Out of the decompiler plugins that we support, the one that's officially maintained by the developers of Cutter is RzGhidra. :doc:`Click here <menus/decompiler-context-menu>` to learn more about the functionalities we provide in the decompiler.
|
||||
|
@ -7,7 +7,7 @@ cutter_commit="$(git show -s --format="%H %s")"
|
||||
|
||||
echo "Cloning current cutter.re"
|
||||
|
||||
git clone --depth 1 git@github.com:radareorg/cutter.re.git || exit 1
|
||||
git clone --depth 1 git@github.com:rizinorg/cutter.re.git || exit 1
|
||||
|
||||
echo "Updating docs"
|
||||
|
||||
@ -25,6 +25,6 @@ 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 -
|
||||
printf "Update docs from rizinorg/cutter\n\nOriginal Commit:\n$cutter_commit" | git commit -F -
|
||||
git push origin master || exit 1
|
||||
|
||||
|
@ -27,6 +27,6 @@ git add Translations.ts
|
||||
git commit -m "Updated translations"
|
||||
log "Pushing..."
|
||||
export GIT_SSH_COMMAND="/usr/bin/ssh -i $TRAVIS_BUILD_DIR/scripts/deploy_translations_rsa"
|
||||
git push "git@github.com:radareorg/cutter-translations.git" HEAD:refs/heads/master
|
||||
git push "git@github.com:rizinorg/cutter-translations.git" HEAD:refs/heads/master
|
||||
|
||||
log "Script done!"
|
||||
|
@ -5,15 +5,15 @@ mkdir -p cutter-deps && cd cutter-deps
|
||||
|
||||
LINUX_FILE="cutter-deps-linux.tar.gz"
|
||||
LINUX_MD5=31fd19443a3405d6b6097cbbd4c11fba
|
||||
LINUX_URL=https://github.com/radareorg/cutter-deps/releases/download/v12/cutter-deps-linux.tar.gz
|
||||
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/radareorg/cutter-deps/releases/download/v12/cutter-deps-macos.tar.gz
|
||||
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/radareorg/cutter-deps/releases/download/v12/cutter-deps-win.tar.gz
|
||||
WIN_URL=https://github.com/rizinorg/cutter-deps/releases/download/v12/cutter-deps-win.tar.gz
|
||||
|
||||
if [ "$OS" == "Windows_NT" ]; then
|
||||
FILE="${WIN_FILE}"
|
||||
|
@ -13,7 +13,7 @@ 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
|
||||
# Patch for https://github.com/rizinorg/cutter/issues/424
|
||||
sed -i ".original" "s/#define HAVE_GETENTROPY 1/#define HAVE_GETENTROPY 0/" pyconfig.h
|
||||
|
||||
make -j4 || exit 1
|
||||
|
@ -7,7 +7,7 @@ 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
|
||||
git clone https://github.com/rizinorg/r2dec-js.git --depth 1 --branch master
|
||||
#cd r2dec-js
|
||||
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
|
||||
#cd ..
|
||||
@ -16,7 +16,7 @@ fi
|
||||
cd r2dec-js
|
||||
rm -rf build
|
||||
mkdir build && cd build
|
||||
meson --buildtype=release --libdir=share/radare2/plugins --datadir=share/radare2/plugins "$@" ../p
|
||||
meson --buildtype=release --libdir=share/rizin/plugins --datadir=share/rizin/plugins "$@" ../p
|
||||
ninja
|
||||
ninja install
|
||||
|
||||
|
@ -15,7 +15,7 @@ else:
|
||||
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()
|
||||
json = requests.get("https://api.github.com/repos/rizinorg/cutter-deps/releases/latest").json()
|
||||
|
||||
release_url = json["assets"][0]["browser_download_url"]
|
||||
for platform in platforms:
|
||||
|
@ -176,7 +176,7 @@ endforeach()
|
||||
if(UNIX AND NOT APPLE)
|
||||
install (FILES "img/cutter.svg"
|
||||
DESTINATION "share/icons/hicolor/scalable/apps/")
|
||||
install(FILES "org.radare.Cutter.desktop"
|
||||
install(FILES "org.rizin.Cutter.desktop"
|
||||
DESTINATION "share/applications"
|
||||
COMPONENT Devel)
|
||||
endif()
|
||||
|
@ -54,14 +54,14 @@ equals(CUTTER_ENABLE_PYTHON, true) {
|
||||
}
|
||||
}
|
||||
|
||||
!defined(CUTTER_BUNDLE_R2_APPBUNDLE, var) CUTTER_BUNDLE_R2_APPBUNDLE=false
|
||||
equals(CUTTER_BUNDLE_R2_APPBUNDLE, true) CONFIG += CUTTER_BUNDLE_R2_APPBUNDLE
|
||||
!defined(CUTTER_BUNDLE_RZ_APPBUNDLE, var) CUTTER_BUNDLE_RZ_APPBUNDLE=false
|
||||
equals(CUTTER_BUNDLE_RZ_APPBUNDLE, true) CONFIG += CUTTER_BUNDLE_RZ_APPBUNDLE
|
||||
|
||||
!defined(CUTTER_APPVEYOR_R2DEC, var) CUTTER_APPVEYOR_R2DEC=false
|
||||
equals(CUTTER_APPVEYOR_R2DEC, true) CONFIG += CUTTER_APPVEYOR_R2DEC
|
||||
|
||||
!defined(CUTTER_R2GHIDRA_STATIC, var) CUTTER_R2GHIDRA_STATIC=false
|
||||
equals(CUTTER_R2GHIDRA_STATIC, true) CONFIG += CUTTER_R2GHIDRA_STATIC
|
||||
!defined(CUTTER_RZGHIDRA_STATIC, var) CUTTER_RZGHIDRA_STATIC=false
|
||||
equals(CUTTER_RZGHIDRA_STATIC, true) CONFIG += CUTTER_RZGHIDRA_STATIC
|
||||
|
||||
DEFINES += CUTTER_SOURCE_BUILD
|
||||
|
||||
@ -108,7 +108,7 @@ win32 {
|
||||
|
||||
macx {
|
||||
QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc++
|
||||
QMAKE_TARGET_BUNDLE_PREFIX = org.radare
|
||||
QMAKE_TARGET_BUNDLE_PREFIX = org.rizin
|
||||
QMAKE_BUNDLE = cutter
|
||||
QMAKE_INFO_PLIST = macos/Info.plist
|
||||
}
|
||||
@ -122,7 +122,7 @@ unix {
|
||||
}
|
||||
|
||||
# Libraries
|
||||
include(lib_radare2.pri)
|
||||
include(lib_rizin.pri)
|
||||
|
||||
!win32 {
|
||||
CONFIG += link_pkgconfig
|
||||
@ -171,7 +171,7 @@ CUTTER_ENABLE_PYTHON {
|
||||
"$$[QT_INSTALL_HEADERS]/QtCore" \
|
||||
"$$[QT_INSTALL_HEADERS]/QtWidgets" \
|
||||
"$$[QT_INSTALL_HEADERS]/QtGui"
|
||||
for (path, R2_INCLUDEPATH) {
|
||||
for (path, RZ_INCLUDEPATH) {
|
||||
BINDINGS_INCLUDE_DIRS += "$$path"
|
||||
}
|
||||
for(path, INCLUDEPATH) {
|
||||
@ -278,8 +278,8 @@ QMAKE_CXXFLAGS += -g
|
||||
}
|
||||
}
|
||||
|
||||
macx:CUTTER_BUNDLE_R2_APPBUNDLE {
|
||||
message("Using r2 rom AppBundle")
|
||||
macx:CUTTER_BUNDLE_RZ_APPBUNDLE {
|
||||
message("Using rizin rom AppBundle")
|
||||
DEFINES += MACOS_RZ_BUNDLED
|
||||
}
|
||||
|
||||
@ -288,13 +288,13 @@ CUTTER_APPVEYOR_R2DEC {
|
||||
DEFINES += CUTTER_APPVEYOR_R2DEC
|
||||
}
|
||||
|
||||
CUTTER_R2GHIDRA_STATIC {
|
||||
message("Building with static r2ghidra support")
|
||||
DEFINES += CUTTER_R2GHIDRA_STATIC
|
||||
SOURCES += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.cpp
|
||||
HEADERS += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.h
|
||||
INCLUDEPATH += $$R2GHIDRA_SOURCE/cutter-plugin
|
||||
LIBS += -L$$R2GHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp
|
||||
CUTTER_RZGHIDRA_STATIC {
|
||||
message("Building with static rz-ghidra support")
|
||||
DEFINES += CUTTER_RZGHIDRA_STATIC
|
||||
SOURCES += $$RZGHIDRA_SOURCE/cutter-plugin/RzGhidraDecompiler.cpp
|
||||
HEADERS += $$RZGHIDRA_SOURCE/cutter-plugin/RzGhidraDecompiler.h
|
||||
INCLUDEPATH += $$RZGHIDRA_SOURCE/cutter-plugin
|
||||
LIBS += -L$$RZGHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp
|
||||
QMAKE_LFLAGS += /delayload:core_ghidra.dll
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ SOURCES += \
|
||||
widgets/SearchWidget.cpp \
|
||||
CutterApplication.cpp \
|
||||
common/PythonAPI.cpp \
|
||||
dialogs/R2PluginsDialog.cpp \
|
||||
dialogs/RizinPluginsDialog.cpp \
|
||||
widgets/CutterDockWidget.cpp \
|
||||
widgets/CutterTreeWidget.cpp \
|
||||
widgets/GraphWidget.cpp \
|
||||
@ -439,7 +439,7 @@ SOURCES += \
|
||||
common/ResourcePaths.cpp \
|
||||
widgets/CutterGraphView.cpp \
|
||||
widgets/SimpleTextGraphView.cpp \
|
||||
widgets/R2GraphWidget.cpp \
|
||||
widgets/RizinGraphWidget.cpp \
|
||||
widgets/CallGraph.cpp \
|
||||
widgets/AddressableDockWidget.cpp \
|
||||
dialogs/preferences/AnalOptionsWidget.cpp \
|
||||
@ -514,7 +514,7 @@ HEADERS += \
|
||||
widgets/HeadersWidget.h \
|
||||
widgets/SearchWidget.h \
|
||||
common/PythonAPI.h \
|
||||
dialogs/R2PluginsDialog.h \
|
||||
dialogs/RizinPluginsDialog.h \
|
||||
widgets/CutterDockWidget.h \
|
||||
widgets/CutterTreeWidget.h \
|
||||
widgets/GraphWidget.h \
|
||||
@ -598,7 +598,7 @@ HEADERS += \
|
||||
common/ResourcePaths.h \
|
||||
widgets/CutterGraphView.h \
|
||||
widgets/SimpleTextGraphView.h \
|
||||
widgets/R2GraphWidget.h \
|
||||
widgets/RizinGraphWidget.h \
|
||||
widgets/CallGraph.h \
|
||||
widgets/AddressableDockWidget.h \
|
||||
dialogs/preferences/AnalOptionsWidget.h \
|
||||
@ -639,7 +639,7 @@ FORMS += \
|
||||
widgets/VTablesWidget.ui \
|
||||
widgets/TypesWidget.ui \
|
||||
widgets/SearchWidget.ui \
|
||||
dialogs/R2PluginsDialog.ui \
|
||||
dialogs/RizinPluginsDialog.ui \
|
||||
dialogs/VersionInfoDialog.ui \
|
||||
widgets/ZignaturesWidget.ui \
|
||||
dialogs/AsyncTaskDialog.ui \
|
||||
@ -669,7 +669,7 @@ FORMS += \
|
||||
dialogs/preferences/ColorThemeEditDialog.ui \
|
||||
widgets/ListDockWidget.ui \
|
||||
dialogs/LayoutManager.ui \
|
||||
widgets/R2GraphWidget.ui \
|
||||
widgets/RizinGraphWidget.ui \
|
||||
dialogs/preferences/AnalOptionsWidget.ui
|
||||
|
||||
RESOURCES += \
|
||||
@ -694,12 +694,12 @@ unix {
|
||||
share_pixmaps.files = $$icon_file
|
||||
|
||||
|
||||
desktop_file = org.radare.Cutter.desktop
|
||||
desktop_file = org.rizin.Cutter.desktop
|
||||
|
||||
share_applications.path = $$PREFIX/share/applications
|
||||
share_applications.files = $$desktop_file
|
||||
|
||||
appstream_file = org.radare.Cutter.appdata.xml
|
||||
appstream_file = org.rizin.Cutter.appdata.xml
|
||||
|
||||
# Used by ???
|
||||
share_appdata.path = $$PREFIX/share/appdata
|
||||
|
@ -26,8 +26,8 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#if CUTTER_R2GHIDRA_STATIC
|
||||
#include <R2GhidraDecompiler.h>
|
||||
#if CUTTER_RZGHIDRA_STATIC
|
||||
#include <RzGhidraDecompiler.h>
|
||||
#endif
|
||||
|
||||
CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv)
|
||||
@ -103,7 +103,7 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
||||
qputenv("R_ALT_SRC_DIR", "1");
|
||||
#endif
|
||||
|
||||
Core()->initialize(clOptions.enableR2Plugins);
|
||||
Core()->initialize(clOptions.enableRizinPlugins);
|
||||
Core()->setSettings();
|
||||
Config()->loadInitial();
|
||||
Core()->loadCutterRC();
|
||||
@ -114,8 +114,8 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
||||
Core()->registerDecompiler(new R2DecDecompiler(Core()));
|
||||
}
|
||||
|
||||
#if CUTTER_R2GHIDRA_STATIC
|
||||
Core()->registerDecompiler(new R2GhidraDecompiler(Core()));
|
||||
#if CUTTER_RZGHIDRA_STATIC
|
||||
Core()->registerDecompiler(new RzGhidraDecompiler(Core()));
|
||||
#endif
|
||||
|
||||
Plugins()->loadPlugins(clOptions.enableCutterPlugins);
|
||||
@ -164,14 +164,14 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
|
||||
{
|
||||
auto rzprefix = QDir(QCoreApplication::applicationDirPath()); // Contents/MacOS
|
||||
rzprefix.cdUp(); // Contents
|
||||
rzprefix.cd("Resources"); // Contents/Resources/r2
|
||||
rzprefix.cd("Resources"); // Contents/Resources/rz
|
||||
|
||||
auto sleighHome = rzprefix;
|
||||
sleighHome.cd("share/rizin/plugins/rz_ghidra_sleigh"); // Contents/Resources/r2/share/rizin/plugins/rz_ghidra_sleigh
|
||||
sleighHome.cd("share/rizin/plugins/rz_ghidra_sleigh"); // Contents/Resources/rz/share/rizin/plugins/rz_ghidra_sleigh
|
||||
Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());
|
||||
|
||||
auto r2decHome = rzprefix;
|
||||
r2decHome.cd("share/rizin/plugins/r2dec-js"); // Contents/Resources/r2/share/rizin/plugins/r2dec-js
|
||||
r2decHome.cd("share/rizin/plugins/r2dec-js"); // Contents/Resources/rz/share/rizin/plugins/r2dec-js
|
||||
qputenv("R2DEC_HOME", r2decHome.absolutePath().toLocal8Bit());
|
||||
}
|
||||
#endif
|
||||
@ -205,8 +205,8 @@ void CutterApplication::launchNewInstance(const QStringList &args)
|
||||
if (!clOptions.enableCutterPlugins) {
|
||||
allArgs.push_back("--no-cutter-plugins");
|
||||
}
|
||||
if (!clOptions.enableR2Plugins) {
|
||||
allArgs.push_back("--no-r2-plugins");
|
||||
if (!clOptions.enableRizinPlugins) {
|
||||
allArgs.push_back("--no-rizin-plugins");
|
||||
}
|
||||
allArgs.append(args);
|
||||
process.startDetached(qApp->applicationFilePath(), allArgs);
|
||||
@ -351,9 +351,9 @@ bool CutterApplication::parseCommandLineOptions()
|
||||
QObject::tr("Do not load Cutter plugins"));
|
||||
cmd_parser.addOption(disableCutterPlugins);
|
||||
|
||||
QCommandLineOption disableR2Plugins("no-r2-plugins",
|
||||
QCommandLineOption disableRizinPlugins("no-rizin-plugins",
|
||||
QObject::tr("Do not load rizin plugins"));
|
||||
cmd_parser.addOption(disableR2Plugins);
|
||||
cmd_parser.addOption(disableRizinPlugins);
|
||||
|
||||
cmd_parser.process(*this);
|
||||
|
||||
@ -424,15 +424,15 @@ bool CutterApplication::parseCommandLineOptions()
|
||||
opts.outputRedirectionEnabled = !cmd_parser.isSet(disableRedirectOption);
|
||||
if (cmd_parser.isSet(disablePlugins)) {
|
||||
opts.enableCutterPlugins = false;
|
||||
opts.enableR2Plugins = false;
|
||||
opts.enableRizinPlugins = false;
|
||||
}
|
||||
|
||||
if (cmd_parser.isSet(disableCutterPlugins)) {
|
||||
opts.enableCutterPlugins = false;
|
||||
}
|
||||
|
||||
if (cmd_parser.isSet(disableR2Plugins)) {
|
||||
opts.enableR2Plugins = false;
|
||||
if (cmd_parser.isSet(disableRizinPlugins)) {
|
||||
opts.enableRizinPlugins = false;
|
||||
}
|
||||
|
||||
this->clOptions = opts;
|
||||
|
@ -19,7 +19,7 @@ struct CutterCommandLineOptions {
|
||||
QString pythonHome;
|
||||
bool outputRedirectionEnabled = true;
|
||||
bool enableCutterPlugins = true;
|
||||
bool enableR2Plugins = true;
|
||||
bool enableRizinPlugins = true;
|
||||
};
|
||||
|
||||
class CutterApplication : public QApplication
|
||||
|
@ -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/rizinorg/cutter/issues/new?&body=**Environment information**\n* Operating System: "
|
||||
+ osInfo + "\n* Cutter version: " + CUTTER_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"
|
||||
|
@ -34,7 +34,7 @@ const QStringList ColorThemeWorker::cutterSpecificOptions = {
|
||||
"gui.disass_selected"
|
||||
};
|
||||
|
||||
const QStringList ColorThemeWorker::radare2UnusedOptions = {
|
||||
const QStringList ColorThemeWorker::rizinUnusedOptions = {
|
||||
"linehl",
|
||||
"wordhl",
|
||||
"graph.box",
|
||||
@ -60,10 +60,10 @@ const QStringList ColorThemeWorker::radare2UnusedOptions = {
|
||||
ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent)
|
||||
{
|
||||
char* szThemes = rz_str_home(RZ_HOME_THEMES);
|
||||
customR2ThemesLocationPath = szThemes;
|
||||
customRzThemesLocationPath = szThemes;
|
||||
rz_mem_free(szThemes);
|
||||
if (!QDir(customR2ThemesLocationPath).exists()) {
|
||||
QDir().mkpath(customR2ThemesLocationPath);
|
||||
if (!QDir(customRzThemesLocationPath).exists()) {
|
||||
QDir().mkpath(customRzThemesLocationPath);
|
||||
}
|
||||
|
||||
QDir currDir { QStringLiteral("%1%2%3")
|
||||
@ -72,7 +72,7 @@ ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent)
|
||||
.arg(RZ_THEMES)
|
||||
};
|
||||
if (currDir.exists()) {
|
||||
standardR2ThemesLocationPath = currDir.absolutePath();
|
||||
standardRzThemesLocationPath = currDir.absolutePath();
|
||||
} else {
|
||||
QMessageBox::critical(nullptr,
|
||||
tr("Standard themes not found"),
|
||||
@ -115,7 +115,7 @@ QString ColorThemeWorker::copy(const QString &srcThemeName,
|
||||
|
||||
QString ColorThemeWorker::save(const QJsonDocument &theme, const QString &themeName) const
|
||||
{
|
||||
QFile fOut(QDir(customR2ThemesLocationPath).filePath(themeName));
|
||||
QFile fOut(QDir(customRzThemesLocationPath).filePath(themeName));
|
||||
if (!fOut.open(QFile::WriteOnly | QFile::Truncate)) {
|
||||
return tr("The file <b>%1</b> cannot be opened.")
|
||||
.arg(QFileInfo(fOut).filePath());
|
||||
@ -152,7 +152,7 @@ QString ColorThemeWorker::save(const QJsonDocument &theme, const QString &themeN
|
||||
|
||||
bool ColorThemeWorker::isCustomTheme(const QString &themeName) const
|
||||
{
|
||||
return QFile::exists(QDir(customR2ThemesLocationPath).filePath(themeName));
|
||||
return QFile::exists(QDir(customRzThemesLocationPath).filePath(themeName));
|
||||
}
|
||||
|
||||
bool ColorThemeWorker::isThemeExist(const QString &name) const
|
||||
@ -192,7 +192,7 @@ QJsonDocument ColorThemeWorker::getTheme(const QString& themeName) const
|
||||
}
|
||||
|
||||
if (isCustomTheme(themeName)) {
|
||||
QFile src(QDir(customR2ThemesLocationPath).filePath(themeName));
|
||||
QFile src(QDir(customRzThemesLocationPath).filePath(themeName));
|
||||
if (!src.open(QFile::ReadOnly)) {
|
||||
return QJsonDocument();
|
||||
}
|
||||
@ -207,7 +207,7 @@ QJsonDocument ColorThemeWorker::getTheme(const QString& themeName) const
|
||||
}
|
||||
}
|
||||
|
||||
for (auto &key : radare2UnusedOptions) {
|
||||
for (auto &key : rizinUnusedOptions) {
|
||||
theme.remove(key);
|
||||
}
|
||||
|
||||
@ -237,7 +237,7 @@ QString ColorThemeWorker::deleteTheme(const QString &themeName) const
|
||||
return tr("Theme <b>%1</b> does not exist.").arg(themeName);
|
||||
}
|
||||
|
||||
QFile file(QDir(customR2ThemesLocationPath).filePath(themeName));
|
||||
QFile file(QDir(customRzThemesLocationPath).filePath(themeName));
|
||||
if (file.isWritable()) {
|
||||
return tr("You have no permission to write to <b>%1</b>")
|
||||
.arg(QFileInfo(file).filePath());
|
||||
@ -275,7 +275,7 @@ QString ColorThemeWorker::importTheme(const QString& file) const
|
||||
return tr("A color theme named <b>%1</b> already exists.").arg(name);
|
||||
}
|
||||
|
||||
if (QFile::copy(file, QDir(customR2ThemesLocationPath).filePath(name))) {
|
||||
if (QFile::copy(file, QDir(customRzThemesLocationPath).filePath(name))) {
|
||||
return "";
|
||||
} else {
|
||||
return tr("Error occurred during importing. "
|
||||
@ -295,7 +295,7 @@ QString ColorThemeWorker::renameTheme(const QString& themeName, const QString& n
|
||||
return tr("You can not rename standard Rizin themes.");
|
||||
}
|
||||
|
||||
QDir dir = customR2ThemesLocationPath;
|
||||
QDir dir = customRzThemesLocationPath;
|
||||
bool ok = QFile::rename(dir.filePath(themeName), dir.filePath(newName));
|
||||
if (!ok) {
|
||||
return tr("Something went wrong during renaming. "
|
||||
|
@ -18,9 +18,9 @@ class ColorThemeWorker : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
/**
|
||||
* @brief radare2SpecificOptions is list of all available Rizin-only color options.
|
||||
* @brief rizinSpecificOptions is list of all available Rizin-only color options.
|
||||
*/
|
||||
const QStringList radare2SpecificOptions = Core()->cmdj("ecj").object().keys();
|
||||
const QStringList rizinSpecificOptions = Core()->cmdj("ecj").object().keys();
|
||||
|
||||
/**
|
||||
* @brief cutterSpecificOptions is list of all available Cutter-only color options.
|
||||
@ -28,9 +28,9 @@ public:
|
||||
static const QStringList cutterSpecificOptions;
|
||||
|
||||
/**
|
||||
* @brief radare2UnusedOptions is a list of all Rizin options that Cutter does not use.
|
||||
* @brief rizinUnusedOptions is a list of all Rizin options that Cutter does not use.
|
||||
*/
|
||||
static const QStringList radare2UnusedOptions;
|
||||
static const QStringList rizinUnusedOptions;
|
||||
|
||||
static ColorThemeWorker &instance()
|
||||
{
|
||||
@ -117,8 +117,8 @@ public:
|
||||
QStringList customThemes() const;
|
||||
|
||||
private:
|
||||
QString standardR2ThemesLocationPath;
|
||||
QString customR2ThemesLocationPath;
|
||||
QString standardRzThemesLocationPath;
|
||||
QString customRzThemesLocationPath;
|
||||
|
||||
ColorThemeWorker(QObject *parent = nullptr);
|
||||
ColorThemeWorker(const ColorThemeWorker &root) = delete;
|
||||
|
@ -198,7 +198,7 @@ int Configuration::getNewFileLastClicked()
|
||||
|
||||
void Configuration::resetAll()
|
||||
{
|
||||
// Don't reset all r2 vars, that currently breaks a bunch of stuff.
|
||||
// Don't reset all rizin vars, that currently breaks a bunch of stuff.
|
||||
// settingsFile.remove()+loadInitials() should reset all settings configurable using Cutter GUI.
|
||||
//Core()->cmdRaw("e-");
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef R2TASK_H
|
||||
#define R2TASK_H
|
||||
#ifndef RZTASK_H
|
||||
#define RZTASK_H
|
||||
|
||||
#include "core/Cutter.h"
|
||||
|
||||
@ -32,4 +32,4 @@ signals:
|
||||
void finished();
|
||||
};
|
||||
|
||||
#endif // R2TASK_H
|
||||
#endif // RZTASK_H
|
||||
|
@ -37,7 +37,7 @@ UpdateWorker::UpdateWorker(QObject *parent) :
|
||||
|
||||
void UpdateWorker::checkCurrentVersion(time_t timeoutMs)
|
||||
{
|
||||
QUrl url("https://api.github.com/repos/radareorg/cutter/releases/latest");
|
||||
QUrl url("https://api.github.com/repos/rizinorg/cutter/releases/latest");
|
||||
QNetworkRequest request;
|
||||
request.setUrl(url);
|
||||
|
||||
@ -58,7 +58,7 @@ void UpdateWorker::download(QString filename, QString version)
|
||||
|
||||
QNetworkRequest request;
|
||||
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
QUrl url(QString("https://github.com/radareorg/cutter/releases/"
|
||||
QUrl url(QString("https://github.com/rizinorg/cutter/releases/"
|
||||
"download/v%1/%2").arg(version).arg(getRepositoryFileName()));
|
||||
request.setUrl(url);
|
||||
|
||||
@ -77,8 +77,8 @@ void UpdateWorker::showUpdateDialog(bool showDontCheckForUpdatesButton)
|
||||
+ "<b>" + tr("Current version:") + "</b> " CUTTER_VERSION_FULL "<br/>"
|
||||
+ "<b>" + tr("Latest version:") + "</b> " + latestVersion.toString() + "<br/><br/>"
|
||||
+ tr("For update, please check the link:<br/>")
|
||||
+ QString("<a href=\"https://github.com/radareorg/cutter/releases/tag/v%1\">"
|
||||
"https://github.com/radareorg/cutter/releases/tag/v%1</a><br/>").arg(latestVersion.toString())
|
||||
+ QString("<a href=\"https://github.com/rizinorg/cutter/releases/tag/v%1\">"
|
||||
"https://github.com/rizinorg/cutter/releases/tag/v%1</a><br/>").arg(latestVersion.toString())
|
||||
+ tr("or click \"Download\" to download latest version of Cutter."));
|
||||
if (showDontCheckForUpdatesButton) {
|
||||
mb.setStandardButtons(QMessageBox::Save | QMessageBox::Reset | QMessageBox::Ok);
|
||||
|
@ -196,7 +196,7 @@ void CutterCore::initialize(bool loadPlugins)
|
||||
prefix.cdUp();
|
||||
qInfo() << "Setting Rizin prefix =" << prefix.absolutePath() << " for AppImage.";
|
||||
#else // MACOS_RZ_BUNDLED
|
||||
// Executable is in Contents/MacOS, prefix is Contents/Resources/r2
|
||||
// Executable is in Contents/MacOS, prefix is Contents/Resources/rz
|
||||
prefix.cdUp();
|
||||
prefix.cd("Resources");
|
||||
qInfo() << "Setting Rizin prefix =" << prefix.absolutePath() << " for macOS Application Bundle.";
|
||||
@ -835,13 +835,13 @@ QString CutterCore::getCommentAt(RVA addr)
|
||||
return rz_meta_get_string(core->analysis, RZ_META_TYPE_COMMENT, addr);
|
||||
}
|
||||
|
||||
void CutterCore::setImmediateBase(const QString &r2BaseName, RVA offset)
|
||||
void CutterCore::setImmediateBase(const QString &rzBaseName, RVA offset)
|
||||
{
|
||||
if (offset == RVA_INVALID) {
|
||||
offset = getOffset();
|
||||
}
|
||||
|
||||
this->cmdRawAt(QString("ahi %1").arg(r2BaseName), offset);
|
||||
this->cmdRawAt(QString("ahi %1").arg(rzBaseName), offset);
|
||||
emit instructionChanged(offset);
|
||||
}
|
||||
|
||||
@ -877,8 +877,8 @@ void CutterCore::seekSilent(ut64 offset)
|
||||
void CutterCore::seek(ut64 offset)
|
||||
{
|
||||
// Slower than using the API, but the API is not complete
|
||||
// which means we either have to duplicate code from radare2
|
||||
// here, or refactor radare2 API.
|
||||
// which means we either have to duplicate code from rizin
|
||||
// here, or refactor rizin API.
|
||||
CORE_LOCK();
|
||||
if (offset == RVA_INVALID) {
|
||||
return;
|
||||
@ -2184,7 +2184,7 @@ void CutterCore::setBreakpointTrace(int index, bool enabled)
|
||||
}
|
||||
}
|
||||
|
||||
static BreakpointDescription breakpointDescriptionFromR2(int index, rz_bp_item_t *bpi)
|
||||
static BreakpointDescription breakpointDescriptionFromRizin(int index, rz_bp_item_t *bpi)
|
||||
{
|
||||
BreakpointDescription bp;
|
||||
bp.addr = bpi->addr;
|
||||
@ -2216,7 +2216,7 @@ BreakpointDescription CutterCore::getBreakpointAt(RVA addr)
|
||||
int index = breakpointIndexAt(addr);
|
||||
auto bp = rz_bp_get_index(core->dbg->bp, index);
|
||||
if (bp) {
|
||||
return breakpointDescriptionFromR2(index, bp);
|
||||
return breakpointDescriptionFromRizin(index, bp);
|
||||
}
|
||||
return BreakpointDescription();
|
||||
}
|
||||
@ -2225,10 +2225,10 @@ QList<BreakpointDescription> CutterCore::getBreakpoints()
|
||||
{
|
||||
CORE_LOCK();
|
||||
QList<BreakpointDescription> ret;
|
||||
//TODO: use higher level API, don't touch r2 bps_idx directly
|
||||
//TODO: use higher level API, don't touch rizin bps_idx directly
|
||||
for (int i = 0; i < core->dbg->bp->bps_idx_count; i++) {
|
||||
if (auto bpi = core->dbg->bp->bps_idx[i]) {
|
||||
ret.push_back(breakpointDescriptionFromR2(i, bpi));
|
||||
ret.push_back(breakpointDescriptionFromRizin(i, bpi));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -50,7 +50,7 @@ public:
|
||||
void loadCutterRC();
|
||||
void loadDefaultCutterRC();
|
||||
QDir getCutterRCDefaultDirectory() const;
|
||||
|
||||
|
||||
AsyncTaskManager *getAsyncTaskManager() { return asyncTaskManager; }
|
||||
|
||||
RVA getOffset() const { return core_->offset; }
|
||||
@ -70,7 +70,7 @@ public:
|
||||
* @param str the command you want to execute
|
||||
* @param task a shared pointer that will be returned with the R2 command task
|
||||
* @note connect to the &RizinTask::finished signal to add your own logic once
|
||||
* the command is finished. Use task->getResult()/getResultJson() for the
|
||||
* the command is finished. Use task->getResult()/getResultJson() for the
|
||||
* return value.
|
||||
* Once you have setup connections you can start the task with task->startTask()
|
||||
* If you want to seek to an address, you should use CutterCore::seek.
|
||||
@ -94,7 +94,7 @@ public:
|
||||
/**
|
||||
* @brief Execute a Rizin command \a cmd at \a address. The function will preform a silent seek to the address
|
||||
* without triggering the seekChanged event nor adding new entries to the seek history. By nature, the
|
||||
* API is executing a single command without going through Rizin shell, and thus ignores multiple commands
|
||||
* API is executing a single command without going through Rizin shell, and thus ignores multiple commands
|
||||
* and tries to overcome command injections.
|
||||
* @param cmd - a raw command to execute. If multiple commands will be passed (e.g "px 5; pd 7 && pdf") then
|
||||
* only the first command will be executed.
|
||||
@ -102,12 +102,12 @@ public:
|
||||
* @return the output of the command
|
||||
*/
|
||||
QString cmdRawAt(const char *cmd, RVA address);
|
||||
|
||||
|
||||
/**
|
||||
* @brief a wrapper around cmdRawAt(const char *cmd, RVA address).
|
||||
*/
|
||||
QString cmdRawAt(const QString &str, RVA address) { return cmdRawAt(str.toUtf8().constData(), address); }
|
||||
|
||||
|
||||
QJsonDocument cmdj(const char *str);
|
||||
QJsonDocument cmdj(const QString &str) { return cmdj(str.toUtf8().constData()); }
|
||||
QJsonDocument cmdjAt(const char *str, RVA address);
|
||||
@ -127,7 +127,7 @@ public:
|
||||
* @param command the command you want to execute
|
||||
* @param task a shared pointer that will be returned with the R2 command task
|
||||
* @note connect to the &RizinTask::finished signal to add your own logic once
|
||||
* the command is finished. Use task->getResult()/getResultJson() for the
|
||||
* the command is finished. Use task->getResult()/getResultJson() for the
|
||||
* return value.
|
||||
* Once you have setup connections you can start the task with task->startTask()
|
||||
* If you want to seek to an address, you should use CutterCore::seek.
|
||||
@ -233,7 +233,7 @@ public:
|
||||
void setComment(RVA addr, const QString &cmt);
|
||||
void delComment(RVA addr);
|
||||
QString getCommentAt(RVA addr);
|
||||
void setImmediateBase(const QString &r2BaseName, RVA offset = RVA_INVALID);
|
||||
void setImmediateBase(const QString &rzBaseName, RVA offset = RVA_INVALID);
|
||||
void setCurrentBits(int bits, RVA offset = RVA_INVALID);
|
||||
|
||||
/**
|
||||
@ -354,14 +354,14 @@ public:
|
||||
/**
|
||||
* @brief Returns a list of stack address and their telescoped references
|
||||
* @param size number of bytes to scan
|
||||
* @param depth telescoping depth
|
||||
* @param depth telescoping depth
|
||||
*/
|
||||
QList<QJsonObject> getStack(int size = 0x100, int depth = 6);
|
||||
/**
|
||||
* @brief Recursively dereferences pointers starting at the specified address
|
||||
* up to a given depth
|
||||
* @param addr telescoping addr
|
||||
* @param depth telescoping depth
|
||||
* @param depth telescoping depth
|
||||
*/
|
||||
QJsonObject getAddrRefs(RVA addr, int depth);
|
||||
/**
|
||||
@ -420,7 +420,7 @@ public:
|
||||
|
||||
bool isBreakpoint(const QList<RVA> &breakpoints, RVA addr);
|
||||
QList<RVA> getBreakpointsAddresses();
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get all breakpoinst that are belong to a functions at this address
|
||||
*/
|
||||
@ -727,7 +727,7 @@ private:
|
||||
|
||||
QSharedPointer<RizinTask> debugTask;
|
||||
RizinTaskDialog *debugTaskDialog;
|
||||
|
||||
|
||||
QVector<QString> getCutterRCFilePaths() const;
|
||||
};
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#define APPNAME "Cutter"
|
||||
|
||||
/**
|
||||
* @brief Type to be used for all kinds of addresses/offsets in r2 address space.
|
||||
* @brief Type to be used for all kinds of addresses/offsets in rizin address space.
|
||||
*/
|
||||
typedef ut64 RVA;
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
||||
#include "widgets/HexdumpWidget.h"
|
||||
#include "widgets/DecompilerWidget.h"
|
||||
#include "widgets/HexWidget.h"
|
||||
#include "widgets/R2GraphWidget.h"
|
||||
#include "widgets/RizinGraphWidget.h"
|
||||
#include "widgets/CallGraph.h"
|
||||
|
||||
// Qt Headers
|
||||
@ -395,7 +395,7 @@ void MainWindow::initDocks()
|
||||
symbolsDock = new SymbolsWidget(this),
|
||||
vTablesDock = new VTablesWidget(this),
|
||||
zignaturesDock = new ZignaturesWidget(this),
|
||||
r2GraphDock = new R2GraphWidget(this),
|
||||
rzGraphDock = new RizinGraphWidget(this),
|
||||
callGraphDock = new CallGraphWidget(this, false),
|
||||
globalCallGraphDock = new CallGraphWidget(this, true),
|
||||
};
|
||||
@ -531,9 +531,9 @@ void MainWindow::openNewFile(InitialOptions &options, bool skipOptionsDialog)
|
||||
{
|
||||
setFilename(options.filename);
|
||||
|
||||
/* Prompt to load filename.r2 script */
|
||||
/* Prompt to load filename.rz script */
|
||||
if (options.script.isEmpty()) {
|
||||
QString script = QString("%1.r2").arg(this->filename);
|
||||
QString script = QString("%1.rz").arg(this->filename);
|
||||
if (rz_file_exists(script.toStdString().data())) {
|
||||
QMessageBox mb;
|
||||
mb.setWindowTitle(tr("Script loading"));
|
||||
@ -894,7 +894,7 @@ void MainWindow::restoreDocks()
|
||||
tabifyDockWidget(dashboardDock, memoryMapDock);
|
||||
tabifyDockWidget(dashboardDock, breakpointDock);
|
||||
tabifyDockWidget(dashboardDock, registerRefsDock);
|
||||
tabifyDockWidget(dashboardDock, r2GraphDock);
|
||||
tabifyDockWidget(dashboardDock, rzGraphDock);
|
||||
tabifyDockWidget(dashboardDock, callGraphDock);
|
||||
tabifyDockWidget(dashboardDock, globalCallGraphDock);
|
||||
for (const auto &it : dockWidgets) {
|
||||
@ -1714,7 +1714,7 @@ void MainWindow::on_actionExport_as_code_triggered()
|
||||
cmdMap[filters.last()] = "pcJ";
|
||||
filters << tr("Python array (*.py)");
|
||||
cmdMap[filters.last()] = "pcp";
|
||||
filters << tr("Print 'wx' Rizin commands (*.r2)");
|
||||
filters << tr("Print 'wx' Rizin commands (*.rz)");
|
||||
cmdMap[filters.last()] = "pc*";
|
||||
filters << tr("GAS .byte blob (*.asm, *.s)");
|
||||
cmdMap[filters.last()] = "pca";
|
||||
|
@ -52,7 +52,7 @@ class GraphWidget;
|
||||
class HexdumpWidget;
|
||||
class DecompilerWidget;
|
||||
class OverviewWidget;
|
||||
class R2GraphWidget;
|
||||
class RizinGraphWidget;
|
||||
class CallGraphWidget;
|
||||
|
||||
namespace Ui {
|
||||
@ -253,7 +253,7 @@ private:
|
||||
NewFileDialog *newFileDialog = nullptr;
|
||||
CutterDockWidget *breakpointDock = nullptr;
|
||||
CutterDockWidget *registerRefsDock = nullptr;
|
||||
R2GraphWidget *r2GraphDock = nullptr;
|
||||
RizinGraphWidget *rzGraphDock = nullptr;
|
||||
CallGraphWidget *callGraphDock = nullptr;
|
||||
CallGraphWidget *globalCallGraphDock = nullptr;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#include "AboutDialog.h"
|
||||
|
||||
#include "ui_AboutDialog.h"
|
||||
#include "R2PluginsDialog.h"
|
||||
#include "RizinPluginsDialog.h"
|
||||
#include "common/Configuration.h"
|
||||
|
||||
#include <QUrl>
|
||||
@ -79,7 +79,7 @@ void AboutDialog::on_showVersionButton_clicked()
|
||||
|
||||
void AboutDialog::on_showPluginsButton_clicked()
|
||||
{
|
||||
R2PluginsDialog dialog(this);
|
||||
RizinPluginsDialog dialog(this);
|
||||
dialog.exec();
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ void EditVariablesDialog::applyFields()
|
||||
|
||||
Core()->cmdRaw(QString("afvt %1 %2").arg(desc.name).arg(ui->typeComboBox->currentText()));
|
||||
|
||||
// TODO Remove all those replace once r2 command parser is fixed
|
||||
// TODO Remove all those replace once rizin command parser is fixed
|
||||
QString newName = ui->nameEdit->text().replace(QLatin1Char(' '), QLatin1Char('_'))
|
||||
.replace(QLatin1Char('\\'), QLatin1Char('_'))
|
||||
.replace(QLatin1Char('/'), QLatin1Char('_'));
|
||||
|
@ -427,7 +427,7 @@ void InitialOptionsDialog::on_scriptSelectButton_clicked()
|
||||
{
|
||||
QFileDialog dialog(this);
|
||||
dialog.setWindowTitle(tr("Select Rizin script file"));
|
||||
dialog.setNameFilters({ tr("Script file (*.r2)"), tr("All files (*)") });
|
||||
dialog.setNameFilters({ tr("Script file (*.rz)"), tr("All files (*)") });
|
||||
|
||||
if (!dialog.exec()) {
|
||||
return;
|
||||
|
@ -1,13 +1,13 @@
|
||||
#include "R2PluginsDialog.h"
|
||||
#include "ui_R2PluginsDialog.h"
|
||||
#include "RizinPluginsDialog.h"
|
||||
#include "ui_RizinPluginsDialog.h"
|
||||
|
||||
#include "core/Cutter.h"
|
||||
#include "common/Helpers.h"
|
||||
#include "plugins/PluginManager.h"
|
||||
|
||||
R2PluginsDialog::R2PluginsDialog(QWidget *parent) :
|
||||
RizinPluginsDialog::RizinPluginsDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::R2PluginsDialog)
|
||||
ui(new Ui::RizinPluginsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
@ -57,7 +57,7 @@ R2PluginsDialog::R2PluginsDialog(QWidget *parent) :
|
||||
qhelpers::adjustColumns(ui->RzAsmTreeWidget, 0);
|
||||
}
|
||||
|
||||
R2PluginsDialog::~R2PluginsDialog()
|
||||
RizinPluginsDialog::~RizinPluginsDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
@ -7,19 +7,19 @@
|
||||
#include "core/Cutter.h"
|
||||
|
||||
namespace Ui {
|
||||
class R2PluginsDialog;
|
||||
class RizinPluginsDialog;
|
||||
}
|
||||
|
||||
class R2PluginsDialog : public QDialog
|
||||
class RizinPluginsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit R2PluginsDialog(QWidget *parent = nullptr);
|
||||
~R2PluginsDialog();
|
||||
explicit RizinPluginsDialog(QWidget *parent = nullptr);
|
||||
~RizinPluginsDialog();
|
||||
|
||||
private:
|
||||
Ui::R2PluginsDialog *ui;
|
||||
Ui::RizinPluginsDialog *ui;
|
||||
};
|
||||
|
||||
#endif // PLUGINSDIALOG_H
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>R2PluginsDialog</class>
|
||||
<widget class="QDialog" name="R2PluginsDialog">
|
||||
<class>RizinPluginsDialog</class>
|
||||
<widget class="QDialog" name="RizinPluginsDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -207,7 +207,7 @@
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>R2PluginsDialog</receiver>
|
||||
<receiver>RizinPluginsDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
@ -1,5 +1,5 @@
|
||||
#ifndef R2TASKDIALOG_H
|
||||
#define R2TASKDIALOG_H
|
||||
#ifndef RZTASKDIALOG_H
|
||||
#define RZTASKDIALOG_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
@ -47,4 +47,4 @@ private:
|
||||
bool breakOnClose = false;
|
||||
};
|
||||
|
||||
#endif //R2TASKDIALOG_H
|
||||
#endif //RZTASKDIALOG_H
|
||||
|
@ -11,13 +11,13 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>R2 Task</string>
|
||||
<string>Rizin Task</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="descLabel">
|
||||
<property name="text">
|
||||
<string>R2 task in progress..</string>
|
||||
<string>Rizin task in progress..</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -321,7 +321,7 @@
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Sans'; font-size:10pt;">Join thousands of reverse engineers in our community:<br /></span><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">Twitter:</span><span style=" font-family:'Noto Sans'; font-size:10pt;"> </span><a href="https://twitter.com/r2gui"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;">@r2gui</span></a><span style=" font-family:'Noto Sans'; font-size:10pt;"><br /></span><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">Telegram: </span><a href="https://t.me/r2cutter"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;">@r2cutter <br /></span></a><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">IRC: </span><span style=" font-family:'Noto Sans'; font-size:10pt;">#cutter on </span><a href="irc.freenode.net"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;">irc.freenode.net</span></a></p></body></html></string>
|
||||
<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Noto Sans'; font-size:10pt;">Join thousands of reverse engineers in our community:<br /></span><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">Twitter:</span><span style=" font-family:'Noto Sans'; font-size:10pt;"> </span><a href="https://twitter.com/cutter_re"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;">@cutter_re</span></a><span style=" font-family:'Noto Sans'; font-size:10pt;"><br /></span><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">Telegram: </span><a href="https://t.me/cutter_re"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;">@cutter_re <br /></span></a><span style=" font-family:'Noto Sans'; font-size:10pt; font-weight:600;">IRC: </span><span style=" font-family:'Noto Sans'; font-size:10pt;">#cutter on </span><a href="irc.freenode.net"><span style=" font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;">irc.freenode.net</span></a></p></body></html></string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::RichText</enum>
|
||||
@ -352,7 +352,7 @@ p, li { white-space: pre-wrap; }
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><html><head/><body style=" font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;"><p><span style=" font-size:10pt;">Want to help us make Cutter even better?<br/>Visit our </span><a href="https://github.com/radareorg/cutter"><span style=" font-size:10pt; text-decoration: underline; color:#2980b9;">Github page</span></a><span style=" font-size:10pt;"> and report bugs or contribute code.</span></p></body></html></string>
|
||||
<string><html><head/><body style=" font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;"><p><span style=" font-size:10pt;">Want to help us make Cutter even better?<br/>Visit our </span><a href="https://github.com/rizinorg/cutter"><span style=" font-size:10pt; text-decoration: underline; color:#2980b9;">Github page</span></a><span style=" font-size:10pt;"> and report bugs or contribute code.</span></p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "common/Helpers.h"
|
||||
#include "common/Configuration.h"
|
||||
#include "plugins/PluginManager.h"
|
||||
#include "dialogs/R2PluginsDialog.h"
|
||||
#include "dialogs/RizinPluginsDialog.h"
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
@ -49,11 +49,11 @@ PluginsOptionsWidget::PluginsOptionsWidget(PreferencesDialog *dialog)
|
||||
}
|
||||
qhelpers::adjustColumns(treeWidget, 0);
|
||||
|
||||
auto r2PluginsButton = new QPushButton(this);
|
||||
layout->addWidget(r2PluginsButton);
|
||||
r2PluginsButton->setText(tr("Show Rizin plugin information"));
|
||||
connect(r2PluginsButton, &QPushButton::clicked, this, [this]() {
|
||||
R2PluginsDialog dialog(this);
|
||||
auto rzPluginsButton = new QPushButton(this);
|
||||
layout->addWidget(rzPluginsButton);
|
||||
rzPluginsButton->setText(tr("Show Rizin plugin information"));
|
||||
connect(rzPluginsButton, &QPushButton::clicked, this, [this]() {
|
||||
RizinPluginsDialog dialog(this);
|
||||
dialog.exec();
|
||||
});
|
||||
}
|
||||
|
@ -1,103 +0,0 @@
|
||||
win32 {
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
LIBS += -L"$$PWD/../r2_dist/lib"
|
||||
R2_INCLUDEPATH += "$$PWD/../r2_dist/include/libr"
|
||||
R2_INCLUDEPATH += "$$PWD/../r2_dist/include/libr/sdb"
|
||||
INCLUDEPATH += $$R2_INCLUDEPATH
|
||||
|
||||
LIBS += \
|
||||
-lr_core \
|
||||
-lr_config \
|
||||
-lr_cons \
|
||||
-lr_io \
|
||||
-lr_util \
|
||||
-lr_flag \
|
||||
-lr_asm \
|
||||
-lr_debug \
|
||||
-lr_hash \
|
||||
-lr_bin \
|
||||
-lr_lang \
|
||||
-lr_analysis \
|
||||
-lr_parse \
|
||||
-lr_bp \
|
||||
-lr_egg \
|
||||
-lr_reg \
|
||||
-lr_search \
|
||||
-lr_syscall \
|
||||
-lr_socket \
|
||||
-lr_fs \
|
||||
-lr_magic \
|
||||
-lr_crypto
|
||||
} else {
|
||||
macx|bsd {
|
||||
R2PREFIX=/usr/local
|
||||
} else {
|
||||
R2PREFIX=/usr
|
||||
}
|
||||
USE_PKGCONFIG = 1
|
||||
R2_USER_PKGCONFIG = $$(HOME)/bin/prefix/radare2/lib/pkgconfig
|
||||
exists($$R2_USER_PKGCONFIG) {
|
||||
# caution: may not work for cross compilations
|
||||
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$$R2_USER_PKGCONFIG
|
||||
} else {
|
||||
unix {
|
||||
exists($$R2PREFIX/lib/pkgconfig/rz_core.pc) {
|
||||
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$$R2PREFIX/lib/pkgconfig
|
||||
} else {
|
||||
LIBS += -L$$R2PREFIX/lib
|
||||
R2_INCLUDEPATH += $$R2PREFIX/include/libr
|
||||
R2_INCLUDEPATH += $$R2PREFIX/include/libr/sdb
|
||||
USE_PKGCONFIG = 0
|
||||
}
|
||||
}
|
||||
macx {
|
||||
LIBS += -L$$R2PREFIX/lib
|
||||
R2_INCLUDEPATH += $$R2PREFIX/include/libr
|
||||
R2_INCLUDEPATH += $$R2PREFIX/include/libr/sdb
|
||||
USE_PKGCONFIG = 0
|
||||
}
|
||||
bsd {
|
||||
!exists($$PKG_CONFIG_PATH/rz_core.pc) {
|
||||
LIBS += -L$$R2PREFIX/lib
|
||||
R2_INCLUDEPATH += $$R2PREFIX/include/libr
|
||||
R2_INCLUDEPATH += $$R2PREFIX/include/libr/sdb
|
||||
USE_PKGCONFIG = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
INCLUDEPATH += $$R2_INCLUDEPATH
|
||||
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
equals(USE_PKGCONFIG, 1) {
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += rz_core
|
||||
R2_INCLUDEPATH = "$$system("pkg-config --variable=includedir rz_core")/libr"
|
||||
R2_INCLUDEPATH += "$$system("pkg-config --variable=includedir rz_core")/libr/sdb"
|
||||
} else {
|
||||
LIBS += \
|
||||
-lr_core \
|
||||
-lr_config \
|
||||
-lr_cons \
|
||||
-lr_io \
|
||||
-lr_flag \
|
||||
-lr_asm \
|
||||
-lr_debug \
|
||||
-lr_hash \
|
||||
-lr_bin \
|
||||
-lr_lang \
|
||||
-lr_parse \
|
||||
-lr_bp \
|
||||
-lr_egg \
|
||||
-lr_reg \
|
||||
-lr_search \
|
||||
-lr_syscall \
|
||||
-lr_socket \
|
||||
-lr_fs \
|
||||
-lr_analysis \
|
||||
-lr_magic \
|
||||
-lr_util \
|
||||
-lr_crypto
|
||||
}
|
||||
}
|
103
src/lib_rizin.pri
Normal file
103
src/lib_rizin.pri
Normal file
@ -0,0 +1,103 @@
|
||||
win32 {
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
LIBS += -L"$$PWD/../rz_dist/lib"
|
||||
RZ_INCLUDEPATH += "$$PWD/../rz_dist/include/librz"
|
||||
RZ_INCLUDEPATH += "$$PWD/../rz_dist/include/librz/sdb"
|
||||
INCLUDEPATH += $$RZ_INCLUDEPATH
|
||||
|
||||
LIBS += \
|
||||
-lrz_core \
|
||||
-lrz_config \
|
||||
-lrz_cons \
|
||||
-lrz_io \
|
||||
-lrz_util \
|
||||
-lrz_flag \
|
||||
-lrz_asm \
|
||||
-lrz_debug \
|
||||
-lrz_hash \
|
||||
-lrz_bin \
|
||||
-lrz_lang \
|
||||
-lrz_analysis \
|
||||
-lrz_parse \
|
||||
-lrz_bp \
|
||||
-lrz_egg \
|
||||
-lrz_reg \
|
||||
-lrz_search \
|
||||
-lrz_syscall \
|
||||
-lrz_socket \
|
||||
-lrz_fs \
|
||||
-lrz_magic \
|
||||
-lrz_crypto
|
||||
} else {
|
||||
macx|bsd {
|
||||
RZPREFIX=/usr/local
|
||||
} else {
|
||||
RZPREFIX=/usr
|
||||
}
|
||||
USE_PKGCONFIG = 1
|
||||
RZ_USER_PKGCONFIG = $$(HOME)/bin/prefix/rizin/lib/pkgconfig
|
||||
exists($$RZ_USER_PKGCONFIG) {
|
||||
# caution: may not work for cross compilations
|
||||
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$$RZ_USER_PKGCONFIG
|
||||
} else {
|
||||
unix {
|
||||
exists($$RZPREFIX/lib/pkgconfig/rz_core.pc) {
|
||||
PKG_CONFIG_PATH=$$PKG_CONFIG_PATH:$$RZPREFIX/lib/pkgconfig
|
||||
} else {
|
||||
LIBS += -L$$RZPREFIX/lib
|
||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz
|
||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz/sdb
|
||||
USE_PKGCONFIG = 0
|
||||
}
|
||||
}
|
||||
macx {
|
||||
LIBS += -L$$RZPREFIX/lib
|
||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz
|
||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz/sdb
|
||||
USE_PKGCONFIG = 0
|
||||
}
|
||||
bsd {
|
||||
!exists($$PKG_CONFIG_PATH/rz_core.pc) {
|
||||
LIBS += -L$$RZPREFIX/lib
|
||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz
|
||||
RZ_INCLUDEPATH += $$RZPREFIX/include/librz/sdb
|
||||
USE_PKGCONFIG = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
INCLUDEPATH += $$RZ_INCLUDEPATH
|
||||
|
||||
DEFINES += _CRT_NONSTDC_NO_DEPRECATE
|
||||
DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||
equals(USE_PKGCONFIG, 1) {
|
||||
CONFIG += link_pkgconfig
|
||||
PKGCONFIG += rz_core
|
||||
RZ_INCLUDEPATH = "$$system("pkg-config --variable=includedir rz_core")/librz"
|
||||
RZ_INCLUDEPATH += "$$system("pkg-config --variable=includedir rz_core")/librz/sdb"
|
||||
} else {
|
||||
LIBS += \
|
||||
-lrz_core \
|
||||
-lrz_config \
|
||||
-lrz_cons \
|
||||
-lrz_io \
|
||||
-lrz_flag \
|
||||
-lrz_asm \
|
||||
-lrz_debug \
|
||||
-lrz_hash \
|
||||
-lrz_bin \
|
||||
-lrz_lang \
|
||||
-lrz_parse \
|
||||
-lrz_bp \
|
||||
-lrz_egg \
|
||||
-lrz_reg \
|
||||
-lrz_search \
|
||||
-lrz_syscall \
|
||||
-lrz_socket \
|
||||
-lrz_fs \
|
||||
-lrz_analysis \
|
||||
-lrz_magic \
|
||||
-lrz_util \
|
||||
-lrz_crypto
|
||||
}
|
||||
}
|
@ -249,7 +249,7 @@ void DecompilerContextMenu::aboutToShowSlot()
|
||||
actionEditFunctionVariables.setText(tr("Edit variable %1").arg(QString(
|
||||
annotationHere->variable.name)));
|
||||
actionRenameThingHere.setText(tr("Rename variable %1").arg(QString(annotationHere->variable.name)));
|
||||
if (!variablePresentInR2()) {
|
||||
if (!variablePresentInRizin()) {
|
||||
actionEditFunctionVariables.setDisabled(true);
|
||||
actionRenameThingHere.setDisabled(true);
|
||||
setToolTipsVisible(true);
|
||||
@ -427,7 +427,7 @@ void DecompilerContextMenu::actionRenameThingHereTriggered()
|
||||
}
|
||||
}
|
||||
} else if (isFunctionVariable()) {
|
||||
if (!variablePresentInR2()) {
|
||||
if (!variablePresentInRizin()) {
|
||||
// Show can't rename this variable dialog
|
||||
QMessageBox::critical(this, tr("Rename local variable %1").arg(QString(
|
||||
annotationHere->variable.name)),
|
||||
@ -453,7 +453,7 @@ void DecompilerContextMenu::actionEditFunctionVariablesTriggered()
|
||||
{
|
||||
if (!isFunctionVariable()) {
|
||||
return;
|
||||
} else if (!variablePresentInR2()) {
|
||||
} else if (!variablePresentInRizin()) {
|
||||
QMessageBox::critical(this, tr("Edit local variable %1").arg(QString(
|
||||
annotationHere->variable.name)),
|
||||
tr("Can't edit this variable. "
|
||||
@ -587,7 +587,7 @@ bool DecompilerContextMenu::isFunctionVariable()
|
||||
return (annotationHere && rz_annotation_is_variable(annotationHere));
|
||||
}
|
||||
|
||||
bool DecompilerContextMenu::variablePresentInR2()
|
||||
bool DecompilerContextMenu::variablePresentInRizin()
|
||||
{
|
||||
QString variableName(annotationHere->variable.name);
|
||||
QList<VariableDescription> variables = Core()->getVariables(offset);
|
||||
|
@ -174,7 +174,7 @@ private:
|
||||
*
|
||||
* @return True if the variable is present, otherwise false
|
||||
*/
|
||||
bool variablePresentInR2();
|
||||
bool variablePresentInRizin();
|
||||
};
|
||||
|
||||
#endif // DECOMPILERCONTEXTMENU_H
|
||||
|
@ -375,7 +375,7 @@ DisassemblyContextMenu::ThingUsedHere DisassemblyContextMenu::getThingAt(ut64 ad
|
||||
RzAnalysisFunction *fcn = Core()->functionAt(address);
|
||||
RzFlagItem *flag = rz_flag_get_i(Core()->core()->flags, address);
|
||||
|
||||
// We will lookup through existing r2 types to find something relevant
|
||||
// We will lookup through existing rizin types to find something relevant
|
||||
|
||||
if (fcn != nullptr) {
|
||||
// It is a function
|
||||
|
@ -40,28 +40,28 @@ configure_file(input: 'CutterConfig.h.in',
|
||||
conf_inc = include_directories('.')
|
||||
|
||||
sp_dir = join_paths(meson.source_root(), 'subprojects')
|
||||
sp_r2_dir = join_paths(sp_dir, 'radare2')
|
||||
exists_cmd = '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(sp_r2_dir)
|
||||
sp_rizin_dir = join_paths(sp_dir, 'rizin')
|
||||
exists_cmd = '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(sp_rizin_dir)
|
||||
if run_command(py3_exe, '-c', exists_cmd).returncode() == 0
|
||||
r2_src_dir = join_paths(meson.source_root(), '..', 'radare2')
|
||||
rizin_src_dir = join_paths(meson.source_root(), '..', 'rizin')
|
||||
if host_machine.system() == 'windows'
|
||||
sp_dir = '\\'.join(sp_dir.split('/'))
|
||||
sp_r2_dir = '\\'.join(sp_r2_dir.split('/'))
|
||||
r2_src_dir = '\\'.join(r2_src_dir.split('/'))
|
||||
link_cmd = ['CMD', '/C', 'MKDIR', sp_dir, '&', 'MKLINK', '/D', sp_r2_dir, r2_src_dir]
|
||||
sp_rizin_dir = '\\'.join(sp_rizin_dir.split('/'))
|
||||
rizin_src_dir = '\\'.join(rizin_src_dir.split('/'))
|
||||
link_cmd = ['CMD', '/C', 'MKDIR', sp_dir, '&', 'MKLINK', '/D', sp_rizin_dir, rizin_src_dir]
|
||||
else
|
||||
link_cmd = ['sh', '-c', 'mkdir @0@ ; ln -s @1@ @2@'.format(sp_dir, r2_src_dir, sp_r2_dir)]
|
||||
link_cmd = ['sh', '-c', 'mkdir @0@ ; ln -s @1@ @2@'.format(sp_dir, rizin_src_dir, sp_rizin_dir)]
|
||||
endif
|
||||
run_command(link_cmd, check: true)
|
||||
endif
|
||||
|
||||
libr2_dep = dependency('libr2',
|
||||
fallback : ['radare2', 'libr2_dep'],
|
||||
librz_dep = dependency('librz',
|
||||
fallback : ['rizin', 'librz_dep'],
|
||||
default_options : ['enable_tests=false'])
|
||||
|
||||
qt5dep = dependency('qt5', modules: qt_modules, main: true)
|
||||
|
||||
deps = [libr2_dep, qt5dep]
|
||||
deps = [librz_dep, qt5dep]
|
||||
if get_option('enable_python')
|
||||
py3_dep = dependency('python3')
|
||||
deps += [py3_dep]
|
||||
@ -80,8 +80,8 @@ if get_option('enable_python')
|
||||
join_paths(meson.current_source_dir(), 'widgets'),
|
||||
join_paths(meson.current_source_dir(), 'plugins'),
|
||||
join_paths(meson.current_source_dir(), 'menus'),
|
||||
join_paths(meson.current_source_dir(), 'subprojects/radare2/libr/include'),
|
||||
join_paths(meson.current_build_dir(), 'subprojects/radare2'),
|
||||
join_paths(meson.current_source_dir(), 'subprojects/rizin/librz/include'),
|
||||
join_paths(meson.current_build_dir(), 'subprojects/rizin'),
|
||||
qt5core_dep.get_pkgconfig_variable('includedir'),
|
||||
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
|
||||
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtGui'),
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop">
|
||||
<id>org.radare.Cutter</id>
|
||||
<id>org.rizin.Cutter</id>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>GPL-3.0</project_license>
|
||||
<name>Cutter</name>
|
||||
@ -12,7 +12,7 @@
|
||||
</p>
|
||||
</description>
|
||||
|
||||
<launchable type="desktop-id">org.radare.Cutter.desktop</launchable>
|
||||
<launchable type="desktop-id">org.rizin.Cutter.desktop</launchable>
|
||||
|
||||
<screenshots>
|
||||
<screenshot>
|
@ -47,7 +47,7 @@ public:
|
||||
virtual QString getVersion() const = 0;
|
||||
};
|
||||
|
||||
#define CutterPlugin_iid "org.radare.cutter.plugins.CutterPlugin"
|
||||
#define CutterPlugin_iid "org.rizin.cutter.plugins.CutterPlugin"
|
||||
|
||||
Q_DECLARE_INTERFACE(CutterPlugin, CutterPlugin_iid)
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
class CutterSamplePlugin : public QObject, CutterPlugin
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PLUGIN_METADATA(IID "org.radare.cutter.plugins.CutterPlugin")
|
||||
Q_PLUGIN_METADATA(IID "org.rizin.cutter.plugins.CutterPlugin")
|
||||
Q_INTERFACES(CutterPlugin)
|
||||
|
||||
public:
|
||||
|
@ -241,7 +241,7 @@ void ColorThemeListView::currentChanged(const QModelIndex ¤t,
|
||||
{
|
||||
ColorOption prev = previous.data(Qt::UserRole).value<ColorOption>();
|
||||
Config()->setColor(prev.optionName, prev.color);
|
||||
if (ThemeWorker().radare2SpecificOptions.contains(prev.optionName)) {
|
||||
if (ThemeWorker().rizinSpecificOptions.contains(prev.optionName)) {
|
||||
Core()->cmdRaw(QString("ec %1 %2").arg(prev.optionName).arg(prev.color.name()));
|
||||
}
|
||||
|
||||
@ -302,7 +302,7 @@ void ColorThemeListView::blinkTimeout()
|
||||
|
||||
auto updateColor = [](const QString &name, const QColor &color) {
|
||||
Config()->setColor(name, color);
|
||||
if (ThemeWorker().radare2SpecificOptions.contains(name)) {
|
||||
if (ThemeWorker().rizinSpecificOptions.contains(name)) {
|
||||
Core()->cmdRaw(QString("ec %1 %2").arg(name).arg(color.name()));
|
||||
}
|
||||
};
|
||||
|
@ -31,7 +31,7 @@
|
||||
#define STDIN_PIPE_NAME "%1/cutter-stdin-%2"
|
||||
#endif
|
||||
|
||||
#define CONSOLE_R2_INPUT ("R2 Console")
|
||||
#define CONSOLE_RIZIN_INPUT ("Rizin Console")
|
||||
#define CONSOLE_DEBUGEE_INPUT ("Debugee Input")
|
||||
|
||||
static const int invalidHistoryPos = -1;
|
||||
@ -51,7 +51,7 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
|
||||
ui->setupUi(this);
|
||||
|
||||
// Adjust console lineedit
|
||||
ui->r2InputLineEdit->setTextMargins(10, 0, 0, 0);
|
||||
ui->rzInputLineEdit->setTextMargins(10, 0, 0, 0);
|
||||
ui->debugeeInputLineEdit->setTextMargins(10, 0, 0, 0);
|
||||
|
||||
setupFont();
|
||||
@ -94,9 +94,9 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
|
||||
completer->setMaxVisibleItems(20);
|
||||
completer->setCaseSensitivity(Qt::CaseInsensitive);
|
||||
completer->setFilterMode(Qt::MatchStartsWith);
|
||||
ui->r2InputLineEdit->setCompleter(completer);
|
||||
ui->rzInputLineEdit->setCompleter(completer);
|
||||
|
||||
connect(ui->r2InputLineEdit, &QLineEdit::textEdited, this, &ConsoleWidget::updateCompletion);
|
||||
connect(ui->rzInputLineEdit, &QLineEdit::textEdited, this, &ConsoleWidget::updateCompletion);
|
||||
updateCompletion();
|
||||
|
||||
// Set console output context menu
|
||||
@ -104,28 +104,28 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
|
||||
connect(ui->outputTextEdit, &QWidget::customContextMenuRequested,
|
||||
this, &ConsoleWidget::showCustomContextMenu);
|
||||
|
||||
// Esc clears r2InputLineEdit and debugeeInputLineEdit (like OmniBar)
|
||||
QShortcut *r2_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->r2InputLineEdit);
|
||||
connect(r2_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear);
|
||||
r2_clear_shortcut->setContext(Qt::WidgetShortcut);
|
||||
// Esc clears rzInputLineEdit and debugeeInputLineEdit (like OmniBar)
|
||||
QShortcut *rizin_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->rzInputLineEdit);
|
||||
connect(rizin_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear);
|
||||
rizin_clear_shortcut->setContext(Qt::WidgetShortcut);
|
||||
|
||||
QShortcut *debugee_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->debugeeInputLineEdit);
|
||||
connect(debugee_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear);
|
||||
debugee_clear_shortcut->setContext(Qt::WidgetShortcut);
|
||||
|
||||
// Up and down arrows show history
|
||||
historyUpShortcut = new QShortcut(QKeySequence(Qt::Key_Up), ui->r2InputLineEdit);
|
||||
historyUpShortcut = new QShortcut(QKeySequence(Qt::Key_Up), ui->rzInputLineEdit);
|
||||
connect(historyUpShortcut, &QShortcut::activated, this, &ConsoleWidget::historyPrev);
|
||||
historyUpShortcut->setContext(Qt::WidgetShortcut);
|
||||
|
||||
historyDownShortcut = new QShortcut(QKeySequence(Qt::Key_Down), ui->r2InputLineEdit);
|
||||
historyDownShortcut = new QShortcut(QKeySequence(Qt::Key_Down), ui->rzInputLineEdit);
|
||||
connect(historyDownShortcut, &QShortcut::activated, this, &ConsoleWidget::historyNext);
|
||||
historyDownShortcut->setContext(Qt::WidgetShortcut);
|
||||
|
||||
QShortcut *completionShortcut = new QShortcut(QKeySequence(Qt::Key_Tab), ui->r2InputLineEdit);
|
||||
QShortcut *completionShortcut = new QShortcut(QKeySequence(Qt::Key_Tab), ui->rzInputLineEdit);
|
||||
connect(completionShortcut, &QShortcut::activated, this, &ConsoleWidget::triggerCompletion);
|
||||
|
||||
connect(ui->r2InputLineEdit, &QLineEdit::editingFinished, this, &ConsoleWidget::disableCompletion);
|
||||
connect(ui->rzInputLineEdit, &QLineEdit::editingFinished, this, &ConsoleWidget::disableCompletion);
|
||||
|
||||
connect(Config(), &Configuration::fontsUpdated, this, &ConsoleWidget::setupFont);
|
||||
|
||||
@ -138,8 +138,8 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
|
||||
ui->inputCombo->setVisible(true);
|
||||
} else {
|
||||
ui->inputCombo->setVisible(false);
|
||||
// Return to the r2 console
|
||||
ui->inputCombo->setCurrentIndex(ui->inputCombo->findText(CONSOLE_R2_INPUT));
|
||||
// Return to the rizin console
|
||||
ui->inputCombo->setCurrentIndex(ui->inputCombo->findText(CONSOLE_RIZIN_INPUT));
|
||||
}
|
||||
});
|
||||
|
||||
@ -176,7 +176,7 @@ bool ConsoleWidget::eventFilter(QObject *obj, QEvent *event)
|
||||
|
||||
QWidget *ConsoleWidget::widgetToFocusOnRaise()
|
||||
{
|
||||
return ui->r2InputLineEdit;
|
||||
return ui->rzInputLineEdit;
|
||||
}
|
||||
|
||||
void ConsoleWidget::setupFont()
|
||||
@ -200,7 +200,7 @@ void ConsoleWidget::addDebugOutput(const QString &msg)
|
||||
|
||||
void ConsoleWidget::focusInputLineEdit()
|
||||
{
|
||||
ui->r2InputLineEdit->setFocus();
|
||||
ui->rzInputLineEdit->setFocus();
|
||||
}
|
||||
|
||||
void ConsoleWidget::removeLastLine()
|
||||
@ -220,7 +220,7 @@ void ConsoleWidget::executeCommand(const QString &command)
|
||||
if (!commandTask.isNull()) {
|
||||
return;
|
||||
}
|
||||
ui->r2InputLineEdit->setEnabled(false);
|
||||
ui->rzInputLineEdit->setEnabled(false);
|
||||
|
||||
QString cmd_line = "[" + RAddressString(Core()->getOffset()) + "]> " + command;
|
||||
addOutput(cmd_line);
|
||||
@ -234,8 +234,8 @@ void ConsoleWidget::executeCommand(const QString &command)
|
||||
scrollOutputToEnd();
|
||||
historyAdd(command);
|
||||
commandTask.clear();
|
||||
ui->r2InputLineEdit->setEnabled(true);
|
||||
ui->r2InputLineEdit->setFocus();
|
||||
ui->rzInputLineEdit->setEnabled(true);
|
||||
ui->rzInputLineEdit->setFocus();
|
||||
|
||||
if (oldOffset != Core()->getOffset()) {
|
||||
Core()->updateSeek();
|
||||
@ -263,10 +263,10 @@ void ConsoleWidget::onIndexChange()
|
||||
{
|
||||
QString console = ui->inputCombo->currentText();
|
||||
if (console == CONSOLE_DEBUGEE_INPUT) {
|
||||
ui->r2InputLineEdit->setVisible(false);
|
||||
ui->rzInputLineEdit->setVisible(false);
|
||||
ui->debugeeInputLineEdit->setVisible(true);
|
||||
} else if (console == CONSOLE_R2_INPUT) {
|
||||
ui->r2InputLineEdit->setVisible(true);
|
||||
} else if (console == CONSOLE_RIZIN_INPUT) {
|
||||
ui->rzInputLineEdit->setVisible(true);
|
||||
ui->debugeeInputLineEdit->setVisible(false);
|
||||
}
|
||||
}
|
||||
@ -278,14 +278,14 @@ void ConsoleWidget::setWrap(bool wrap)
|
||||
ui->outputTextEdit->setLineWrapMode(wrap ? QPlainTextEdit::WidgetWidth: QPlainTextEdit::NoWrap);
|
||||
}
|
||||
|
||||
void ConsoleWidget::on_r2InputLineEdit_returnPressed()
|
||||
void ConsoleWidget::on_rzInputLineEdit_returnPressed()
|
||||
{
|
||||
QString input = ui->r2InputLineEdit->text();
|
||||
QString input = ui->rzInputLineEdit->text();
|
||||
if (input.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
executeCommand(input);
|
||||
ui->r2InputLineEdit->clear();
|
||||
ui->rzInputLineEdit->clear();
|
||||
}
|
||||
|
||||
void ConsoleWidget::on_debugeeInputLineEdit_returnPressed()
|
||||
@ -300,7 +300,7 @@ void ConsoleWidget::on_debugeeInputLineEdit_returnPressed()
|
||||
|
||||
void ConsoleWidget::on_execButton_clicked()
|
||||
{
|
||||
on_r2InputLineEdit_returnPressed();
|
||||
on_rzInputLineEdit_returnPressed();
|
||||
}
|
||||
|
||||
void ConsoleWidget::showCustomContextMenu(const QPoint &pt)
|
||||
@ -324,9 +324,9 @@ void ConsoleWidget::historyNext()
|
||||
--lastHistoryPosition;
|
||||
|
||||
if (lastHistoryPosition >= 0) {
|
||||
ui->r2InputLineEdit->setText(history.at(lastHistoryPosition));
|
||||
ui->rzInputLineEdit->setText(history.at(lastHistoryPosition));
|
||||
} else {
|
||||
ui->r2InputLineEdit->clear();
|
||||
ui->rzInputLineEdit->clear();
|
||||
}
|
||||
|
||||
|
||||
@ -341,7 +341,7 @@ void ConsoleWidget::historyPrev()
|
||||
lastHistoryPosition = history.size() - 2;
|
||||
}
|
||||
|
||||
ui->r2InputLineEdit->setText(history.at(++lastHistoryPosition));
|
||||
ui->rzInputLineEdit->setText(history.at(++lastHistoryPosition));
|
||||
}
|
||||
}
|
||||
|
||||
@ -372,7 +372,7 @@ void ConsoleWidget::updateCompletion()
|
||||
return;
|
||||
}
|
||||
|
||||
auto current = ui->r2InputLineEdit->text();
|
||||
auto current = ui->rzInputLineEdit->text();
|
||||
auto completions = Core()->autocomplete(current, RZ_LINE_PROMPT_DEFAULT);
|
||||
int lastSpace = current.lastIndexOf(' ');
|
||||
if (lastSpace >= 0) {
|
||||
@ -387,14 +387,14 @@ void ConsoleWidget::updateCompletion()
|
||||
void ConsoleWidget::clear()
|
||||
{
|
||||
disableCompletion();
|
||||
ui->r2InputLineEdit->clear();
|
||||
ui->rzInputLineEdit->clear();
|
||||
ui->debugeeInputLineEdit->clear();
|
||||
|
||||
invalidateHistoryPosition();
|
||||
|
||||
// Close the potential shown completer popup
|
||||
ui->r2InputLineEdit->clearFocus();
|
||||
ui->r2InputLineEdit->setFocus();
|
||||
ui->rzInputLineEdit->clearFocus();
|
||||
ui->rzInputLineEdit->setFocus();
|
||||
}
|
||||
|
||||
void ConsoleWidget::scrollOutputToEnd()
|
||||
@ -443,7 +443,7 @@ void ConsoleWidget::redirectOutput()
|
||||
{
|
||||
// Make sure that we are running in a valid console with initialized output handles
|
||||
if (0 > fileno(stderr) && 0 > fileno(stdout)) {
|
||||
addOutput("Run cutter in a console to enable r2 output redirection into this widget.");
|
||||
addOutput("Run cutter in a console to enable rizin output redirection into this widget.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ public slots:
|
||||
private slots:
|
||||
void setupFont();
|
||||
|
||||
void on_r2InputLineEdit_returnPressed();
|
||||
void on_rzInputLineEdit_returnPressed();
|
||||
void on_debugeeInputLineEdit_returnPressed();
|
||||
void onIndexChange();
|
||||
|
||||
|
@ -90,7 +90,7 @@
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>R2 Console</string>
|
||||
<string>Rizin Console</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
@ -101,7 +101,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="r2InputLineEdit">
|
||||
<widget class="QLineEdit" name="rzInputLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
|
@ -335,40 +335,40 @@ void CutterGraphView::exportGraph(QString filePath, GraphExportType type, QStrin
|
||||
break;
|
||||
|
||||
case GraphExportType::GVDot:
|
||||
exportR2TextGraph(filePath, graphCommand + "d", address);
|
||||
exportRzTextGraph(filePath, graphCommand + "d", address);
|
||||
break;
|
||||
case GraphExportType::R2Json:
|
||||
exportR2TextGraph(filePath, graphCommand + "j", address);
|
||||
case GraphExportType::RzJson:
|
||||
exportRzTextGraph(filePath, graphCommand + "j", address);
|
||||
break;
|
||||
case GraphExportType::R2Gml:
|
||||
exportR2TextGraph(filePath, graphCommand + "g", address);
|
||||
case GraphExportType::RzGml:
|
||||
exportRzTextGraph(filePath, graphCommand + "g", address);
|
||||
break;
|
||||
case GraphExportType::R2SDBKeyValue:
|
||||
exportR2TextGraph(filePath, graphCommand + "k", address);
|
||||
case GraphExportType::RzSDBKeyValue:
|
||||
exportRzTextGraph(filePath, graphCommand + "k", address);
|
||||
break;
|
||||
|
||||
case GraphExportType::GVJson:
|
||||
exportR2GraphvizGraph(filePath, "json", graphCommand, address);
|
||||
exportRizinGraphvizGraph(filePath, "json", graphCommand, address);
|
||||
break;
|
||||
case GraphExportType::GVGif:
|
||||
exportR2GraphvizGraph(filePath, "gif", graphCommand, address);
|
||||
exportRizinGraphvizGraph(filePath, "gif", graphCommand, address);
|
||||
break;
|
||||
case GraphExportType::GVPng:
|
||||
exportR2GraphvizGraph(filePath, "png", graphCommand, address);
|
||||
exportRizinGraphvizGraph(filePath, "png", graphCommand, address);
|
||||
break;
|
||||
case GraphExportType::GVJpeg:
|
||||
exportR2GraphvizGraph(filePath, "jpg", graphCommand, address);
|
||||
exportRizinGraphvizGraph(filePath, "jpg", graphCommand, address);
|
||||
break;
|
||||
case GraphExportType::GVPostScript:
|
||||
exportR2GraphvizGraph(filePath, "ps", graphCommand, address);
|
||||
exportRizinGraphvizGraph(filePath, "ps", graphCommand, address);
|
||||
break;
|
||||
case GraphExportType::GVSvg:
|
||||
exportR2GraphvizGraph(filePath, "svg", graphCommand, address);
|
||||
exportRizinGraphvizGraph(filePath, "svg", graphCommand, address);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void CutterGraphView::exportR2GraphvizGraph(QString filePath, QString type, QString graphCommand,
|
||||
void CutterGraphView::exportRizinGraphvizGraph(QString filePath, QString type, QString graphCommand,
|
||||
RVA address)
|
||||
{
|
||||
TempConfig tempConfig;
|
||||
@ -376,7 +376,7 @@ void CutterGraphView::exportR2GraphvizGraph(QString filePath, QString type, QStr
|
||||
qWarning() << Core()->cmdRawAt(QString("%0w \"%1\"").arg(graphCommand).arg(filePath), address);
|
||||
}
|
||||
|
||||
void CutterGraphView::exportR2TextGraph(QString filePath, QString graphCommand, RVA address)
|
||||
void CutterGraphView::exportRzTextGraph(QString filePath, QString graphCommand, RVA address)
|
||||
{
|
||||
QFile file(filePath);
|
||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
@ -412,13 +412,13 @@ void CutterGraphView::showExportGraphDialog(QString defaultName, QString graphCo
|
||||
{tr("SVG (*.svg)"), "svg", QVariant::fromValue(GraphExportType::Svg)}
|
||||
};
|
||||
|
||||
bool r2GraphExports = !graphCommand.isEmpty();
|
||||
if (r2GraphExports) {
|
||||
bool rzGraphExports = !graphCommand.isEmpty();
|
||||
if (rzGraphExports) {
|
||||
types.append({
|
||||
{tr("Graphviz dot (*.dot)"), "dot", QVariant::fromValue(GraphExportType::GVDot)},
|
||||
{tr("Graph Modelling Language (*.gml)"), "gml", QVariant::fromValue(GraphExportType::R2Gml)},
|
||||
{tr("R2 JSON (*.json)"), "json", QVariant::fromValue(GraphExportType::R2Json)},
|
||||
{tr("SDB key-value (*.txt)"), "txt", QVariant::fromValue(GraphExportType::R2SDBKeyValue)},
|
||||
{tr("Graph Modelling Language (*.gml)"), "gml", QVariant::fromValue(GraphExportType::RzGml)},
|
||||
{tr("RZ JSON (*.json)"), "json", QVariant::fromValue(GraphExportType::RzJson)},
|
||||
{tr("SDB key-value (*.txt)"), "txt", QVariant::fromValue(GraphExportType::RzSDBKeyValue)},
|
||||
});
|
||||
bool hasGraphviz = !QStandardPaths::findExecutable("dot").isEmpty()
|
||||
|| !QStandardPaths::findExecutable("xdot").isEmpty();
|
||||
|
@ -25,40 +25,40 @@ public:
|
||||
enum class GraphExportType {
|
||||
Png, Jpeg, Svg, GVDot, GVJson,
|
||||
GVGif, GVPng, GVJpeg, GVPostScript, GVSvg,
|
||||
R2Gml, R2SDBKeyValue, R2Json
|
||||
RzGml, RzSDBKeyValue, RzJson
|
||||
};
|
||||
/**
|
||||
* @brief Export graph to a file in the specified format
|
||||
* @param filePath
|
||||
* @param type export type, GV* and R2* types require \p graphCommand
|
||||
* @param graphCommand r2 graph printing command without type, not required for direct image export
|
||||
* @param type export type, GV* and Rz* types require \p graphCommand
|
||||
* @param graphCommand rizin graph printing command without type, not required for direct image export
|
||||
* @param address object address for commands like agf
|
||||
*/
|
||||
void exportGraph(QString filePath, GraphExportType type, QString graphCommand = "",
|
||||
RVA address = RVA_INVALID);
|
||||
/**
|
||||
* @brief Export image using r2 ag*w command and graphviz.
|
||||
* @brief Export image using rizin ag*w command and graphviz.
|
||||
* Requires graphviz dot executable in the path.
|
||||
*
|
||||
* @param filePath output file path
|
||||
* @param type image format as expected by "e graph.gv.format"
|
||||
* @param graphCommand r2 command without type, for example agf
|
||||
* @param graphCommand rizin command without type, for example agf
|
||||
* @param address object address if required by command
|
||||
*/
|
||||
void exportR2GraphvizGraph(QString filePath, QString type, QString graphCommand, RVA address);
|
||||
void exportRizinGraphvizGraph(QString filePath, QString type, QString graphCommand, RVA address);
|
||||
/**
|
||||
* @brief Export graph in one of the text formats supported by r2 json, gml, SDB key-value
|
||||
* @brief Export graph in one of the text formats supported by rizin json, gml, SDB key-value
|
||||
* @param filePath output file path
|
||||
* @param graphCommand graph command including the format, example "agfd" or "agfg"
|
||||
* @param address object address if required by command
|
||||
*/
|
||||
void exportR2TextGraph(QString filePath, QString graphCommand, RVA address);
|
||||
void exportRzTextGraph(QString filePath, QString graphCommand, RVA address);
|
||||
static bool graphIsBitamp(GraphExportType type);
|
||||
/**
|
||||
* @brief Show graph export dialog.
|
||||
* @param defaultName - default file name in the export dialog
|
||||
* @param graphCommand - R2 graph commmand with graph type and without export type, for example afC. Leave empty
|
||||
* for non-r2 graphs. In such case only direct image export will be available.
|
||||
* @param graphCommand - rizin graph commmand with graph type and without export type, for example afC. Leave empty
|
||||
* for non-rizin graphs. In such case only direct image export will be available.
|
||||
* @param address - object address if relevant for \p graphCommand
|
||||
*/
|
||||
void showExportGraphDialog(QString defaultName, QString graphCommand = "",
|
||||
@ -76,7 +76,7 @@ public slots:
|
||||
void zoomReset();
|
||||
|
||||
/**
|
||||
* @brief Show the export file dialog. Override this to support r2 based export formats.
|
||||
* @brief Show the export file dialog. Override this to support rizin based export formats.
|
||||
*/
|
||||
virtual void showExportDialog();
|
||||
signals:
|
||||
|
@ -209,7 +209,7 @@ void DebugActions::showDebugWarning()
|
||||
QMessageBox msgBox;
|
||||
msgBox.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
|
||||
msgBox.setText(tr("Debug is currently in beta.\n") +
|
||||
tr("If you encounter any problems or have suggestions, please submit an issue to https://github.com/radareorg/cutter/issues"));
|
||||
tr("If you encounter any problems or have suggestions, please submit an issue to https://github.com/rizinorg/cutter/issues"));
|
||||
msgBox.exec();
|
||||
}
|
||||
}
|
||||
|
@ -544,7 +544,7 @@ void FunctionsWidget::onActionFunctionsRenameTriggered()
|
||||
tr("Function name:"), QLineEdit::Normal, function.name, &ok);
|
||||
// If user accepted
|
||||
if (ok && !newName.isEmpty()) {
|
||||
// Rename function in r2 core
|
||||
// Rename function in rizin core
|
||||
Core()->renameFunction(function.offset, newName);
|
||||
|
||||
// Seek to new renamed function
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
int y = 0;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
// This is a unique identifier, e.g. offset in the case of r2 blocks
|
||||
// This is a unique identifier, e.g. offset in the case of rizin blocks
|
||||
ut64 entry;
|
||||
// Edges
|
||||
std::vector<GraphEdge> edges;
|
||||
|
@ -1,14 +1,14 @@
|
||||
#include "R2GraphWidget.h"
|
||||
#include "ui_R2GraphWidget.h"
|
||||
#include "RizinGraphWidget.h"
|
||||
#include "ui_RizinGraphWidget.h"
|
||||
|
||||
#include <QJsonValue>
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
||||
R2GraphWidget::R2GraphWidget(MainWindow *main)
|
||||
RizinGraphWidget::RizinGraphWidget(MainWindow *main)
|
||||
: CutterDockWidget(main)
|
||||
, ui(new Ui::R2GraphWidget)
|
||||
, graphView(new GenericR2GraphView(this, main))
|
||||
, ui(new Ui::RizinGraphWidget)
|
||||
, graphView(new GenericRizinGraphView(this, main))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->verticalLayout->addWidget(graphView);
|
||||
@ -39,7 +39,7 @@ R2GraphWidget::R2GraphWidget(MainWindow *main)
|
||||
}
|
||||
|
||||
}
|
||||
connect<void(QComboBox::*)(int)>(ui->graphType, &QComboBox::currentIndexChanged, this, &R2GraphWidget::typeChanged);
|
||||
connect<void(QComboBox::*)(int)>(ui->graphType, &QComboBox::currentIndexChanged, this, &RizinGraphWidget::typeChanged);
|
||||
connect(ui->customCommand, &QLineEdit::textEdited, this, [this](){
|
||||
graphView->setGraphCommand(ui->customCommand->text());
|
||||
});
|
||||
@ -51,11 +51,11 @@ R2GraphWidget::R2GraphWidget(MainWindow *main)
|
||||
typeChanged();
|
||||
}
|
||||
|
||||
R2GraphWidget::~R2GraphWidget()
|
||||
RizinGraphWidget::~RizinGraphWidget()
|
||||
{
|
||||
}
|
||||
|
||||
void R2GraphWidget::typeChanged()
|
||||
void RizinGraphWidget::typeChanged()
|
||||
{
|
||||
auto currentData = ui->graphType->currentData();
|
||||
if (currentData.isNull()) {
|
||||
@ -70,20 +70,20 @@ void R2GraphWidget::typeChanged()
|
||||
}
|
||||
}
|
||||
|
||||
GenericR2GraphView::GenericR2GraphView(R2GraphWidget *parent, MainWindow *main)
|
||||
GenericRizinGraphView::GenericRizinGraphView(RizinGraphWidget *parent, MainWindow *main)
|
||||
: SimpleTextGraphView(parent, main)
|
||||
, refreshDeferrer(nullptr, this)
|
||||
{
|
||||
refreshDeferrer.registerFor(parent);
|
||||
connect(&refreshDeferrer, &RefreshDeferrer::refreshNow, this, &GenericR2GraphView::refreshView);
|
||||
connect(&refreshDeferrer, &RefreshDeferrer::refreshNow, this, &GenericRizinGraphView::refreshView);
|
||||
}
|
||||
|
||||
void GenericR2GraphView::setGraphCommand(QString cmd)
|
||||
void GenericRizinGraphView::setGraphCommand(QString cmd)
|
||||
{
|
||||
graphCommand = cmd;
|
||||
}
|
||||
|
||||
void GenericR2GraphView::refreshView()
|
||||
void GenericRizinGraphView::refreshView()
|
||||
{
|
||||
if (!refreshDeferrer.attemptRefresh(nullptr)) {
|
||||
return;
|
||||
@ -91,7 +91,7 @@ void GenericR2GraphView::refreshView()
|
||||
SimpleTextGraphView::refreshView();
|
||||
}
|
||||
|
||||
void GenericR2GraphView::loadCurrentGraph()
|
||||
void GenericRizinGraphView::loadCurrentGraph()
|
||||
{
|
||||
blockContent.clear();
|
||||
blocks.clear();
|
@ -1,5 +1,5 @@
|
||||
#ifndef R2_GRAPH_WIDGET_H
|
||||
#define R2_GRAPH_WIDGET_H
|
||||
#ifndef RZ_GRAPH_WIDGET_H
|
||||
#define RZ_GRAPH_WIDGET_H
|
||||
|
||||
#include <memory>
|
||||
|
||||
@ -11,14 +11,14 @@
|
||||
class MainWindow;
|
||||
|
||||
namespace Ui {
|
||||
class R2GraphWidget;
|
||||
class RizinGraphWidget;
|
||||
}
|
||||
|
||||
class R2GraphWidget;
|
||||
class RizinGraphWidget;
|
||||
|
||||
/**
|
||||
* @brief Generic graph view for r2 graphs.
|
||||
* Not all r2 graph commands output the same kind of json. Only those that have following format
|
||||
* @brief Generic graph view for rizin graphs.
|
||||
* Not all rizin graph commands output the same kind of json. Only those that have following format
|
||||
* @code{.json}
|
||||
* { "nodes": [
|
||||
* {
|
||||
@ -31,14 +31,14 @@ class R2GraphWidget;
|
||||
* ]}
|
||||
* @endcode
|
||||
* Id don't have to be sequential. Simple text label is displayed containing concatenation of
|
||||
* label and body. No r2 builtin graph uses both. Duplicate edges and edges with target id
|
||||
* label and body. No rizin builtin graph uses both. Duplicate edges and edges with target id
|
||||
* not present in the list of nodes are removed.
|
||||
*/
|
||||
class GenericR2GraphView : public SimpleTextGraphView
|
||||
class GenericRizinGraphView : public SimpleTextGraphView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
GenericR2GraphView(R2GraphWidget *parent, MainWindow *main);
|
||||
GenericRizinGraphView(RizinGraphWidget *parent, MainWindow *main);
|
||||
void setGraphCommand(QString cmd);
|
||||
void refreshView() override;
|
||||
protected:
|
||||
@ -50,19 +50,19 @@ private:
|
||||
};
|
||||
|
||||
|
||||
class R2GraphWidget : public CutterDockWidget
|
||||
class RizinGraphWidget : public CutterDockWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit R2GraphWidget(MainWindow *main);
|
||||
~R2GraphWidget();
|
||||
explicit RizinGraphWidget(MainWindow *main);
|
||||
~RizinGraphWidget();
|
||||
|
||||
private:
|
||||
std::unique_ptr<Ui::R2GraphWidget> ui;
|
||||
GenericR2GraphView *graphView;
|
||||
std::unique_ptr<Ui::RizinGraphWidget> ui;
|
||||
GenericRizinGraphView *graphView;
|
||||
|
||||
void typeChanged();
|
||||
};
|
||||
|
||||
#endif // R2_GRAPH_WIDGET_H
|
||||
#endif // RZ_GRAPH_WIDGET_H
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>R2GraphWidget</class>
|
||||
<widget class="QDockWidget" name="R2GraphWidget">
|
||||
<class>RizinGraphWidget</class>
|
||||
<widget class="QDockWidget" name="RizinGraphWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">R2 graphs</string>
|
||||
<string notr="true">Rizin graphs</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="dockWidgetContents">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
Loading…
Reference in New Issue
Block a user