More R2/Radare -> Rizin renames (#2516)

This commit is contained in:
Anton Kochkov 2020-12-16 18:59:23 +08:00 committed by GitHub
parent 58745547a2
commit 70cef2c1af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 464 additions and 464 deletions

View File

@ -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. Make a clear description of the bug/feature, use screenshots, send binaries, etc.
This will help us improve the software for you. 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 ## Contributing to the code
Note that cutter is still under development and many parts of the code are to be improved. 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 Please follow our contribution guidelines: https://cutter.re/docs/contributing.html
## Contributing to the documentation ## 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. 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 ## 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.

View File

@ -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. **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.

View File

@ -10,7 +10,7 @@ IF !ERRORLEVEL! NEQ 0 (
EXIT /B 1 EXIT /B 1
) )
SET "R2DIST=r2_dist" SET "RZDIST=rz_dist"
SET "BUILDDIR=build_%PLATFORM%" SET "BUILDDIR=build_%PLATFORM%"
SET "BREAKPAD_SOURCE_DIR=%CD%\src\breakpad\src\src" SET "BREAKPAD_SOURCE_DIR=%CD%\src\breakpad\src\src"
@ -36,10 +36,10 @@ IF !ERRORLEVEL! NEQ 0 EXIT /B 1
ECHO Deploying cutter ECHO Deploying cutter
MKDIR cutter MKDIR cutter
COPY release\cutter.exe cutter\cutter.exe COPY release\cutter.exe cutter\cutter.exe
XCOPY /S /I ..\%R2DIST%\share cutter\share XCOPY /S /I ..\%RZDIST%\share cutter\share
XCOPY /S /I ..\%R2DIST%\lib cutter\lib XCOPY /S /I ..\%RZDIST%\lib cutter\lib
DEL cutter\lib\*.lib DEL cutter\lib\*.lib
COPY ..\%R2DIST%\bin\*.dll cutter\ COPY ..\%RZDIST%\bin\*.dll cutter\
windeployqt cutter\cutter.exe windeployqt cutter\cutter.exe
FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" cutter\translations FOR %%i in (..\src\translations\*.qm) DO MOVE "%%~fi" cutter\translations

View File

@ -10,12 +10,12 @@ BUILD="$(pwd)/build"
QMAKE_CONF=$* QMAKE_CONF=$*
ROOT_DIR=$(pwd) ROOT_DIR=$(pwd)
check_r2() { check_rizin() {
r2 -v >/dev/null 2>&1 rizin -v >/dev/null 2>&1
if [ $? = 0 ]; then if [ $? = 0 ]; then
R2COMMIT=$(r2 -v | tail -n1 | sed "s,commit: \\(.*\\) build.*,\\1,") RZCOMMIT=$(rizin -v | tail -n1 | sed "s,commit: \\(.*\\) build.*,\\1,")
SUBMODULE=$(git submodule | grep "radare2" | awk '{print $1}') SUBMODULE=$(git submodule | grep "rizin" | awk '{print $1}')
if [ "$R2COMMIT" = "$SUBMODULE" ]; then if [ "$RZCOMMIT" = "$SUBMODULE" ]; then
return 0 return 0
fi fi
fi fi
@ -78,23 +78,23 @@ prepare_breakpad() {
fi fi
} }
# Build radare2 # Build rizin
check_r2 check_rizin
if [ $? -eq 1 ]; then 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 read -r answer
if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then if [ -z "$answer" ] || [ "$answer" = "Y" ] || [ "$answer" = "y" ]; then
R2PREFIX=${1:-"/usr"} RZPREFIX=${1:-"/usr"}
git submodule init && git submodule update git submodule init && git submodule update
cd radare2 || exit 1 cd rizin || exit 1
./sys/install.sh "$R2PREFIX" ./sys/install.sh "$RZPREFIX"
cd .. cd ..
else else
echo "Sorry but this script won't work otherwise. Read the README." echo "Sorry but this script won't work otherwise. Read the README."
exit 1 exit 1
fi fi
else else
echo "Correct radare2 version found, skipping..." echo "Correct rizin version found, skipping..."
fi fi
# Create translations # Create translations

View File

@ -59,7 +59,7 @@ if(WIN32)
set(Rizin_LIBRARIES_VARS "") set(Rizin_LIBRARIES_VARS "")
foreach(libname ${Rizin_LIBRARY_NAMES}) foreach(libname ${Rizin_LIBRARY_NAMES})
find_library(Rizin_LIBRARY_${libname} find_library(Rizin_LIBRARY_${libname}
r_${libname} rz_${libname}
HINTS HINTS
"$ENV{HOME}/bin/prefix/rizin/lib" "$ENV{HOME}/bin/prefix/rizin/lib"
/usr/local/lib /usr/local/lib
@ -79,7 +79,7 @@ if(WIN32)
INTERFACE_INCLUDE_DIRECTORIES "${Rizin_INCLUDE_DIRS}") INTERFACE_INCLUDE_DIRECTORIES "${Rizin_INCLUDE_DIRS}")
set(Rizin_TARGET Rizin::librz) set(Rizin_TARGET Rizin::librz)
else() 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) if(CUTTER_USE_ADDITIONAL_RIZIN_PATHS)
set(Rizin_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH}) set(Rizin_CMAKE_PREFIX_PATH_TEMP ${CMAKE_PREFIX_PATH})
list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/bin/prefix/rizin") # sys/user.sh list(APPEND CMAKE_PREFIX_PATH "$ENV{HOME}/bin/prefix/rizin") # sys/user.sh

View File

