16 Commits
Author SHA1 Message Date
Anton Kochkov 9bee5c3771 Merge 'dev' branch into stable 2026-06-21 11:31:54 +04:00
Anton Kochkov dd35844550 Merge branch 'stable' into stable-merge 2026-06-21 11:31:42 +04:00
e4aef7d474 Merge dev into stable (#81)
* Add bindings for HtSP, HtSS, HtSU (#57)

* Format via black & fix lint check

* Revert "Format via black & fix lint check"

This reverts commit aa3340800e.

* Add missing HT types to lint.py (#58)

* ci: update used pypa/cibuildwheel version (#59)

* Add missing `ht_*` headers into cparser_header.py (#60)

* Fix SWIG snippet example (#61)

* Use `manylinux2014` base image instead (#62)

* Use `manylinux2014` base image instead
* Drop i686 support

* Uniquify artifact names (#63)

* Print filename when assert.

* Remove SdbList as it was removed in Rizin (#64)

* Remove lastline from RzCons bindings

* Update pypa/cibuildwheel to 2.22.0

* ci: use macOS 14 as macOS 12 is deprecated

* ci: support pip3 for python 3.12 and later

* Fix wrong check on nonnull args which are inner not outer.

* Revert "Fix wrong check on nonnull args which are inner not outer."

This reverts commit c527db8fcb.

* Ensure argument name never matches the function name

* Use `/` instead of `\\` in CMAKE_PREFIX_PATH for Windows (#72)

* ci/mypy: disable unnecessary warning (#73)

* ci: use corresponding rizin branch (#75)

* ci: use corresponding rizin branch

* Fix compilation (#77)

* Fix compilation due defines being redefined
* Add support for TypeKind.FUNCTIONNOPROTO

* ci: Upgrade to Ubuntu 24.04 (Noble) (#79)

* ci: Upgrade to Ubuntu 24.04 (Noble)
* Remove `pip3 --break-system-packages`
* Use `-include linux/limits.h` for Alpine build

* Cleanup inclusion of linux/limits.h (#80)

---------

Co-authored-by: pelijah <[email protected]>
Co-authored-by: wargio <[email protected]>
Co-authored-by: Anton Kochkov <[email protected]>
Co-authored-by: Khairul Azhar Kasmiran <[email protected]>
Co-authored-by: Anton Kochkov <[email protected]>
Co-authored-by: wargio <[email protected]>
Co-authored-by: Giovanni <[email protected]>
2025-04-22 23:49:20 +08:00
NOT XVilka a03d1f32f5 Merge branch 'stable' into update-stable 2025-04-22 23:25:16 +08:00
Anton Kochkov fc64be188f ci: use corresponding rizin branch 2024-12-21 20:45:37 +08:00
Anton Kochkov aabbf0df6b ci: use corresponding rizin branch (#75) 2024-12-21 20:18:02 +08:00
Anton Kochkov 5740a3770b ci/mypy: disable unnecessary warning (#73) 2024-12-21 20:18:02 +08:00
Khairul Azhar Kasmiran 878f562385 Use / instead of \\ in CMAKE_PREFIX_PATH for Windows (#72) 2024-12-21 20:18:02 +08:00
wargio a71ec49cf0 Ensure argument name never matches the function name 2024-12-21 20:18:02 +08:00
Anton Kochkov 48bc95c67a ci: support pip3 for python 3.12 and later 2024-12-21 20:18:02 +08:00
Anton Kochkov 4a15bfe470 ci: use macOS 14 as macOS 12 is deprecated 2024-12-21 20:18:02 +08:00
Anton Kochkov f9456f670c Update pypa/cibuildwheel to 2.22.0 2024-12-21 20:18:02 +08:00
wargio 961e34a258 Print filename when assert. 2024-12-21 20:18:02 +08:00
Khairul Azhar Kasmiran ad843b76d1 Uniquify artifact names (#63) 2024-12-21 20:18:02 +08:00
Khairul Azhar Kasmiran 00422160f1 Use manylinux2014 base image instead (#62)
* Use `manylinux2014` base image instead
* Drop i686 support
2024-12-21 20:18:02 +08:00
Anton Kochkov fadef06f39 ci: update used pypa/cibuildwheel version (#59) 2024-12-21 20:18:02 +08:00
14 changed files with 47 additions and 106 deletions

No files matched your search

+13 -19
View File
@@ -26,20 +26,20 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, windows-2022, macos-15]
os: [ubuntu-24.04, windows-2022, macos-14]
steps:
- name: Install SWIG with Homebrew
if: matrix.os == 'macos-15' && matrix.enabled
if: matrix.os == 'macos-14' && matrix.enabled
run: brew install swig
- name: Checkout rz-bindgen
uses: actions/checkout@v7
uses: actions/checkout@v6
# runned only from workflow_call
- name: Checkout rizin
if: ${{ inputs.external_call }}
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
repository: rizinorg/rizin
path: rizin
@@ -47,7 +47,7 @@ jobs:
- name: Checkout rizin (stable)
if: ${{ !inputs.external_call && ((github.ref_name == 'stable') || (github.base_ref == 'stable')) }}
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
repository: rizinorg/rizin
path: rizin
@@ -55,14 +55,14 @@ jobs:
- name: Checkout rizin (dev)
if: ${{ !inputs.external_call && ((github.ref_name != 'stable') && (github.base_ref != 'stable')) }}
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
repository: rizinorg/rizin
path: rizin
ref: dev
- name: Build rz-bindgen
uses: pypa/cibuildwheel@v4.3.5
uses: pypa/cibuildwheel@v3.4.1
- name: Upload sdist
uses: actions/upload-artifact@v7
@@ -81,14 +81,14 @@ jobs:
steps:
- name: Checkout rz-bindgen
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
path: rz-bindgen
# runned only from workflow_call
- name: Checkout rizin
if: ${{ inputs.external_call }}
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
repository: rizinorg/rizin
path: rizin
@@ -96,7 +96,7 @@ jobs:
- name: Checkout rizin (stable)
if: ${{ !inputs.external_call && ((github.ref_name == 'stable') || (github.base_ref == 'stable')) }}
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
repository: rizinorg/rizin
path: rizin
@@ -104,7 +104,7 @@ jobs:
- name: Checkout rizin (dev)
if: ${{ !inputs.external_call && ((github.ref_name != 'stable') && (github.base_ref != 'stable')) }}
uses: actions/checkout@v7
uses: actions/checkout@v6
with:
repository: rizinorg/rizin
path: rizin
@@ -132,12 +132,6 @@ jobs:
- name: Test python lang plugin
run: rizin -qc "Ll" | grep "Python SWIG"
- name: Checkout our Testsuite Binaries
uses: actions/checkout@v7
with:
repository: rizinorg/rizin-testbins
path: rz-bindgen/test/bins
- name: Run rz-test
run: rz-test -L db/examples
working-directory: rz-bindgen/test
run: rz-test -L tests/
working-directory: rz-bindgen
+3 -3
View File
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout rz-bindgen
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: REUSE compliance check
uses: fsfe/reuse-action@v6
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-24.04
steps:
- name: Checkout rz-bindgen
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: Install tools
run: |
pip install mypy pyflakes pylint black
@@ -46,7 +46,7 @@ jobs:
security-events: write
steps:
- name: Checkout rz-bindgen
uses: actions/checkout@v7
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
+1 -1
View File
@@ -35,6 +35,6 @@ jobs:
name: sdist
path: dist
- name: Publish wheels
uses: pypa/[email protected].3
uses: pypa/[email protected].0
with:
password: ${{ secrets.PYPI_TOKEN }}
+1 -7
View File
@@ -46,13 +46,7 @@ SPDX-FileCopyrightText = "2022 wingdeans <[email protected]>"
SPDX-License-Identifier = "LGPL-3.0-only"
[[annotations]]
path = "test/db/**"
precedence = "aggregate"
SPDX-FileCopyrightText = "2026 RizinOrg <[email protected]>"
SPDX-License-Identifier = "LGPL-3.0-only"
[[annotations]]
path = "test/.gitignore"
path = "tests/**"
precedence = "aggregate"
SPDX-FileCopyrightText = "2026 RizinOrg <[email protected]>"
SPDX-License-Identifier = "LGPL-3.0-only"
+2 -2
View File
@@ -35,11 +35,11 @@ fi
pushd rizin
if [[ "$OSTYPE" =~ msys|cygwin ]]; then
if [[ "$OSTYPE" =~ msys* ]]; then
meson setup --buildtype=release --prefix='c:/rizin' --vsenv build
meson install -C build
else
if [[ "$OSTYPE" == linux* ]]; then
if [[ "$OSTYPE" =~ linux* ]]; then
export CFLAGS="-include linux/limits.h"
fi
meson setup --buildtype=release --libdir=lib build
+3 -3
View File
@@ -29,12 +29,12 @@ builder.enable_load_buffer = True
plugin = builder.build(CustomBinPlugin())
```
`RzBinPluginBuilder::build` returns an `RzBinPlugin` struct which has the enabled function pointers set to custom C functions which call into the currently active director. Enabling functions is done using variables on the builder which are named the same as their corresponding struct function pointer prefixed with `enable_`. To use the plugin, simply add the plugin to `core.bin`.
`RzBinPluginBuilder::build` returns an `RzBinPlugin` struct which has the enabled function pointers set to custom C functions which call into the currently active director. Enabling functions is done using variables on the builder which are named the same as their corresponding struct function pointer prefixed with `enable_`. To use the plugin, simply append the struct to `core.bin.plugins`.
```py
core = rizin.RzCore()
plugin.thisown = False
core.bin.plugin_add(plugin)
core.bin.plugins.append(plugin)
```
Now it is possible to see the `SWIGCustom` plugin when listing the binary plugins with `iL`:
@@ -72,7 +72,7 @@ plugin, plugin_struct = rizin.register_RzBinPlugin(CustomBinPlugin)
core = rizin.RzCore()
plugin_struct.thisown = False
core.bin.plugin_add(plugin_struct)
core.bin.plugins.append(plugin_struct)
# Run rizin and load binary
core.bin.force_plugin(plugin.name)
+1 -1
View File
@@ -30,7 +30,7 @@ builder.enable_load_buffer = True
plugin = builder.build(CustomBinPlugin())
core = rizin.RzCore()
core.bin.plugin_add(plugin)
core.bin.plugins.append(plugin)
# Run rizin and load binary
core.bin.force_plugin(plugin.name)
+1 -1
View File
@@ -21,7 +21,7 @@ plugin, plugin_struct = rizin.register_RzBinPlugin(CustomBinPlugin)
core = rizin.RzCore()
plugin_struct.thisown = False
core.bin.plugin_add(plugin_struct)
core.bin.plugins.append(plugin_struct)
# Run rizin and load binary
core.bin.force_plugin(plugin.name)
-1
View File
@@ -16,7 +16,6 @@ def install_files(scheme):
elif file.endswith(".so"):
dest_type = 'platlib'
install_dir = sysconfig.get_path(dest_type, scheme)
os.makedirs(install_dir, exist_ok=True)
shutil.copy(file, install_dir)
print(f"Installing {os.path.basename(file)} to {install_dir}")
+2 -2
View File
@@ -19,11 +19,11 @@ environment = { PATH="/opt/rh/llvm-toolset-7.0/root/usr/bin:/opt/rh/llvm-toolset
archs = ["x86_64"]
[tool.cibuildwheel.windows]
environment = { CMAKE_PREFIX_PATH="C:/rizin", PATH="C:/rizin/bin;$PATH" }
environment = { CMAKE_PREFIX_PATH="C:/rizin" }
archs = ["AMD64"]
[tool.cibuildwheel.macos]
environment = { PATH="/opt/homebrew/bin:$PATH", MACOSX_DEPLOYMENT_TARGET="15.0" }
environment = { PATH="/opt/homebrew/bin:$PATH", MACOSX_DEPLOYMENT_TARGET="14.0" }
[project]
name = "rz-bindings"
+5 -23
View File
@@ -110,25 +110,8 @@ def cursor_get_annotations(cursor: Cursor) -> List[str]:
]
generic_types = {
"RzList",
"RzListIter",
"RzPVector",
"RzVector",
"RzGraph",
"HtPP",
"RzThreadRingBuf",
"RzThreadQueue",
}
skip_files = {
"ht_inc.c",
"ht_inc.h",
"rz_th_ht.h",
"rz_th.h",
"thread_hash_table.c",
"thread_queue.c",
"thread_ring_buf.c",
}
generic_types = {"RzList", "RzListIter", "RzPVector", "RzVector", "RzGraph", "HtPP"}
skip_files = {"ht_inc.c", "ht_inc.h", "rz_th_ht.h", "thread_hash_table.c"}
def cursor_get_comment(cursor: Cursor, *, packed: bool = False) -> Optional[str]:
@@ -207,22 +190,21 @@ def cursor_get_comment(cursor: Cursor, *, packed: bool = False) -> Optional[str]
return comment
# Check pointer (or lack of) and space between pointer
if typeref_spelling in {"RzList", "RzListIter", "RzPVector", "RzThreadQueue"}:
if typeref_spelling in {"RzList", "RzListIter", "RzPVector"}:
if comment[-2] != "*":
warn(f"Type comment at {stringify_location(cursor.location)} lacks pointer")
elif comment[-3] != " ":
warn(
f"Type comment at {stringify_location(cursor.location)} lacks space between pointer"
)
elif typeref_spelling in {"RzVector", "RzThreadRingBuf"}:
elif typeref_spelling in {"RzVector"}:
if comment[-2] == "*":
warn(
f"Type comment at {stringify_location(cursor.location)} should not have pointer"
)
elif typeref_spelling in {"RzGraph", "HtPP"}:
if not re.match(
r"<(struct |const )?[A-Za-z0-9_]+ \*, (struct |const )?[A-Za-z0-9_]+ \*>",
comment,
r"<(struct )?[A-Za-z0-9_]+ \*, (struct )?[A-Za-z0-9_]+ \*>", comment
):
if typeref_spelling == "RzGraph":
warn(
-1
View File
@@ -1 +0,0 @@
/bins
-42
View File
@@ -1,42 +0,0 @@
NAME=1-rz_core.py =
FILE=--
CMDS=<<EOF
!echo q | python3 ../examples/1-rz_core.py =
echo
EOF
EXPECT=<<EOF
Loaded 1 file(s)
Corefile #1 has 1 binfile(s)
* malloc://512
rizin>
EOF
EXPECT_ERR=
RUN
NAME=2a-rz_bin_plugin.py
FILE=--
CMDS=<<EOF
!echo q | python3 ../examples/2a-rz_bin_plugin.py bins/elf/analysis/ls-linux64
echo
EOF
EXPECT=<<EOF
name: bins/elf/analysis/ls-linux64
size: 121584
rizin>
EOF
EXPECT_ERR=
RUN
NAME=2b-rz_bin_plugin.py
FILE=--
CMDS=<<EOF
!echo q | python3 ../examples/2b-rz_bin_plugin.py bins/pe/hello_world_arm/hello_world_arm64.exe
echo
EOF
EXPECT=<<EOF
name: bins/pe/hello_world_arm/hello_world_arm64.exe
size: 8704
rizin>
EOF
EXPECT_ERR=
RUN
+15
View File
@@ -0,0 +1,15 @@
NAME=1-rz_core.py =
FILE=--
CMDS=<<EOF
!echo q | python3 examples/1-rz_core.py =
echo
EOF
EXPECT=<<EOF
Loaded 1 file(s)
Corefile #1 has 1 binfile(s)
* malloc://512
rizin>
EOF
EXPECT_ERR=<<EOF
EOF
RUN