Skip to Content.
Sympa Menu

sm-commit - [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (e487e4cf3f1c5190119527ae5341a21aeb62fe1d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
  • Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (e487e4cf3f1c5190119527ae5341a21aeb62fe1d)
  • Date: Sun, 9 Aug 2026 06:03:48 +0000

GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:

ChangeLog
| 4
FUNCTIONS
| 14 +-
devel/iaito-r2ghidra/BUILD
| 7 +
devel/iaito-r2ghidra/DEPENDS
| 9 +
devel/iaito-r2ghidra/DETAILS
| 30 ++++
devel/iaito-r2ghidra/HISTORY
| 4
devel/iaito-r2ghidra/INSTALL
| 2
devel/iaito-r2ghidra/IaitoR2GhidraPlugin.pro
| 17 ++
devel/iaito-r2ghidra/PRE_BUILD
| 8 +

devel/iaito-r2ghidra/patches/0001-iaito-plugin-adapt-to-current-Decompiler-API.patch
| 70 ++++++++++
devel/r2cutter/DETAILS
| 6
11 files changed, 166 insertions(+), 5 deletions(-)

New commits:
commit e487e4cf3f1c5190119527ae5341a21aeb62fe1d
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

iaito-r2ghidra: new spell, Ghidra decompiler plugin for iaito

commit 430c2bbb41348e4a1cca4dc5b0cd8f13dd8732b0
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

FUNCTIONS: apply_patch_dir: Implement -C and -p flags

-p => passed through to patch
-C => change directory

commit ebd2accfde3b4098acdf8428b8c77c6a10e51945
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

r2cutter: Fix desc block

diff --git a/ChangeLog b/ChangeLog
index d2011d3..dde776f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2026-08-09 Ismael Luceno <ismael AT sourcemage.org>
+ * devel/iaito-r2ghidra: new spell, Ghidra decompiler plugin for
+ iaito
+
2026-08-08 Pavel Vinogradov <public AT sourcemage.org>
* FUNCTIONS: fixed typo in apply_patch_dir causing it to always look
in /

diff --git a/FUNCTIONS b/FUNCTIONS
index 251b9b2..e9ab5de 100755
--- a/FUNCTIONS
+++ b/FUNCTIONS
@@ -298,7 +298,17 @@ function install_www_files ()
## Apply patches from a directory
#---------------------------------------------------------------------
apply_patch_dir() {
- local dir
+ local dir stripdirs=1 patchopts=()
+ while :
+ do
+ case "$1" in
+ (-C) patchopts+=(-d "$2"); shift 2;;
+ (-p*) stripdirs="${1#-p}"; shift;;
+ (--) shift;&
+ (*) break;;
+ esac
+ done
+ patchopts+=(-f -p"$stripdirs")
case "$1" in
(/*) dir="$1";;
(*) dir="$SPELL_DIRECTORY/$1" ;;
@@ -309,7 +319,7 @@ apply_patch_dir() {
then
find "$dir" \( -name Attic \) -prune -o \
\( -name \*.patch -o -name \*.diff \) -print0 |
- sort -zV | xargs -r -0 -n 1 -t patch -fp1 -i
+ sort -zV | xargs -r -0 -n 1 -t -- patch "${patchopts[@]}" -i
else
message "${MESSAGE_COLOR}No patches found.$DEFAULT_COLOR"
fi
diff --git a/devel/iaito-r2ghidra/BUILD b/devel/iaito-r2ghidra/BUILD
new file mode 100755
index 0000000..9a6bc0c
--- /dev/null
+++ b/devel/iaito-r2ghidra/BUILD
@@ -0,0 +1,7 @@
+cd "$SOURCE_DIRECTORY/src/plugins/r2ghidra" &&
+export R2GHIDRA_PLUGDIR="$(radare2 -H R2_LIBR_PLUGINS)" &&
+if is_depends_enabled iaito qt6base; then
+ qt6_build
+else
+ qt5_build
+fi
diff --git a/devel/iaito-r2ghidra/DEPENDS b/devel/iaito-r2ghidra/DEPENDS
new file mode 100755
index 0000000..4cbf7bd
--- /dev/null
+++ b/devel/iaito-r2ghidra/DEPENDS
@@ -0,0 +1,9 @@
+depends PKG-CONFIG &&
+depends radare2 &&
+depends r2ghidra &&
+depends iaito &&
+if is_depends_enabled iaito qt6base; then
+ depends qt6base
+else
+ depends qtbase
+fi
diff --git a/devel/iaito-r2ghidra/DETAILS b/devel/iaito-r2ghidra/DETAILS
new file mode 100755
index 0000000..90c3e7b
--- /dev/null
+++ b/devel/iaito-r2ghidra/DETAILS
@@ -0,0 +1,30 @@
+# Watch: https://github.com/radareorg/r2ghidra/tags
+ SPELL=iaito-r2ghidra
+ VERSION=6.2.0
+ IAITO_VERSION=6.1.8
+ SOURCE=iaito-$IAITO_VERSION.tar.gz
+
SOURCE_URL[0]=https://github.com/radareorg/iaito/archive/$IAITO_VERSION.tar.gz
+
SOURCE_HASH=sha512:9ab8619e923f8bb67219e8cbd912dcd940f1dd917db277e4fae1ffbbb5b24711de728c6ef3d8c2c96e489c6ee533593012b24aef0166b2cc47782c6fb4117821
+SOURCE_DIRECTORY="$BUILD_DIRECTORY/iaito-$IAITO_VERSION"
+ SOURCE2=r2ghidra-$VERSION.tar.gz
+
SOURCE2_URL[0]=https://github.com/radareorg/r2ghidra/archive/refs/tags/$VERSION.tar.gz
+
SOURCE2_HASH=sha512:3cc444bc172c3181a0061616c776fe99b1ab9537c10da2145b0e908b351622a85889f660e9020653a440a14c59c21b0b1222ef4d26c13989e4eb33a363281c35
+ DOC_DIRS="doc"
+ WEB_SITE=https://github.com/radareorg/r2ghidra
+ ENTERED=20260808
+ LICENSE[0]=LGPL-3.0-only
+ KEYWORDS="radare2 reverse-engineering decompiler"
+ SHORT="Ghidra decompiler plugin for iaito"
+cat << EOF
+Native GUI integration of r2ghidra's Ghidra decompiler engine for iaito.
+
+Only the iaito-plugin/ subtree is pulled out of r2ghidra's tarball (already
+cached locally by the r2ghidra spell, same filename and hash), patched to
+match iaito's current Decompiler API, and built as an extra plugin
+subdirectory of iaito's own source, since iaito's plugin API headers aren't
+installed system-wide. The resulting Qt plugin links against the
+core_r2ghidra library provided by the r2ghidra spell.
+
+Without this spell, iaito can still invoke r2ghidra through radare2's own
+"pdg" command, just without the native decompiler-tab integration.
+EOF
diff --git a/devel/iaito-r2ghidra/HISTORY b/devel/iaito-r2ghidra/HISTORY
new file mode 100644
index 0000000..aa3ed61
--- /dev/null
+++ b/devel/iaito-r2ghidra/HISTORY
@@ -0,0 +1,4 @@
+2026-08-09 Ismael Luceno <ismael AT sourcemage.org>
+ * BUILD, DEPENDS, DETAILS, INSTALL, IaitoR2GhidraPlugin.pro,
PRE_BUILD,
+ patches/0001-iaito-plugin-adapt-to-current-Decompiler-API.patch:
+ spell crated
diff --git a/devel/iaito-r2ghidra/INSTALL b/devel/iaito-r2ghidra/INSTALL
new file mode 100755
index 0000000..93a8be4
--- /dev/null
+++ b/devel/iaito-r2ghidra/INSTALL
@@ -0,0 +1,2 @@
+install -Dt "$INSTALL_ROOT/usr/share/radareorg/iaito/plugins/native" \
+ -vm555 lib*.so
diff --git a/devel/iaito-r2ghidra/IaitoR2GhidraPlugin.pro
b/devel/iaito-r2ghidra/IaitoR2GhidraPlugin.pro
new file mode 100644
index 0000000..bf72f9b
--- /dev/null
+++ b/devel/iaito-r2ghidra/IaitoR2GhidraPlugin.pro
@@ -0,0 +1,17 @@
+# Built as an extra plugin subdirectory of iaito's own source tree, next to
+# src/plugins/sample-cpp, so it picks up iaito's internal (unexported)
+# headers the same way iaito's own plugins do.
+
+HEADERS += R2GhidraDecompiler.h R2GhidraPlugin.h ../IaitoPlugin.h
+SOURCES += R2GhidraDecompiler.cpp R2GhidraPlugin.cpp
+
+INCLUDEPATH += ../ ../../ ../../core ../../common ../../widgets
../../dialogs
+
+QMAKE_CXXFLAGS += $$system("pkg-config --cflags r_core")
+LIBS += $$system("pkg-config --libs r_core")
+LIBS += -L$$(R2GHIDRA_PLUGDIR) -lcore_r2ghidra
+
+TEMPLATE = lib
+CONFIG += plugin
+QT += widgets
+TARGET = R2GhidraIaitoPlugin
diff --git a/devel/iaito-r2ghidra/PRE_BUILD b/devel/iaito-r2ghidra/PRE_BUILD
new file mode 100755
index 0000000..1dc4d57
--- /dev/null
+++ b/devel/iaito-r2ghidra/PRE_BUILD
@@ -0,0 +1,8 @@
+. "$GRIMOIRE/FUNCTIONS" &&
+default_pre_build &&
+plugindir="$SOURCE_DIRECTORY/src/plugins/r2ghidra" &&
+mkdir -p "$plugindir" &&
+tar xzf "$SOURCE_CACHE/$SOURCE2" -C "$plugindir" \
+ --strip-components=2 "r2ghidra-$VERSION/iaito-plugin" &&
+apply_patch_dir -p2 -C "$plugindir" patches &&
+cp -v "$SPELL_DIRECTORY/IaitoR2GhidraPlugin.pro" "$plugindir"
diff --git
a/devel/iaito-r2ghidra/patches/0001-iaito-plugin-adapt-to-current-Decompiler-API.patch

b/devel/iaito-r2ghidra/patches/0001-iaito-plugin-adapt-to-current-Decompiler-API.patch
new file mode 100644
index 0000000..cc948a7
--- /dev/null
+++
b/devel/iaito-r2ghidra/patches/0001-iaito-plugin-adapt-to-current-Decompiler-API.patch
@@ -0,0 +1,70 @@
+From 22b96f759328a0d99d4da9ebfcbc390d3e093787 Mon Sep 17 00:00:00 2001
+From: Ismael Luceno <ismael AT sourcemage.org>
+Date: Sat, 8 Aug 2026 21:44:19 +0000
+Subject: [PATCH] iaito-plugin: Adapt to current Decompiler API
+
+Decompiler now requires decompileSync to be implemented in addition
+to decompileAt and the plugin no longer assumes r2ghidra's own
+source tree is available at build time.
+---
+ iaito-plugin/R2GhidraDecompiler.cpp | 17 +++++++++++++----
+ iaito-plugin/R2GhidraDecompiler.h | 1 +
+ 2 files changed, 14 insertions(+), 4 deletions(-)
+
+diff --git a/iaito-plugin/R2GhidraDecompiler.cpp
b/iaito-plugin/R2GhidraDecompiler.cpp
+index 4632a4f..047f097 100644
+--- a/iaito-plugin/R2GhidraDecompiler.cpp
++++ b/iaito-plugin/R2GhidraDecompiler.cpp
+@@ -1,7 +1,6 @@
+ /* radare - LGPL - Copyright 2019 - thestr4ng3r */
+
+ #include "R2GhidraDecompiler.h"
+-#include "../src/r2ghidra.h"
+
+ #include <Iaito.h>
+
+@@ -9,16 +8,26 @@
+ #include <QJsonObject>
+ #include <QJsonArray>
+
++// Declared locally: r2ghidra.h lives in r2ghidra's own source tree, which
++// isn't available here, this plugin only links against the already built
++// and installed core_r2ghidra library.
++R_API RCodeMeta *r2ghidra_decompile_annotated_code(RCore *core, ut64 addr);
++
+ R2GhidraDecompiler::R2GhidraDecompiler(QObject *parent)
+ : Decompiler("r2ghidra", "Ghidra", parent)
+ {
+ task = DecompilerFinished;
+ }
+
+-void R2GhidraDecompiler::decompileAt(ut64 addr)
++RCodeMeta *R2GhidraDecompiler::decompileSync(RVA addr)
++{
++ return r2ghidra_decompile_annotated_code(Core()->core(), addr);
++}
++
++void R2GhidraDecompiler::decompileAt(RVA addr)
+ {
+ task = DecompilerRunning;
+- RCodeMeta *code = r2ghidra_decompile_annotated_code(Core()->core(),
addr);
+- emit finished(code); //Here, we emit RAnnotatedCode *code or by value
++ RCodeMeta *code = decompileSync(addr);
++ emit finished(code); //Here, we emit RCodeMeta *code or by value
+ task = DecompilerFinished;
+ }
+diff --git a/iaito-plugin/R2GhidraDecompiler.h
b/iaito-plugin/R2GhidraDecompiler.h
+index 039ad5d..8e830dd 100644
+--- a/iaito-plugin/R2GhidraDecompiler.h
++++ b/iaito-plugin/R2GhidraDecompiler.h
+@@ -15,6 +15,7 @@ class R2GhidraDecompiler: public Decompiler
+ public:
+ R2GhidraDecompiler(QObject *parent = nullptr);
+ void decompileAt(RVA addr) override;
++ RCodeMeta *decompileSync(RVA addr) override;
+ bool isRunning() override {
return task == DecompilerRunning; }
+ };
+
+--
+2.54.0
+
diff --git a/devel/r2cutter/DETAILS b/devel/r2cutter/DETAILS
index eece67b..b1ee54d 100755
--- a/devel/r2cutter/DETAILS
+++ b/devel/r2cutter/DETAILS
@@ -2,6 +2,6 @@
VERSION=0
PATCHLEVEL=9999
SHORT="deprecated"
- cat << EOF
- deprecated spell [replaced by iaito]
- EOF
+cat << EOF
+deprecated spell [replaced by iaito]
+EOF


  • [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (e487e4cf3f1c5190119527ae5341a21aeb62fe1d), Ismael Luceno, 08/09/2026

Archive powered by MHonArc 2.6.24.

Top of Page