@ -2,7 +2,7 @@ $dist = $args[0]
$python = Split-Path((Get-Command python.exe).Path) $python = Split-Path((Get-Command python.exe).Path)
if (-not (Test-Path -Path 'r2dec-js' -PathType Container)) { 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 cd r2dec-js
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d #git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d

View File

@ -21,7 +21,7 @@ RUN apk add --no-cache \
wget wget
# Get, compile and test Cutter from master branch # 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 && \ RUN cd /opt/cutter && \
bash build.sh && \ bash build.sh && \
bash -c 'if [[ ! -x "/opt/cutter/build/Cutter" ]]; then exit -1; fi' bash -c 'if [[ ! -x "/opt/cutter/build/Cutter" ]]; then exit -1; fi'
@ -38,25 +38,25 @@ RUN apk add --no-cache \
shadow \ shadow \
su-exec 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 /opt/cutter /opt/cutter
COPY --from=builder /usr/lib /usr/lib COPY --from=builder /usr/lib /usr/lib
COPY --from=builder /usr/share/radare2 /usr/share/radare2 COPY --from=builder /usr/share/rizin /usr/share/rizin
RUN cd /opt/cutter/radare2/binr && \ RUN cd /opt/cutter/rizin/binr && \
make install && \ make install && \
make symstall install-symlink make symstall install-symlink
# Add r2 user # Add rizin user
RUN useradd r2 RUN useradd rizin
# Prepare files to mount configurations later on # Prepare files to mount configurations later on
RUN mkdir /var/sharedFolder && \ RUN mkdir /var/sharedFolder && \
mkdir -p /home/r2/.config/radare2 && \ mkdir -p /home/rizin/.config/rizin && \
touch /home/r2/.radare2rc && \ touch /home/rizin/.rizinrc && \
chown -R r2:r2 /var/sharedFolder && \ chown -R rizin:rizin /var/sharedFolder && \
chown -R r2:r2 /home/r2/ chown -R rizin:rizin /home/rizin/
WORKDIR /home/r2 WORKDIR /home/rizin
ADD entrypoint.sh /usr/local/bin/entrypoint.sh ADD entrypoint.sh /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

View File

@ -22,12 +22,12 @@ RUN apk add --no-cache \
unzip \ unzip \
wget wget
# install radare2 first # install rizin first
COPY docker/build_radare2.sh /opt/cutter/ COPY docker/build_rizin.sh /opt/cutter/
COPY radare2 /opt/cutter/radare2 COPY rizin /opt/cutter/rizin
WORKDIR /opt/cutter WORKDIR /opt/cutter
RUN bash build_radare2.sh RUN bash build_rizin.sh
COPY docker/build_cutter.sh /opt/cutter/ COPY docker/build_cutter.sh /opt/cutter/
COPY scripts /opt/cutter/scripts COPY scripts /opt/cutter/scripts
@ -49,22 +49,22 @@ RUN apk add --no-cache \
shadow \ shadow \
su-exec su-exec
# Add r2 user # Add rizin user
RUN useradd r2 RUN useradd rizin
# Prepare files to mount configurations later on # Prepare files to mount configurations later on
RUN mkdir /var/sharedFolder && \ RUN mkdir /var/sharedFolder && \
mkdir -p /home/r2/.config/radare2 && \ mkdir -p /home/rizin/.config/rizin && \
touch /home/r2/.radare2rc && \ touch /home/rizin/.rizinrc && \
chown -R r2:r2 /var/sharedFolder && \ chown -R rizin:rizin /var/sharedFolder && \
chown -R r2:r2 /home/r2/ chown -R rizin:rizin /home/rizin/
COPY ./docker/entrypoint.sh /usr/local/bin/entrypoint.sh 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 /opt/cutter /opt/cutter
COPY --from=builder /usr/lib /usr/lib COPY --from=builder /usr/lib /usr/lib
COPY --from=builder /usr/share/radare2 /usr/share/radare2 COPY --from=builder /usr/share/rizin /usr/share/rizin
WORKDIR /opt/cutter/radare2/binr WORKDIR /opt/cutter/rizin/binrz
RUN make install && \ RUN make install && \
make symstall install-symlink make symstall install-symlink

View File

@ -9,12 +9,12 @@ LGID := $(shell id -g)
# To mount a specific binary using BINARY=/absolute/path/to/binary # To mount a specific binary using BINARY=/absolute/path/to/binary
ifdef BINARY ifdef BINARY
MOUNTFLAGS += -v $(BINARY):/home/r2/$(shell basename $(BINARY)):ro MOUNTFLAGS += -v $(BINARY):/home/rizin/$(shell basename $(BINARY)):ro
RUNFLAGS += /home/r2/$(shell basename $(BINARY)) RUNFLAGS += /home/rizin/$(shell basename $(BINARY))
endif endif
VERSION ?= latest VERSION ?= latest
IMAGE_NAME ?= radareorg/cutter IMAGE_NAME ?= rizinorg/cutter
CONTAINER_NAME ?= cutter CONTAINER_NAME ?= cutter
LOCAL_DEV ?= n LOCAL_DEV ?= n
@ -37,11 +37,11 @@ build-nc: ## Build the container without caching
run: ## Run container run: ## Run container
XSOCK=/tmp/.X11-unix && \ 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 - && \ xauth nlist $$DISPLAY | sed -e 's/^..../ffff/' | xauth -f $$XAUTH nmerge - && \
chmod 644 $$XAUTH && \ chmod 644 $$XAUTH && \
touch $(DIR)/radare2rc && \ touch $(DIR)/rizinrc && \
mkdir -p $(DIR)/r2-config && \ mkdir -p $(DIR)/rizin-config && \
mkdir -p $(DIR)/sharedFolder && \ mkdir -p $(DIR)/sharedFolder && \
sudo docker run \ sudo docker run \
-it \ -it \
@ -55,8 +55,8 @@ run: ## Run container
-v $$XAUTH:$$XAUTH \ -v $$XAUTH:$$XAUTH \
$(MOUNTFLAGS) \ $(MOUNTFLAGS) \
-v $(DIR)/sharedFolder:/var/sharedFolder \ -v $(DIR)/sharedFolder:/var/sharedFolder \
-v $(DIR)/radare2rc:/home/r2/.radare2rc \ -v $(DIR)/rizinrc:/home/rizin/.rizinrc \
-v $(DIR)/r2-config:/home/r2/.config/radare2 \ -v $(DIR)/rizin-config:/home/rizin/.config/rizin \
$(IMAGE_NAME):$(VERSION) $(RUNFLAGS) && \ $(IMAGE_NAME):$(VERSION) $(RUNFLAGS) && \
rm $$XAUTH rm $$XAUTH

View File

@ -1,9 +1,9 @@
# Docker Configuration for Cutter # 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). - 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. - 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 ## Using Local Files
@ -16,5 +16,5 @@ The `Makefile` allows mounting a single binary file as read-only, which will als
## Additional Notes ## 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`. - To check for more options of the `Makefile`, execute `make`.

View File

@ -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
View 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

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
USERNAME="r2" USERNAME="rizin"
echo "Cutter: Starting with UID:GID $LOCAL_USER_ID:$LOCAL_GROUP_ID" echo "Cutter: Starting with UID:GID $LOCAL_USER_ID:$LOCAL_GROUP_ID"
usermod -u $LOCAL_USER_ID $USERNAME usermod -u $LOCAL_USER_ID $USERNAME

View File

@ -70,12 +70,12 @@ Options
.. option:: --no-plugins .. 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 .. option:: --no-cutter-plugins
Start cutter with cutter plugins disabled. 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.

View File

@ -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. 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.

View File

@ -7,7 +7,7 @@ cutter_commit="$(git show -s --format="%H %s")"
echo "Cloning current cutter.re" 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" echo "Updating docs"
@ -25,6 +25,6 @@ fi
git add . || exit 1 git add . || exit 1
git diff --cached --quiet && echo "No changes." && exit 0 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 git push origin master || exit 1

View File

@ -27,6 +27,6 @@ git add Translations.ts
git commit -m "Updated translations" git commit -m "Updated translations"
log "Pushing..." log "Pushing..."
export GIT_SSH_COMMAND="/usr/bin/ssh -i $TRAVIS_BUILD_DIR/scripts/deploy_translations_rsa" 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!" log "Script done!"

View File

@ -5,15 +5,15 @@ mkdir -p cutter-deps && cd cutter-deps
LINUX_FILE="cutter-deps-linux.tar.gz" LINUX_FILE="cutter-deps-linux.tar.gz"
LINUX_MD5=31fd19443a3405d6b6097cbbd4c11fba 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_FILE="cutter-deps-macos.tar.gz"
MACOS_MD5=e75041c04fc806437723a399028402af 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_FILE="cutter-deps-win.tar.gz"
WIN_MD5=7c755404140f2e9945bfc13d2e645bb1 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 if [ "$OS" == "Windows_NT" ]; then
FILE="${WIN_FILE}" FILE="${WIN_FILE}"

View 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 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 sed -i ".original" "s/#define HAVE_GETENTROPY 1/#define HAVE_GETENTROPY 0/" pyconfig.h
make -j4 || exit 1 make -j4 || exit 1

View File

@ -7,7 +7,7 @@ SCRIPTPATH=$(realpath "$(dirname "${BASH_SOURCE[0]}")")
cd "$SCRIPTPATH/.." cd "$SCRIPTPATH/.."
if [[ ! -d r2dec-js ]]; then 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 #cd r2dec-js
#git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d #git checkout b5a0d15c7bcc488f268ffb0931b7ced2919f6c9d
#cd .. #cd ..
@ -16,7 +16,7 @@ fi
cd r2dec-js cd r2dec-js
rm -rf build rm -rf build
mkdir build && cd 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
ninja install ninja install

View File

@ -15,7 +15,7 @@ else:
fetch_deps_path = os.path.join(os.path.dirname(sys.argv[0]), "fetch_deps.sh") fetch_deps_path = os.path.join(os.path.dirname(sys.argv[0]), "fetch_deps.sh")
print("Fetching latest release") 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"] release_url = json["assets"][0]["browser_download_url"]
for platform in platforms: for platform in platforms:

View File

@ -176,7 +176,7 @@ endforeach()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
install (FILES "img/cutter.svg" install (FILES "img/cutter.svg"
DESTINATION "share/icons/hicolor/scalable/apps/") DESTINATION "share/icons/hicolor/scalable/apps/")
install(FILES "org.radare.Cutter.desktop" install(FILES "org.rizin.Cutter.desktop"
DESTINATION "share/applications" DESTINATION "share/applications"
COMPONENT Devel) COMPONENT Devel)
endif() endif()

View File

@ -54,14 +54,14 @@ equals(CUTTER_ENABLE_PYTHON, true) {
} }
} }
!defined(CUTTER_BUNDLE_R2_APPBUNDLE, var) CUTTER_BUNDLE_R2_APPBUNDLE=false !defined(CUTTER_BUNDLE_RZ_APPBUNDLE, var) CUTTER_BUNDLE_RZ_APPBUNDLE=false
equals(CUTTER_BUNDLE_R2_APPBUNDLE, true) CONFIG += CUTTER_BUNDLE_R2_APPBUNDLE equals(CUTTER_BUNDLE_RZ_APPBUNDLE, true) CONFIG += CUTTER_BUNDLE_RZ_APPBUNDLE
!defined(CUTTER_APPVEYOR_R2DEC, var) CUTTER_APPVEYOR_R2DEC=false !defined(CUTTER_APPVEYOR_R2DEC, var) CUTTER_APPVEYOR_R2DEC=false
equals(CUTTER_APPVEYOR_R2DEC, true) CONFIG += CUTTER_APPVEYOR_R2DEC equals(CUTTER_APPVEYOR_R2DEC, true) CONFIG += CUTTER_APPVEYOR_R2DEC
!defined(CUTTER_R2GHIDRA_STATIC, var) CUTTER_R2GHIDRA_STATIC=false !defined(CUTTER_RZGHIDRA_STATIC, var) CUTTER_RZGHIDRA_STATIC=false
equals(CUTTER_R2GHIDRA_STATIC, true) CONFIG += CUTTER_R2GHIDRA_STATIC equals(CUTTER_RZGHIDRA_STATIC, true) CONFIG += CUTTER_RZGHIDRA_STATIC
DEFINES += CUTTER_SOURCE_BUILD DEFINES += CUTTER_SOURCE_BUILD
@ -108,7 +108,7 @@ win32 {
macx { macx {
QMAKE_CXXFLAGS = -mmacosx-version-min=10.7 -std=gnu0x -stdlib=libc++ 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_BUNDLE = cutter
QMAKE_INFO_PLIST = macos/Info.plist QMAKE_INFO_PLIST = macos/Info.plist
} }
@ -122,7 +122,7 @@ unix {
} }
# Libraries # Libraries
include(lib_radare2.pri) include(lib_rizin.pri)
!win32 { !win32 {
CONFIG += link_pkgconfig CONFIG += link_pkgconfig
@ -171,7 +171,7 @@ CUTTER_ENABLE_PYTHON {
"$$[QT_INSTALL_HEADERS]/QtCore" \ "$$[QT_INSTALL_HEADERS]/QtCore" \
"$$[QT_INSTALL_HEADERS]/QtWidgets" \ "$$[QT_INSTALL_HEADERS]/QtWidgets" \
"$$[QT_INSTALL_HEADERS]/QtGui" "$$[QT_INSTALL_HEADERS]/QtGui"
for (path, R2_INCLUDEPATH) { for (path, RZ_INCLUDEPATH) {
BINDINGS_INCLUDE_DIRS += "$$path" BINDINGS_INCLUDE_DIRS += "$$path"
} }
for(path, INCLUDEPATH) { for(path, INCLUDEPATH) {
@ -278,8 +278,8 @@ QMAKE_CXXFLAGS += -g
} }
} }
macx:CUTTER_BUNDLE_R2_APPBUNDLE { macx:CUTTER_BUNDLE_RZ_APPBUNDLE {
message("Using r2 rom AppBundle") message("Using rizin rom AppBundle")
DEFINES += MACOS_RZ_BUNDLED DEFINES += MACOS_RZ_BUNDLED
} }
@ -288,13 +288,13 @@ CUTTER_APPVEYOR_R2DEC {
DEFINES += CUTTER_APPVEYOR_R2DEC DEFINES += CUTTER_APPVEYOR_R2DEC
} }
CUTTER_R2GHIDRA_STATIC { CUTTER_RZGHIDRA_STATIC {
message("Building with static r2ghidra support") message("Building with static rz-ghidra support")
DEFINES += CUTTER_R2GHIDRA_STATIC DEFINES += CUTTER_RZGHIDRA_STATIC
SOURCES += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.cpp SOURCES += $$RZGHIDRA_SOURCE/cutter-plugin/RzGhidraDecompiler.cpp
HEADERS += $$R2GHIDRA_SOURCE/cutter-plugin/R2GhidraDecompiler.h HEADERS += $$RZGHIDRA_SOURCE/cutter-plugin/RzGhidraDecompiler.h
INCLUDEPATH += $$R2GHIDRA_SOURCE/cutter-plugin INCLUDEPATH += $$RZGHIDRA_SOURCE/cutter-plugin
LIBS += -L$$R2GHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp LIBS += -L$$RZGHIDRA_INSTALL_PATH -lcore_ghidra -ldelayimp
QMAKE_LFLAGS += /delayload:core_ghidra.dll QMAKE_LFLAGS += /delayload:core_ghidra.dll
} }
@ -364,7 +364,7 @@ SOURCES += \
widgets/SearchWidget.cpp \ widgets/SearchWidget.cpp \
CutterApplication.cpp \ CutterApplication.cpp \
common/PythonAPI.cpp \ common/PythonAPI.cpp \
dialogs/R2PluginsDialog.cpp \ dialogs/RizinPluginsDialog.cpp \
widgets/CutterDockWidget.cpp \ widgets/CutterDockWidget.cpp \
widgets/CutterTreeWidget.cpp \ widgets/CutterTreeWidget.cpp \
widgets/GraphWidget.cpp \ widgets/GraphWidget.cpp \
@ -439,7 +439,7 @@ SOURCES += \
common/ResourcePaths.cpp \ common/ResourcePaths.cpp \
widgets/CutterGraphView.cpp \ widgets/CutterGraphView.cpp \
widgets/SimpleTextGraphView.cpp \ widgets/SimpleTextGraphView.cpp \
widgets/R2GraphWidget.cpp \ widgets/RizinGraphWidget.cpp \
widgets/CallGraph.cpp \ widgets/CallGraph.cpp \
widgets/AddressableDockWidget.cpp \ widgets/AddressableDockWidget.cpp \
dialogs/preferences/AnalOptionsWidget.cpp \ dialogs/preferences/AnalOptionsWidget.cpp \
@ -514,7 +514,7 @@ HEADERS += \
widgets/HeadersWidget.h \ widgets/HeadersWidget.h \
widgets/SearchWidget.h \ widgets/SearchWidget.h \
common/PythonAPI.h \ common/PythonAPI.h \
dialogs/R2PluginsDialog.h \ dialogs/RizinPluginsDialog.h \
widgets/CutterDockWidget.h \ widgets/CutterDockWidget.h \
widgets/CutterTreeWidget.h \ widgets/CutterTreeWidget.h \
widgets/GraphWidget.h \ widgets/GraphWidget.h \
@ -598,7 +598,7 @@ HEADERS += \
common/ResourcePaths.h \ common/ResourcePaths.h \
widgets/CutterGraphView.h \ widgets/CutterGraphView.h \
widgets/SimpleTextGraphView.h \ widgets/SimpleTextGraphView.h \
widgets/R2GraphWidget.h \ widgets/RizinGraphWidget.h \
widgets/CallGraph.h \ widgets/CallGraph.h \
widgets/AddressableDockWidget.h \ widgets/AddressableDockWidget.h \
dialogs/preferences/AnalOptionsWidget.h \ dialogs/preferences/AnalOptionsWidget.h \
@ -639,7 +639,7 @@ FORMS += \
widgets/VTablesWidget.ui \ widgets/VTablesWidget.ui \
widgets/TypesWidget.ui \ widgets/TypesWidget.ui \
widgets/SearchWidget.ui \ widgets/SearchWidget.ui \
dialogs/R2PluginsDialog.ui \ dialogs/RizinPluginsDialog.ui \
dialogs/VersionInfoDialog.ui \ dialogs/VersionInfoDialog.ui \
widgets/ZignaturesWidget.ui \ widgets/ZignaturesWidget.ui \
dialogs/AsyncTaskDialog.ui \ dialogs/AsyncTaskDialog.ui \
@ -669,7 +669,7 @@ FORMS += \
dialogs/preferences/ColorThemeEditDialog.ui \ dialogs/preferences/ColorThemeEditDialog.ui \
widgets/ListDockWidget.ui \ widgets/ListDockWidget.ui \
dialogs/LayoutManager.ui \ dialogs/LayoutManager.ui \
widgets/R2GraphWidget.ui \ widgets/RizinGraphWidget.ui \
dialogs/preferences/AnalOptionsWidget.ui dialogs/preferences/AnalOptionsWidget.ui
RESOURCES += \ RESOURCES += \
@ -694,12 +694,12 @@ unix {
share_pixmaps.files = $$icon_file 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.path = $$PREFIX/share/applications
share_applications.files = $$desktop_file share_applications.files = $$desktop_file
appstream_file = org.radare.Cutter.appdata.xml appstream_file = org.rizin.Cutter.appdata.xml
# Used by ??? # Used by ???
share_appdata.path = $$PREFIX/share/appdata share_appdata.path = $$PREFIX/share/appdata

View File

@ -26,8 +26,8 @@
#include <cstdlib> #include <cstdlib>
#if CUTTER_R2GHIDRA_STATIC #if CUTTER_RZGHIDRA_STATIC
#include <R2GhidraDecompiler.h> #include <RzGhidraDecompiler.h>
#endif #endif
CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc, argv) 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"); qputenv("R_ALT_SRC_DIR", "1");
#endif #endif
Core()->initialize(clOptions.enableR2Plugins); Core()->initialize(clOptions.enableRizinPlugins);
Core()->setSettings(); Core()->setSettings();
Config()->loadInitial(); Config()->loadInitial();
Core()->loadCutterRC(); Core()->loadCutterRC();
@ -114,8 +114,8 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
Core()->registerDecompiler(new R2DecDecompiler(Core())); Core()->registerDecompiler(new R2DecDecompiler(Core()));
} }
#if CUTTER_R2GHIDRA_STATIC #if CUTTER_RZGHIDRA_STATIC
Core()->registerDecompiler(new R2GhidraDecompiler(Core())); Core()->registerDecompiler(new RzGhidraDecompiler(Core()));
#endif #endif
Plugins()->loadPlugins(clOptions.enableCutterPlugins); Plugins()->loadPlugins(clOptions.enableCutterPlugins);
@ -164,14 +164,14 @@ CutterApplication::CutterApplication(int &argc, char **argv) : QApplication(argc
{ {
auto rzprefix = QDir(QCoreApplication::applicationDirPath()); // Contents/MacOS auto rzprefix = QDir(QCoreApplication::applicationDirPath()); // Contents/MacOS
rzprefix.cdUp(); // Contents rzprefix.cdUp(); // Contents
rzprefix.cd("Resources"); // Contents/Resources/r2 rzprefix.cd("Resources"); // Contents/Resources/rz
auto sleighHome = rzprefix; 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()); Core()->setConfig("ghidra.sleighhome", sleighHome.absolutePath());
auto r2decHome = rzprefix; 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()); qputenv("R2DEC_HOME", r2decHome.absolutePath().toLocal8Bit());
} }
#endif #endif
@ -205,8 +205,8 @@ void CutterApplication::launchNewInstance(const QStringList &args)
if (!clOptions.enableCutterPlugins) { if (!clOptions.enableCutterPlugins) {
allArgs.push_back("--no-cutter-plugins"); allArgs.push_back("--no-cutter-plugins");
} }
if (!clOptions.enableR2Plugins) { if (!clOptions.enableRizinPlugins) {
allArgs.push_back("--no-r2-plugins"); allArgs.push_back("--no-rizin-plugins");
} }
allArgs.append(args); allArgs.append(args);
process.startDetached(qApp->applicationFilePath(), allArgs); process.startDetached(qApp->applicationFilePath(), allArgs);
@ -351,9 +351,9 @@ bool CutterApplication::parseCommandLineOptions()
QObject::tr("Do not load Cutter plugins")); QObject::tr("Do not load Cutter plugins"));
cmd_parser.addOption(disableCutterPlugins); cmd_parser.addOption(disableCutterPlugins);
QCommandLineOption disableR2Plugins("no-r2-plugins", QCommandLineOption disableRizinPlugins("no-rizin-plugins",
QObject::tr("Do not load rizin plugins")); QObject::tr("Do not load rizin plugins"));
cmd_parser.addOption(disableR2Plugins); cmd_parser.addOption(disableRizinPlugins);
cmd_parser.process(*this); cmd_parser.process(*this);
@ -424,15 +424,15 @@ bool CutterApplication::parseCommandLineOptions()
opts.outputRedirectionEnabled = !cmd_parser.isSet(disableRedirectOption); opts.outputRedirectionEnabled = !cmd_parser.isSet(disableRedirectOption);
if (cmd_parser.isSet(disablePlugins)) { if (cmd_parser.isSet(disablePlugins)) {
opts.enableCutterPlugins = false; opts.enableCutterPlugins = false;
opts.enableR2Plugins = false; opts.enableRizinPlugins = false;
} }
if (cmd_parser.isSet(disableCutterPlugins)) { if (cmd_parser.isSet(disableCutterPlugins)) {
opts.enableCutterPlugins = false; opts.enableCutterPlugins = false;
} }
if (cmd_parser.isSet(disableR2Plugins)) { if (cmd_parser.isSet(disableRizinPlugins)) {
opts.enableR2Plugins = false; opts.enableRizinPlugins = false;
} }
this->clOptions = opts; this->clOptions = opts;

View File

@ -19,7 +19,7 @@ struct CutterCommandLineOptions {
QString pythonHome; QString pythonHome;
bool outputRedirectionEnabled = true; bool outputRedirectionEnabled = true;
bool enableCutterPlugins = true; bool enableCutterPlugins = true;
bool enableR2Plugins = true; bool enableRizinPlugins = true;
}; };
class CutterApplication : public QApplication class CutterApplication : public QApplication

View File

@ -31,7 +31,7 @@ void openIssue()
type = "N/A"; type = "N/A";
} }
url = 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 + + osInfo + "\n* Cutter version: " + CUTTER_VERSION_FULL +
"\n* File format: " + format + "\n * Arch: " + arch + "\n * Type: " + type + "\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" "\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\n"

View File

@ -34,7 +34,7 @@ const QStringList ColorThemeWorker::cutterSpecificOptions = {
"gui.disass_selected" "gui.disass_selected"
}; };
const QStringList ColorThemeWorker::radare2UnusedOptions = { const QStringList ColorThemeWorker::rizinUnusedOptions = {
"linehl", "linehl",
"wordhl", "wordhl",
"graph.box", "graph.box",
@ -60,10 +60,10 @@ const QStringList ColorThemeWorker::radare2UnusedOptions = {
ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent) ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent)
{ {
char* szThemes = rz_str_home(RZ_HOME_THEMES); char* szThemes = rz_str_home(RZ_HOME_THEMES);
customR2ThemesLocationPath = szThemes; customRzThemesLocationPath = szThemes;
rz_mem_free(szThemes); rz_mem_free(szThemes);
if (!QDir(customR2ThemesLocationPath).exists()) { if (!QDir(customRzThemesLocationPath).exists()) {
QDir().mkpath(customR2ThemesLocationPath); QDir().mkpath(customRzThemesLocationPath);
} }
QDir currDir { QStringLiteral("%1%2%3") QDir currDir { QStringLiteral("%1%2%3")
@ -72,7 +72,7 @@ ColorThemeWorker::ColorThemeWorker(QObject *parent) : QObject (parent)
.arg(RZ_THEMES) .arg(RZ_THEMES)
}; };
if (currDir.exists()) { if (currDir.exists()) {
standardR2ThemesLocationPath = currDir.absolutePath(); standardRzThemesLocationPath = currDir.absolutePath();
} else { } else {
QMessageBox::critical(nullptr, QMessageBox::critical(nullptr,
tr("Standard themes not found"), 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 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)) { if (!fOut.open(QFile::WriteOnly | QFile::Truncate)) {
return tr("The file <b>%1</b> cannot be opened.") return tr("The file <b>%1</b> cannot be opened.")
.arg(QFileInfo(fOut).filePath()); .arg(QFileInfo(fOut).filePath());
@ -152,7 +152,7 @@ QString ColorThemeWorker::save(const QJsonDocument &theme, const QString &themeN
bool ColorThemeWorker::isCustomTheme(const QString &themeName) const 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 bool ColorThemeWorker::isThemeExist(const QString &name) const
@ -192,7 +192,7 @@ QJsonDocument ColorThemeWorker::getTheme(const QString& themeName) const
} }
if (isCustomTheme(themeName)) { if (isCustomTheme(themeName)) {
QFile src(QDir(customR2ThemesLocationPath).filePath(themeName)); QFile src(QDir(customRzThemesLocationPath).filePath(themeName));
if (!src.open(QFile::ReadOnly)) { if (!src.open(QFile::ReadOnly)) {
return QJsonDocument(); return QJsonDocument();
} }
@ -207,7 +207,7 @@ QJsonDocument ColorThemeWorker::getTheme(const QString& themeName) const
} }
} }
for (auto &key : radare2UnusedOptions) { for (auto &key : rizinUnusedOptions) {
theme.remove(key); 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); 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()) { if (file.isWritable()) {
return tr("You have no permission to write to <b>%1</b>") return tr("You have no permission to write to <b>%1</b>")
.arg(QFileInfo(file).filePath()); .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); 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 ""; return "";
} else { } else {
return tr("Error occurred during importing. " 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."); 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)); bool ok = QFile::rename(dir.filePath(themeName), dir.filePath(newName));
if (!ok) { if (!ok) {
return tr("Something went wrong during renaming. " return tr("Something went wrong during renaming. "

View File

@ -18,9 +18,9 @@ class ColorThemeWorker : public QObject
Q_OBJECT Q_OBJECT
public: 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. * @brief cutterSpecificOptions is list of all available Cutter-only color options.
@ -28,9 +28,9 @@ public:
static const QStringList cutterSpecificOptions; 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() static ColorThemeWorker &instance()
{ {
@ -117,8 +117,8 @@ public:
QStringList customThemes() const; QStringList customThemes() const;
private: private:
QString standardR2ThemesLocationPath; QString standardRzThemesLocationPath;
QString customR2ThemesLocationPath; QString customRzThemesLocationPath;
ColorThemeWorker(QObject *parent = nullptr); ColorThemeWorker(QObject *parent = nullptr);
ColorThemeWorker(const ColorThemeWorker &root) = delete; ColorThemeWorker(const ColorThemeWorker &root) = delete;

View File

@ -198,7 +198,7 @@ int Configuration::getNewFileLastClicked()
void Configuration::resetAll() 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. // settingsFile.remove()+loadInitials() should reset all settings configurable using Cutter GUI.
//Core()->cmdRaw("e-"); //Core()->cmdRaw("e-");

View File

@ -1,6 +1,6 @@
#ifndef R2TASK_H #ifndef RZTASK_H
#define R2TASK_H #define RZTASK_H
#include "core/Cutter.h" #include "core/Cutter.h"
@ -32,4 +32,4 @@ signals:
void finished(); void finished();
}; };
#endif // R2TASK_H #endif // RZTASK_H

View File

@ -37,7 +37,7 @@ UpdateWorker::UpdateWorker(QObject *parent) :
void UpdateWorker::checkCurrentVersion(time_t timeoutMs) 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; QNetworkRequest request;
request.setUrl(url); request.setUrl(url);
@ -58,7 +58,7 @@ void UpdateWorker::download(QString filename, QString version)
QNetworkRequest request; QNetworkRequest request;
request.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true); 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())); "download/v%1/%2").arg(version).arg(getRepositoryFileName()));
request.setUrl(url); request.setUrl(url);
@ -77,8 +77,8 @@ void UpdateWorker::showUpdateDialog(bool showDontCheckForUpdatesButton)
+ "<b>" + tr("Current version:") + "</b> " CUTTER_VERSION_FULL "<br/>" + "<b>" + tr("Current version:") + "</b> " CUTTER_VERSION_FULL "<br/>"
+ "<b>" + tr("Latest version:") + "</b> " + latestVersion.toString() + "<br/><br/>" + "<b>" + tr("Latest version:") + "</b> " + latestVersion.toString() + "<br/><br/>"
+ tr("For update, please check the link:<br/>") + tr("For update, please check the link:<br/>")
+ QString("<a href=\"https://github.com/radareorg/cutter/releases/tag/v%1\">" + QString("<a href=\"https://github.com/rizinorg/cutter/releases/tag/v%1\">"
"https://github.com/radareorg/cutter/releases/tag/v%1</a><br/>").arg(latestVersion.toString()) "https://github.com/rizinorg/cutter/releases/tag/v%1</a><br/>").arg(latestVersion.toString())
+ tr("or click \"Download\" to download latest version of Cutter.")); + tr("or click \"Download\" to download latest version of Cutter."));
if (showDontCheckForUpdatesButton) { if (showDontCheckForUpdatesButton) {
mb.setStandardButtons(QMessageBox::Save | QMessageBox::Reset | QMessageBox::Ok); mb.setStandardButtons(QMessageBox::Save | QMessageBox::Reset | QMessageBox::Ok);

View File

@ -196,7 +196,7 @@ void CutterCore::initialize(bool loadPlugins)
prefix.cdUp(); prefix.cdUp();
qInfo() << "Setting Rizin prefix =" << prefix.absolutePath() << " for AppImage."; qInfo() << "Setting Rizin prefix =" << prefix.absolutePath() << " for AppImage.";
#else // MACOS_RZ_BUNDLED #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.cdUp();
prefix.cd("Resources"); prefix.cd("Resources");
qInfo() << "Setting Rizin prefix =" << prefix.absolutePath() << " for macOS Application Bundle."; 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); 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) { if (offset == RVA_INVALID) {
offset = getOffset(); offset = getOffset();
} }
this->cmdRawAt(QString("ahi %1").arg(r2BaseName), offset); this->cmdRawAt(QString("ahi %1").arg(rzBaseName), offset);
emit instructionChanged(offset); emit instructionChanged(offset);
} }
@ -877,8 +877,8 @@ void CutterCore::seekSilent(ut64 offset)
void CutterCore::seek(ut64 offset) void CutterCore::seek(ut64 offset)
{ {
// Slower than using the API, but the API is not complete // Slower than using the API, but the API is not complete
// which means we either have to duplicate code from radare2 // which means we either have to duplicate code from rizin
// here, or refactor radare2 API. // here, or refactor rizin API.
CORE_LOCK(); CORE_LOCK();
if (offset == RVA_INVALID) { if (offset == RVA_INVALID) {
return; 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; BreakpointDescription bp;
bp.addr = bpi->addr; bp.addr = bpi->addr;
@ -2216,7 +2216,7 @@ BreakpointDescription CutterCore::getBreakpointAt(RVA addr)
int index = breakpointIndexAt(addr); int index = breakpointIndexAt(addr);
auto bp = rz_bp_get_index(core->dbg->bp, index); auto bp = rz_bp_get_index(core->dbg->bp, index);
if (bp) { if (bp) {
return breakpointDescriptionFromR2(index, bp); return breakpointDescriptionFromRizin(index, bp);
} }
return BreakpointDescription(); return BreakpointDescription();
} }
@ -2225,10 +2225,10 @@ QList<BreakpointDescription> CutterCore::getBreakpoints()
{ {
CORE_LOCK(); CORE_LOCK();
QList<BreakpointDescription> ret; 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++) { for (int i = 0; i < core->dbg->bp->bps_idx_count; i++) {
if (auto bpi = core->dbg->bp->bps_idx[i]) { if (auto bpi = core->dbg->bp->bps_idx[i]) {
ret.push_back(breakpointDescriptionFromR2(i, bpi)); ret.push_back(breakpointDescriptionFromRizin(i, bpi));
} }
} }

View File

@ -233,7 +233,7 @@ public:
void setComment(RVA addr, const QString &cmt); void setComment(RVA addr, const QString &cmt);
void delComment(RVA addr); void delComment(RVA addr);
QString getCommentAt(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); void setCurrentBits(int bits, RVA offset = RVA_INVALID);
/** /**

View File

@ -26,7 +26,7 @@
#define APPNAME "Cutter" #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; typedef ut64 RVA;

View File

@ -69,7 +69,7 @@
#include "widgets/HexdumpWidget.h" #include "widgets/HexdumpWidget.h"
#include "widgets/DecompilerWidget.h" #include "widgets/DecompilerWidget.h"
#include "widgets/HexWidget.h" #include "widgets/HexWidget.h"
#include "widgets/R2GraphWidget.h" #include "widgets/RizinGraphWidget.h"
#include "widgets/CallGraph.h" #include "widgets/CallGraph.h"
// Qt Headers // Qt Headers
@ -395,7 +395,7 @@ void MainWindow::initDocks()
symbolsDock = new SymbolsWidget(this), symbolsDock = new SymbolsWidget(this),
vTablesDock = new VTablesWidget(this), vTablesDock = new VTablesWidget(this),
zignaturesDock = new ZignaturesWidget(this), zignaturesDock = new ZignaturesWidget(this),
r2GraphDock = new R2GraphWidget(this), rzGraphDock = new RizinGraphWidget(this),
callGraphDock = new CallGraphWidget(this, false), callGraphDock = new CallGraphWidget(this, false),
globalCallGraphDock = new CallGraphWidget(this, true), globalCallGraphDock = new CallGraphWidget(this, true),
}; };
@ -531,9 +531,9 @@ void MainWindow::openNewFile(InitialOptions &options, bool skipOptionsDialog)
{ {
setFilename(options.filename); setFilename(options.filename);
/* Prompt to load filename.r2 script */ /* Prompt to load filename.rz script */
if (options.script.isEmpty()) { 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())) { if (rz_file_exists(script.toStdString().data())) {
QMessageBox mb; QMessageBox mb;
mb.setWindowTitle(tr("Script loading")); mb.setWindowTitle(tr("Script loading"));
@ -894,7 +894,7 @@ void MainWindow::restoreDocks()
tabifyDockWidget(dashboardDock, memoryMapDock); tabifyDockWidget(dashboardDock, memoryMapDock);
tabifyDockWidget(dashboardDock, breakpointDock); tabifyDockWidget(dashboardDock, breakpointDock);
tabifyDockWidget(dashboardDock, registerRefsDock); tabifyDockWidget(dashboardDock, registerRefsDock);
tabifyDockWidget(dashboardDock, r2GraphDock); tabifyDockWidget(dashboardDock, rzGraphDock);
tabifyDockWidget(dashboardDock, callGraphDock); tabifyDockWidget(dashboardDock, callGraphDock);
tabifyDockWidget(dashboardDock, globalCallGraphDock); tabifyDockWidget(dashboardDock, globalCallGraphDock);
for (const auto &it : dockWidgets) { for (const auto &it : dockWidgets) {
@ -1714,7 +1714,7 @@ void MainWindow::on_actionExport_as_code_triggered()
cmdMap[filters.last()] = "pcJ"; cmdMap[filters.last()] = "pcJ";
filters << tr("Python array (*.py)"); filters << tr("Python array (*.py)");
cmdMap[filters.last()] = "pcp"; cmdMap[filters.last()] = "pcp";
filters << tr("Print 'wx' Rizin commands (*.r2)"); filters << tr("Print 'wx' Rizin commands (*.rz)");
cmdMap[filters.last()] = "pc*"; cmdMap[filters.last()] = "pc*";
filters << tr("GAS .byte blob (*.asm, *.s)"); filters << tr("GAS .byte blob (*.asm, *.s)");
cmdMap[filters.last()] = "pca"; cmdMap[filters.last()] = "pca";

View File

@ -52,7 +52,7 @@ class GraphWidget;
class HexdumpWidget; class HexdumpWidget;
class DecompilerWidget; class DecompilerWidget;
class OverviewWidget; class OverviewWidget;
class R2GraphWidget; class RizinGraphWidget;
class CallGraphWidget; class CallGraphWidget;
namespace Ui { namespace Ui {
@ -253,7 +253,7 @@ private:
NewFileDialog *newFileDialog = nullptr; NewFileDialog *newFileDialog = nullptr;
CutterDockWidget *breakpointDock = nullptr; CutterDockWidget *breakpointDock = nullptr;
CutterDockWidget *registerRefsDock = nullptr; CutterDockWidget *registerRefsDock = nullptr;
R2GraphWidget *r2GraphDock = nullptr; RizinGraphWidget *rzGraphDock = nullptr;
CallGraphWidget *callGraphDock = nullptr; CallGraphWidget *callGraphDock = nullptr;
CallGraphWidget *globalCallGraphDock = nullptr; CallGraphWidget *globalCallGraphDock = nullptr;

View File

@ -3,7 +3,7 @@
#include "AboutDialog.h" #include "AboutDialog.h"
#include "ui_AboutDialog.h" #include "ui_AboutDialog.h"
#include "R2PluginsDialog.h" #include "RizinPluginsDialog.h"
#include "common/Configuration.h" #include "common/Configuration.h"
#include <QUrl> #include <QUrl>
@ -79,7 +79,7 @@ void AboutDialog::on_showVersionButton_clicked()
void AboutDialog::on_showPluginsButton_clicked() void AboutDialog::on_showPluginsButton_clicked()
{ {
R2PluginsDialog dialog(this); RizinPluginsDialog dialog(this);
dialog.exec(); dialog.exec();
} }

View File

@ -60,7 +60,7 @@ void EditVariablesDialog::applyFields()
Core()->cmdRaw(QString("afvt %1 %2").arg(desc.name).arg(ui->typeComboBox->currentText())); 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('_')) QString newName = ui->nameEdit->text().replace(QLatin1Char(' '), QLatin1Char('_'))
.replace(QLatin1Char('\\'), QLatin1Char('_')) .replace(QLatin1Char('\\'), QLatin1Char('_'))
.replace(QLatin1Char('/'), QLatin1Char('_')); .replace(QLatin1Char('/'), QLatin1Char('_'));

View File

@ -427,7 +427,7 @@ void InitialOptionsDialog::on_scriptSelectButton_clicked()
{ {
QFileDialog dialog(this); QFileDialog dialog(this);
dialog.setWindowTitle(tr("Select Rizin script file")); 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()) { if (!dialog.exec()) {
return; return;

View File

@ -1,13 +1,13 @@
#include "R2PluginsDialog.h" #include "RizinPluginsDialog.h"
#include "ui_R2PluginsDialog.h" #include "ui_RizinPluginsDialog.h"
#include "core/Cutter.h" #include "core/Cutter.h"
#include "common/Helpers.h" #include "common/Helpers.h"
#include "plugins/PluginManager.h" #include "plugins/PluginManager.h"
R2PluginsDialog::R2PluginsDialog(QWidget *parent) : RizinPluginsDialog::RizinPluginsDialog(QWidget *parent) :
QDialog(parent), QDialog(parent),
ui(new Ui::R2PluginsDialog) ui(new Ui::RizinPluginsDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
@ -57,7 +57,7 @@ R2PluginsDialog::R2PluginsDialog(QWidget *parent) :
qhelpers::adjustColumns(ui->RzAsmTreeWidget, 0); qhelpers::adjustColumns(ui->RzAsmTreeWidget, 0);
} }
R2PluginsDialog::~R2PluginsDialog() RizinPluginsDialog::~RizinPluginsDialog()
{ {
delete ui; delete ui;
} }

View File

@ -7,19 +7,19 @@
#include "core/Cutter.h" #include "core/Cutter.h"
namespace Ui { namespace Ui {
class R2PluginsDialog; class RizinPluginsDialog;
} }
class R2PluginsDialog : public QDialog class RizinPluginsDialog : public QDialog
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit R2PluginsDialog(QWidget *parent = nullptr); explicit RizinPluginsDialog(QWidget *parent = nullptr);
~R2PluginsDialog(); ~RizinPluginsDialog();
private: private:
Ui::R2PluginsDialog *ui; Ui::RizinPluginsDialog *ui;
}; };
#endif // PLUGINSDIALOG_H #endif // PLUGINSDIALOG_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>R2PluginsDialog</class> <class>RizinPluginsDialog</class>
<widget class="QDialog" name="R2PluginsDialog"> <widget class="QDialog" name="RizinPluginsDialog">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -207,7 +207,7 @@
<connection> <connection>
<sender>buttonBox</sender> <sender>buttonBox</sender>
<signal>accepted()</signal> <signal>accepted()</signal>
<receiver>R2PluginsDialog</receiver> <receiver>RizinPluginsDialog</receiver>
<slot>accept()</slot> <slot>accept()</slot>
<hints> <hints>
<hint type="sourcelabel"> <hint type="sourcelabel">

View File

@ -1,5 +1,5 @@
#ifndef R2TASKDIALOG_H #ifndef RZTASKDIALOG_H
#define R2TASKDIALOG_H #define RZTASKDIALOG_H
#include <memory> #include <memory>
@ -47,4 +47,4 @@ private:
bool breakOnClose = false; bool breakOnClose = false;
}; };
#endif //R2TASKDIALOG_H #endif //RZTASKDIALOG_H

View File

@ -11,13 +11,13 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>R2 Task</string> <string>Rizin Task</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QLabel" name="descLabel"> <widget class="QLabel" name="descLabel">
<property name="text"> <property name="text">
<string>R2 task in progress..</string> <string>Rizin task in progress..</string>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -321,7 +321,7 @@
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;Join thousands of reverse engineers in our community:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;Twitter:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://twitter.com/r2gui&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;@r2gui&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;Telegram: &lt;/span&gt;&lt;a href=&quot;https://t.me/r2cutter&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;@r2cutter &lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;IRC: &lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;#cutter on &lt;/span&gt;&lt;a href=&quot;irc.freenode.net&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;irc.freenode.net&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot; margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;Join thousands of reverse engineers in our community:&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;Twitter:&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt; &lt;/span&gt;&lt;a href=&quot;https://twitter.com/cutter_re&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;@cutter_re&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;Telegram: &lt;/span&gt;&lt;a href=&quot;https://t.me/cutter_re&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;@cutter_re &lt;br /&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; font-weight:600;&quot;&gt;IRC: &lt;/span&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;#cutter on &lt;/span&gt;&lt;a href=&quot;irc.freenode.net&quot;&gt;&lt;span style=&quot; font-family:'Noto Sans'; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;irc.freenode.net&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="textFormat"> <property name="textFormat">
<enum>Qt::RichText</enum> <enum>Qt::RichText</enum>
@ -352,7 +352,7 @@ p, li { white-space: pre-wrap; }
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>&lt;html&gt;&lt;head/&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Want to help us make Cutter even better?&lt;br/&gt;Visit our &lt;/span&gt;&lt;a href=&quot;https://github.com/radareorg/cutter&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;Github page&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt; and report bugs or contribute code.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body style=&quot; font-family:'Cantarell'; font-size:9pt; font-weight:400; font-style:normal;&quot;&gt;&lt;p&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt;Want to help us make Cutter even better?&lt;br/&gt;Visit our &lt;/span&gt;&lt;a href=&quot;https://github.com/rizinorg/cutter&quot;&gt;&lt;span style=&quot; font-size:10pt; text-decoration: underline; color:#2980b9;&quot;&gt;Github page&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot; font-size:10pt;&quot;&gt; and report bugs or contribute code.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="wordWrap"> <property name="wordWrap">
<bool>true</bool> <bool>true</bool>

View File

@ -6,7 +6,7 @@
#include "common/Helpers.h" #include "common/Helpers.h"
#include "common/Configuration.h" #include "common/Configuration.h"
#include "plugins/PluginManager.h" #include "plugins/PluginManager.h"
#include "dialogs/R2PluginsDialog.h" #include "dialogs/RizinPluginsDialog.h"
#include <QLabel> #include <QLabel>
#include <QPushButton> #include <QPushButton>
@ -49,11 +49,11 @@ PluginsOptionsWidget::PluginsOptionsWidget(PreferencesDialog *dialog)
} }
qhelpers::adjustColumns(treeWidget, 0); qhelpers::adjustColumns(treeWidget, 0);
auto r2PluginsButton = new QPushButton(this); auto rzPluginsButton = new QPushButton(this);
layout->addWidget(r2PluginsButton); layout->addWidget(rzPluginsButton);
r2PluginsButton->setText(tr("Show Rizin plugin information")); rzPluginsButton->setText(tr("Show Rizin plugin information"));
connect(r2PluginsButton, &QPushButton::clicked, this, [this]() { connect(rzPluginsButton, &QPushButton::clicked, this, [this]() {
R2PluginsDialog dialog(this); RizinPluginsDialog dialog(this);
dialog.exec(); dialog.exec();
}); });
} }

View File

@ -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
View 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
}
}

View File

@ -249,7 +249,7 @@ void DecompilerContextMenu::aboutToShowSlot()
actionEditFunctionVariables.setText(tr("Edit variable %1").arg(QString( actionEditFunctionVariables.setText(tr("Edit variable %1").arg(QString(
annotationHere->variable.name))); annotationHere->variable.name)));
actionRenameThingHere.setText(tr("Rename 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); actionEditFunctionVariables.setDisabled(true);
actionRenameThingHere.setDisabled(true); actionRenameThingHere.setDisabled(true);
setToolTipsVisible(true); setToolTipsVisible(true);
@ -427,7 +427,7 @@ void DecompilerContextMenu::actionRenameThingHereTriggered()
} }
} }
} else if (isFunctionVariable()) { } else if (isFunctionVariable()) {
if (!variablePresentInR2()) { if (!variablePresentInRizin()) {
// Show can't rename this variable dialog // Show can't rename this variable dialog
QMessageBox::critical(this, tr("Rename local variable %1").arg(QString( QMessageBox::critical(this, tr("Rename local variable %1").arg(QString(
annotationHere->variable.name)), annotationHere->variable.name)),
@ -453,7 +453,7 @@ void DecompilerContextMenu::actionEditFunctionVariablesTriggered()
{ {
if (!isFunctionVariable()) { if (!isFunctionVariable()) {
return; return;
} else if (!variablePresentInR2()) { } else if (!variablePresentInRizin()) {
QMessageBox::critical(this, tr("Edit local variable %1").arg(QString( QMessageBox::critical(this, tr("Edit local variable %1").arg(QString(
annotationHere->variable.name)), annotationHere->variable.name)),
tr("Can't edit this variable. " tr("Can't edit this variable. "
@ -587,7 +587,7 @@ bool DecompilerContextMenu::isFunctionVariable()
return (annotationHere && rz_annotation_is_variable(annotationHere)); return (annotationHere && rz_annotation_is_variable(annotationHere));
} }
bool DecompilerContextMenu::variablePresentInR2() bool DecompilerContextMenu::variablePresentInRizin()
{ {
QString variableName(annotationHere->variable.name); QString variableName(annotationHere->variable.name);
QList<VariableDescription> variables = Core()->getVariables(offset); QList<VariableDescription> variables = Core()->getVariables(offset);

View File

@ -174,7 +174,7 @@ private:
* *
* @return True if the variable is present, otherwise false * @return True if the variable is present, otherwise false
*/ */
bool variablePresentInR2(); bool variablePresentInRizin();
}; };
#endif // DECOMPILERCONTEXTMENU_H #endif // DECOMPILERCONTEXTMENU_H

View File

@ -375,7 +375,7 @@ DisassemblyContextMenu::ThingUsedHere DisassemblyContextMenu::getThingAt(ut64 ad
RzAnalysisFunction *fcn = Core()->functionAt(address); RzAnalysisFunction *fcn = Core()->functionAt(address);
RzFlagItem *flag = rz_flag_get_i(Core()->core()->flags, 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) { if (fcn != nullptr) {
// It is a function // It is a function

View File

@ -40,28 +40,28 @@ configure_file(input: 'CutterConfig.h.in',
conf_inc = include_directories('.') conf_inc = include_directories('.')
sp_dir = join_paths(meson.source_root(), 'subprojects') sp_dir = join_paths(meson.source_root(), 'subprojects')
sp_r2_dir = join_paths(sp_dir, 'radare2') sp_rizin_dir = join_paths(sp_dir, 'rizin')
exists_cmd = '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(sp_r2_dir) exists_cmd = '__import__("sys").exit(__import__("os").path.exists("@0@"))'.format(sp_rizin_dir)
if run_command(py3_exe, '-c', exists_cmd).returncode() == 0 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' if host_machine.system() == 'windows'
sp_dir = '\\'.join(sp_dir.split('/')) sp_dir = '\\'.join(sp_dir.split('/'))
sp_r2_dir = '\\'.join(sp_r2_dir.split('/')) sp_rizin_dir = '\\'.join(sp_rizin_dir.split('/'))
r2_src_dir = '\\'.join(r2_src_dir.split('/')) rizin_src_dir = '\\'.join(rizin_src_dir.split('/'))
link_cmd = ['CMD', '/C', 'MKDIR', sp_dir, '&', 'MKLINK', '/D', sp_r2_dir, r2_src_dir] link_cmd = ['CMD', '/C', 'MKDIR', sp_dir, '&', 'MKLINK', '/D', sp_rizin_dir, rizin_src_dir]
else 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 endif
run_command(link_cmd, check: true) run_command(link_cmd, check: true)
endif endif
libr2_dep = dependency('libr2', librz_dep = dependency('librz',
fallback : ['radare2', 'libr2_dep'], fallback : ['rizin', 'librz_dep'],
default_options : ['enable_tests=false']) default_options : ['enable_tests=false'])
qt5dep = dependency('qt5', modules: qt_modules, main: true) qt5dep = dependency('qt5', modules: qt_modules, main: true)
deps = [libr2_dep, qt5dep] deps = [librz_dep, qt5dep]
if get_option('enable_python') if get_option('enable_python')
py3_dep = dependency('python3') py3_dep = dependency('python3')
deps += [py3_dep] 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(), 'widgets'),
join_paths(meson.current_source_dir(), 'plugins'), join_paths(meson.current_source_dir(), 'plugins'),
join_paths(meson.current_source_dir(), 'menus'), join_paths(meson.current_source_dir(), 'menus'),
join_paths(meson.current_source_dir(), 'subprojects/radare2/libr/include'), join_paths(meson.current_source_dir(), 'subprojects/rizin/librz/include'),
join_paths(meson.current_build_dir(), 'subprojects/radare2'), join_paths(meson.current_build_dir(), 'subprojects/rizin'),
qt5core_dep.get_pkgconfig_variable('includedir'), qt5core_dep.get_pkgconfig_variable('includedir'),
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtCore'), join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtCore'),
join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtGui'), join_paths(qt5core_dep.get_pkgconfig_variable('includedir'), 'QtGui'),

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<component type="desktop"> <component type="desktop">
<id>org.radare.Cutter</id> <id>org.rizin.Cutter</id>
<metadata_license>CC0-1.0</metadata_license> <metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0</project_license> <project_license>GPL-3.0</project_license>
<name>Cutter</name> <name>Cutter</name>
@ -12,7 +12,7 @@
</p> </p>
</description> </description>
<launchable type="desktop-id">org.radare.Cutter.desktop</launchable> <launchable type="desktop-id">org.rizin.Cutter.desktop</launchable>
<screenshots> <screenshots>
<screenshot> <screenshot>

View File

@ -47,7 +47,7 @@ public:
virtual QString getVersion() const = 0; 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) Q_DECLARE_INTERFACE(CutterPlugin, CutterPlugin_iid)

View File

@ -8,7 +8,7 @@
class CutterSamplePlugin : public QObject, CutterPlugin class CutterSamplePlugin : public QObject, CutterPlugin
{ {
Q_OBJECT Q_OBJECT
Q_PLUGIN_METADATA(IID "org.radare.cutter.plugins.CutterPlugin") Q_PLUGIN_METADATA(IID "org.rizin.cutter.plugins.CutterPlugin")
Q_INTERFACES(CutterPlugin) Q_INTERFACES(CutterPlugin)
public: public:

View File

@ -241,7 +241,7 @@ void ColorThemeListView::currentChanged(const QModelIndex &current,
{ {
ColorOption prev = previous.data(Qt::UserRole).value<ColorOption>(); ColorOption prev = previous.data(Qt::UserRole).value<ColorOption>();
Config()->setColor(prev.optionName, prev.color); 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())); 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) { auto updateColor = [](const QString &name, const QColor &color) {
Config()->setColor(name, 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())); Core()->cmdRaw(QString("ec %1 %2").arg(name).arg(color.name()));
} }
}; };

View File

@ -31,7 +31,7 @@
#define STDIN_PIPE_NAME "%1/cutter-stdin-%2" #define STDIN_PIPE_NAME "%1/cutter-stdin-%2"
#endif #endif
#define CONSOLE_R2_INPUT ("R2 Console") #define CONSOLE_RIZIN_INPUT ("Rizin Console")
#define CONSOLE_DEBUGEE_INPUT ("Debugee Input") #define CONSOLE_DEBUGEE_INPUT ("Debugee Input")
static const int invalidHistoryPos = -1; static const int invalidHistoryPos = -1;
@ -51,7 +51,7 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
ui->setupUi(this); ui->setupUi(this);
// Adjust console lineedit // Adjust console lineedit
ui->r2InputLineEdit->setTextMargins(10, 0, 0, 0); ui->rzInputLineEdit->setTextMargins(10, 0, 0, 0);
ui->debugeeInputLineEdit->setTextMargins(10, 0, 0, 0); ui->debugeeInputLineEdit->setTextMargins(10, 0, 0, 0);
setupFont(); setupFont();
@ -94,9 +94,9 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
completer->setMaxVisibleItems(20); completer->setMaxVisibleItems(20);
completer->setCaseSensitivity(Qt::CaseInsensitive); completer->setCaseSensitivity(Qt::CaseInsensitive);
completer->setFilterMode(Qt::MatchStartsWith); 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(); updateCompletion();
// Set console output context menu // Set console output context menu
@ -104,28 +104,28 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
connect(ui->outputTextEdit, &QWidget::customContextMenuRequested, connect(ui->outputTextEdit, &QWidget::customContextMenuRequested,
this, &ConsoleWidget::showCustomContextMenu); this, &ConsoleWidget::showCustomContextMenu);
// Esc clears r2InputLineEdit and debugeeInputLineEdit (like OmniBar) // Esc clears rzInputLineEdit and debugeeInputLineEdit (like OmniBar)
QShortcut *r2_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->r2InputLineEdit); QShortcut *rizin_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->rzInputLineEdit);
connect(r2_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear); connect(rizin_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear);
r2_clear_shortcut->setContext(Qt::WidgetShortcut); rizin_clear_shortcut->setContext(Qt::WidgetShortcut);
QShortcut *debugee_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->debugeeInputLineEdit); QShortcut *debugee_clear_shortcut = new QShortcut(QKeySequence(Qt::Key_Escape), ui->debugeeInputLineEdit);
connect(debugee_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear); connect(debugee_clear_shortcut, &QShortcut::activated, this, &ConsoleWidget::clear);
debugee_clear_shortcut->setContext(Qt::WidgetShortcut); debugee_clear_shortcut->setContext(Qt::WidgetShortcut);
// Up and down arrows show history // 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); connect(historyUpShortcut, &QShortcut::activated, this, &ConsoleWidget::historyPrev);
historyUpShortcut->setContext(Qt::WidgetShortcut); 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); connect(historyDownShortcut, &QShortcut::activated, this, &ConsoleWidget::historyNext);
historyDownShortcut->setContext(Qt::WidgetShortcut); 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(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); connect(Config(), &Configuration::fontsUpdated, this, &ConsoleWidget::setupFont);
@ -138,8 +138,8 @@ ConsoleWidget::ConsoleWidget(MainWindow *main) :
ui->inputCombo->setVisible(true); ui->inputCombo->setVisible(true);
} else { } else {
ui->inputCombo->setVisible(false); ui->inputCombo->setVisible(false);
// Return to the r2 console // Return to the rizin console
ui->inputCombo->setCurrentIndex(ui->inputCombo->findText(CONSOLE_R2_INPUT)); ui->inputCombo->setCurrentIndex(ui->inputCombo->findText(CONSOLE_RIZIN_INPUT));
} }
}); });
@ -176,7 +176,7 @@ bool ConsoleWidget::eventFilter(QObject *obj, QEvent *event)
QWidget *ConsoleWidget::widgetToFocusOnRaise() QWidget *ConsoleWidget::widgetToFocusOnRaise()
{ {
return ui->r2InputLineEdit; return ui->rzInputLineEdit;
} }
void ConsoleWidget::setupFont() void ConsoleWidget::setupFont()
@ -200,7 +200,7 @@ void ConsoleWidget::addDebugOutput(const QString &msg)
void ConsoleWidget::focusInputLineEdit() void ConsoleWidget::focusInputLineEdit()
{ {
ui->r2InputLineEdit->setFocus(); ui->rzInputLineEdit->setFocus();
} }
void ConsoleWidget::removeLastLine() void ConsoleWidget::removeLastLine()
@ -220,7 +220,7 @@ void ConsoleWidget::executeCommand(const QString &command)
if (!commandTask.isNull()) { if (!commandTask.isNull()) {
return; return;
} }
ui->r2InputLineEdit->setEnabled(false); ui->rzInputLineEdit->setEnabled(false);
QString cmd_line = "[" + RAddressString(Core()->getOffset()) + "]> " + command; QString cmd_line = "[" + RAddressString(Core()->getOffset()) + "]> " + command;
addOutput(cmd_line); addOutput(cmd_line);
@ -234,8 +234,8 @@ void ConsoleWidget::executeCommand(const QString &command)
scrollOutputToEnd(); scrollOutputToEnd();
historyAdd(command); historyAdd(command);
commandTask.clear(); commandTask.clear();
ui->r2InputLineEdit->setEnabled(true); ui->rzInputLineEdit->setEnabled(true);
ui->r2InputLineEdit->setFocus(); ui->rzInputLineEdit->setFocus();
if (oldOffset != Core()->getOffset()) { if (oldOffset != Core()->getOffset()) {
Core()->updateSeek(); Core()->updateSeek();
@ -263,10 +263,10 @@ void ConsoleWidget::onIndexChange()
{ {
QString console = ui->inputCombo->currentText(); QString console = ui->inputCombo->currentText();
if (console == CONSOLE_DEBUGEE_INPUT) { if (console == CONSOLE_DEBUGEE_INPUT) {
ui->r2InputLineEdit->setVisible(false); ui->rzInputLineEdit->setVisible(false);
ui->debugeeInputLineEdit->setVisible(true); ui->debugeeInputLineEdit->setVisible(true);
} else if (console == CONSOLE_R2_INPUT) { } else if (console == CONSOLE_RIZIN_INPUT) {
ui->r2InputLineEdit->setVisible(true); ui->rzInputLineEdit->setVisible(true);
ui->debugeeInputLineEdit->setVisible(false); ui->debugeeInputLineEdit->setVisible(false);
} }
} }
@ -278,14 +278,14 @@ void ConsoleWidget::setWrap(bool wrap)
ui->outputTextEdit->setLineWrapMode(wrap ? QPlainTextEdit::WidgetWidth: QPlainTextEdit::NoWrap); 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()) { if (input.isEmpty()) {
return; return;
} }
executeCommand(input); executeCommand(input);
ui->r2InputLineEdit->clear(); ui->rzInputLineEdit->clear();
} }
void ConsoleWidget::on_debugeeInputLineEdit_returnPressed() void ConsoleWidget::on_debugeeInputLineEdit_returnPressed()
@ -300,7 +300,7 @@ void ConsoleWidget::on_debugeeInputLineEdit_returnPressed()
void ConsoleWidget::on_execButton_clicked() void ConsoleWidget::on_execButton_clicked()
{ {
on_r2InputLineEdit_returnPressed(); on_rzInputLineEdit_returnPressed();
} }
void ConsoleWidget::showCustomContextMenu(const QPoint &pt) void ConsoleWidget::showCustomContextMenu(const QPoint &pt)
@ -324,9 +324,9 @@ void ConsoleWidget::historyNext()
--lastHistoryPosition; --lastHistoryPosition;
if (lastHistoryPosition >= 0) { if (lastHistoryPosition >= 0) {
ui->r2InputLineEdit->setText(history.at(lastHistoryPosition)); ui->rzInputLineEdit->setText(history.at(lastHistoryPosition));
} else { } else {
ui->r2InputLineEdit->clear(); ui->rzInputLineEdit->clear();
} }
@ -341,7 +341,7 @@ void ConsoleWidget::historyPrev()
lastHistoryPosition = history.size() - 2; lastHistoryPosition = history.size() - 2;
} }
ui->r2InputLineEdit->setText(history.at(++lastHistoryPosition)); ui->rzInputLineEdit->setText(history.at(++lastHistoryPosition));
} }
} }
@ -372,7 +372,7 @@ void ConsoleWidget::updateCompletion()
return; return;
} }
auto current = ui->r2InputLineEdit->text(); auto current = ui->rzInputLineEdit->text();
auto completions = Core()->autocomplete(current, RZ_LINE_PROMPT_DEFAULT); auto completions = Core()->autocomplete(current, RZ_LINE_PROMPT_DEFAULT);
int lastSpace = current.lastIndexOf(' '); int lastSpace = current.lastIndexOf(' ');
if (lastSpace >= 0) { if (lastSpace >= 0) {
@ -387,14 +387,14 @@ void ConsoleWidget::updateCompletion()
void ConsoleWidget::clear() void ConsoleWidget::clear()
{ {
disableCompletion(); disableCompletion();
ui->r2InputLineEdit->clear(); ui->rzInputLineEdit->clear();
ui->debugeeInputLineEdit->clear(); ui->debugeeInputLineEdit->clear();
invalidateHistoryPosition(); invalidateHistoryPosition();
// Close the potential shown completer popup // Close the potential shown completer popup
ui->r2InputLineEdit->clearFocus(); ui->rzInputLineEdit->clearFocus();
ui->r2InputLineEdit->setFocus(); ui->rzInputLineEdit->setFocus();
} }
void ConsoleWidget::scrollOutputToEnd() void ConsoleWidget::scrollOutputToEnd()
@ -443,7 +443,7 @@ void ConsoleWidget::redirectOutput()
{ {
// Make sure that we are running in a valid console with initialized output handles // Make sure that we are running in a valid console with initialized output handles
if (0 > fileno(stderr) && 0 > fileno(stdout)) { 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; return;
} }

View File

@ -51,7 +51,7 @@ public slots:
private slots: private slots:
void setupFont(); void setupFont();
void on_r2InputLineEdit_returnPressed(); void on_rzInputLineEdit_returnPressed();
void on_debugeeInputLineEdit_returnPressed(); void on_debugeeInputLineEdit_returnPressed();
void onIndexChange(); void onIndexChange();

View File

@ -90,7 +90,7 @@
</property> </property>
<item> <item>
<property name="text"> <property name="text">
<string>R2 Console</string> <string>Rizin Console</string>
</property> </property>
</item> </item>
<item> <item>
@ -101,7 +101,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="1"> <item row="0" column="1">
<widget class="QLineEdit" name="r2InputLineEdit"> <widget class="QLineEdit" name="rzInputLineEdit">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Minimum"> <sizepolicy hsizetype="Expanding" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>

View File

@ -335,40 +335,40 @@ void CutterGraphView::exportGraph(QString filePath, GraphExportType type, QStrin
break; break;
case GraphExportType::GVDot: case GraphExportType::GVDot:
exportR2TextGraph(filePath, graphCommand + "d", address); exportRzTextGraph(filePath, graphCommand + "d", address);
break; break;
case GraphExportType::R2Json: case GraphExportType::RzJson:
exportR2TextGraph(filePath, graphCommand + "j", address); exportRzTextGraph(filePath, graphCommand + "j", address);
break; break;
case GraphExportType::R2Gml: case GraphExportType::RzGml:
exportR2TextGraph(filePath, graphCommand + "g", address); exportRzTextGraph(filePath, graphCommand + "g", address);
break; break;
case GraphExportType::R2SDBKeyValue: case GraphExportType::RzSDBKeyValue:
exportR2TextGraph(filePath, graphCommand + "k", address); exportRzTextGraph(filePath, graphCommand + "k", address);
break; break;
case GraphExportType::GVJson: case GraphExportType::GVJson:
exportR2GraphvizGraph(filePath, "json", graphCommand, address); exportRizinGraphvizGraph(filePath, "json", graphCommand, address);
break; break;
case GraphExportType::GVGif: case GraphExportType::GVGif:
exportR2GraphvizGraph(filePath, "gif", graphCommand, address); exportRizinGraphvizGraph(filePath, "gif", graphCommand, address);
break; break;
case GraphExportType::GVPng: case GraphExportType::GVPng:
exportR2GraphvizGraph(filePath, "png", graphCommand, address); exportRizinGraphvizGraph(filePath, "png", graphCommand, address);
break; break;
case GraphExportType::GVJpeg: case GraphExportType::GVJpeg:
exportR2GraphvizGraph(filePath, "jpg", graphCommand, address); exportRizinGraphvizGraph(filePath, "jpg", graphCommand, address);
break; break;
case GraphExportType::GVPostScript: case GraphExportType::GVPostScript:
exportR2GraphvizGraph(filePath, "ps", graphCommand, address); exportRizinGraphvizGraph(filePath, "ps", graphCommand, address);
break; break;
case GraphExportType::GVSvg: case GraphExportType::GVSvg:
exportR2GraphvizGraph(filePath, "svg", graphCommand, address); exportRizinGraphvizGraph(filePath, "svg", graphCommand, address);
break; break;
} }
} }
void CutterGraphView::exportR2GraphvizGraph(QString filePath, QString type, QString graphCommand, void CutterGraphView::exportRizinGraphvizGraph(QString filePath, QString type, QString graphCommand,
RVA address) RVA address)
{ {
TempConfig tempConfig; 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); 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); QFile file(filePath);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { 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)} {tr("SVG (*.svg)"), "svg", QVariant::fromValue(GraphExportType::Svg)}
}; };
bool r2GraphExports = !graphCommand.isEmpty(); bool rzGraphExports = !graphCommand.isEmpty();
if (r2GraphExports) { if (rzGraphExports) {
types.append({ types.append({
{tr("Graphviz dot (*.dot)"), "dot", QVariant::fromValue(GraphExportType::GVDot)}, {tr("Graphviz dot (*.dot)"), "dot", QVariant::fromValue(GraphExportType::GVDot)},
{tr("Graph Modelling Language (*.gml)"), "gml", QVariant::fromValue(GraphExportType::R2Gml)}, {tr("Graph Modelling Language (*.gml)"), "gml", QVariant::fromValue(GraphExportType::RzGml)},
{tr("R2 JSON (*.json)"), "json", QVariant::fromValue(GraphExportType::R2Json)}, {tr("RZ JSON (*.json)"), "json", QVariant::fromValue(GraphExportType::RzJson)},
{tr("SDB key-value (*.txt)"), "txt", QVariant::fromValue(GraphExportType::R2SDBKeyValue)}, {tr("SDB key-value (*.txt)"), "txt", QVariant::fromValue(GraphExportType::RzSDBKeyValue)},
}); });
bool hasGraphviz = !QStandardPaths::findExecutable("dot").isEmpty() bool hasGraphviz = !QStandardPaths::findExecutable("dot").isEmpty()
|| !QStandardPaths::findExecutable("xdot").isEmpty(); || !QStandardPaths::findExecutable("xdot").isEmpty();

View File

@ -25,40 +25,40 @@ public:
enum class GraphExportType { enum class GraphExportType {
Png, Jpeg, Svg, GVDot, GVJson, Png, Jpeg, Svg, GVDot, GVJson,
GVGif, GVPng, GVJpeg, GVPostScript, GVSvg, GVGif, GVPng, GVJpeg, GVPostScript, GVSvg,
R2Gml, R2SDBKeyValue, R2Json RzGml, RzSDBKeyValue, RzJson
}; };
/** /**
* @brief Export graph to a file in the specified format * @brief Export graph to a file in the specified format
* @param filePath * @param filePath
* @param type export type, GV* and R2* types require \p graphCommand * @param type export type, GV* and Rz* types require \p graphCommand
* @param graphCommand r2 graph printing command without type, not required for direct image export * @param graphCommand rizin graph printing command without type, not required for direct image export
* @param address object address for commands like agf * @param address object address for commands like agf
*/ */
void exportGraph(QString filePath, GraphExportType type, QString graphCommand = "", void exportGraph(QString filePath, GraphExportType type, QString graphCommand = "",
RVA address = RVA_INVALID); 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. * Requires graphviz dot executable in the path.
* *
* @param filePath output file path * @param filePath output file path
* @param type image format as expected by "e graph.gv.format" * @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 * @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 filePath output file path
* @param graphCommand graph command including the format, example "agfd" or "agfg" * @param graphCommand graph command including the format, example "agfd" or "agfg"
* @param address object address if required by command * @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); static bool graphIsBitamp(GraphExportType type);
/** /**
* @brief Show graph export dialog. * @brief Show graph export dialog.
* @param defaultName - default file name in the 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 * @param graphCommand - rizin 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. * for non-rizin graphs. In such case only direct image export will be available.
* @param address - object address if relevant for \p graphCommand * @param address - object address if relevant for \p graphCommand
*/ */
void showExportGraphDialog(QString defaultName, QString graphCommand = "", void showExportGraphDialog(QString defaultName, QString graphCommand = "",
@ -76,7 +76,7 @@ public slots:
void zoomReset(); 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(); virtual void showExportDialog();
signals: signals:

View File

@ -209,7 +209,7 @@ void DebugActions::showDebugWarning()
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse); msgBox.setTextInteractionFlags(Qt::TextSelectableByMouse | Qt::LinksAccessibleByMouse);
msgBox.setText(tr("Debug is currently in beta.\n") + 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(); msgBox.exec();
} }
} }

View File

@ -544,7 +544,7 @@ void FunctionsWidget::onActionFunctionsRenameTriggered()
tr("Function name:"), QLineEdit::Normal, function.name, &ok); tr("Function name:"), QLineEdit::Normal, function.name, &ok);
// If user accepted // If user accepted
if (ok && !newName.isEmpty()) { if (ok && !newName.isEmpty()) {
// Rename function in r2 core // Rename function in rizin core
Core()->renameFunction(function.offset, newName); Core()->renameFunction(function.offset, newName);
// Seek to new renamed function // Seek to new renamed function

View File

@ -24,7 +24,7 @@ public:
int y = 0; int y = 0;
int width = 0; int width = 0;
int height = 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; ut64 entry;
// Edges // Edges
std::vector<GraphEdge> edges; std::vector<GraphEdge> edges;

View File

@ -1,14 +1,14 @@
#include "R2GraphWidget.h" #include "RizinGraphWidget.h"
#include "ui_R2GraphWidget.h" #include "ui_RizinGraphWidget.h"
#include <QJsonValue> #include <QJsonValue>
#include <QJsonArray> #include <QJsonArray>
#include <QJsonObject> #include <QJsonObject>
R2GraphWidget::R2GraphWidget(MainWindow *main) RizinGraphWidget::RizinGraphWidget(MainWindow *main)
: CutterDockWidget(main) : CutterDockWidget(main)
, ui(new Ui::R2GraphWidget) , ui(new Ui::RizinGraphWidget)
, graphView(new GenericR2GraphView(this, main)) , graphView(new GenericRizinGraphView(this, main))
{ {
ui->setupUi(this); ui->setupUi(this);
ui->verticalLayout->addWidget(graphView); 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](){ connect(ui->customCommand, &QLineEdit::textEdited, this, [this](){
graphView->setGraphCommand(ui->customCommand->text()); graphView->setGraphCommand(ui->customCommand->text());
}); });
@ -51,11 +51,11 @@ R2GraphWidget::R2GraphWidget(MainWindow *main)
typeChanged(); typeChanged();
} }
R2GraphWidget::~R2GraphWidget() RizinGraphWidget::~RizinGraphWidget()
{ {
} }
void R2GraphWidget::typeChanged() void RizinGraphWidget::typeChanged()
{ {
auto currentData = ui->graphType->currentData(); auto currentData = ui->graphType->currentData();
if (currentData.isNull()) { 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) : SimpleTextGraphView(parent, main)
, refreshDeferrer(nullptr, this) , refreshDeferrer(nullptr, this)
{ {
refreshDeferrer.registerFor(parent); 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; graphCommand = cmd;
} }
void GenericR2GraphView::refreshView() void GenericRizinGraphView::refreshView()
{ {
if (!refreshDeferrer.attemptRefresh(nullptr)) { if (!refreshDeferrer.attemptRefresh(nullptr)) {
return; return;
@ -91,7 +91,7 @@ void GenericR2GraphView::refreshView()
SimpleTextGraphView::refreshView(); SimpleTextGraphView::refreshView();
} }
void GenericR2GraphView::loadCurrentGraph() void GenericRizinGraphView::loadCurrentGraph()
{ {
blockContent.clear(); blockContent.clear();
blocks.clear(); blocks.clear();

View File

@ -1,5 +1,5 @@
#ifndef R2_GRAPH_WIDGET_H #ifndef RZ_GRAPH_WIDGET_H
#define R2_GRAPH_WIDGET_H #define RZ_GRAPH_WIDGET_H
#include <memory> #include <memory>
@ -11,14 +11,14 @@
class MainWindow; class MainWindow;
namespace Ui { namespace Ui {
class R2GraphWidget; class RizinGraphWidget;
} }
class R2GraphWidget; class RizinGraphWidget;
/** /**
* @brief Generic graph view for r2 graphs. * @brief Generic graph view for rizin graphs.
* Not all r2 graph commands output the same kind of json. Only those that have following format * Not all rizin graph commands output the same kind of json. Only those that have following format
* @code{.json} * @code{.json}
* { "nodes": [ * { "nodes": [
* { * {
@ -31,14 +31,14 @@ class R2GraphWidget;
* ]} * ]}
* @endcode * @endcode
* Id don't have to be sequential. Simple text label is displayed containing concatenation of * 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. * not present in the list of nodes are removed.
*/ */
class GenericR2GraphView : public SimpleTextGraphView class GenericRizinGraphView : public SimpleTextGraphView
{ {
Q_OBJECT Q_OBJECT
public: public:
GenericR2GraphView(R2GraphWidget *parent, MainWindow *main); GenericRizinGraphView(RizinGraphWidget *parent, MainWindow *main);
void setGraphCommand(QString cmd); void setGraphCommand(QString cmd);
void refreshView() override; void refreshView() override;
protected: protected:
@ -50,19 +50,19 @@ private:
}; };
class R2GraphWidget : public CutterDockWidget class RizinGraphWidget : public CutterDockWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit R2GraphWidget(MainWindow *main); explicit RizinGraphWidget(MainWindow *main);
~R2GraphWidget(); ~RizinGraphWidget();
private: private:
std::unique_ptr<Ui::R2GraphWidget> ui; std::unique_ptr<Ui::RizinGraphWidget> ui;
GenericR2GraphView *graphView; GenericRizinGraphView *graphView;
void typeChanged(); void typeChanged();
}; };
#endif // R2_GRAPH_WIDGET_H #endif // RZ_GRAPH_WIDGET_H

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>R2GraphWidget</class> <class>RizinGraphWidget</class>
<widget class="QDockWidget" name="R2GraphWidget"> <widget class="QDockWidget" name="RizinGraphWidget">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string notr="true">R2 graphs</string> <string notr="true">Rizin graphs</string>
</property> </property>
<widget class="QWidget" name="dockWidgetContents"> <widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">