1
0
Fork
You've already forked plugin-template
0

decomp library not found #1

Closed
opened 2025年09月12日 11:41:10 +02:00 by themadbit · 7 comments

Building the plugin searches the decomp library. However, reoxide provides the following in the bin directory:

-r-xr-xr-x 1 root root 265K 1970年01月01日 03:00 decompile
-r-xr-xr-x 1 root root 261K 1970年01月01日 03:00 libcore.so
-r-xr-xr-x 1 root root 5.9M 1970年01月01日 03:00 libreoxide.so

Am I getting it wrong?

Building the plugin searches the `decomp` library. However, `reoxide` provides the following in the bin directory: ```shell -r-xr-xr-x 1 root root 265K 1970年01月01日 03:00 decompile -r-xr-xr-x 1 root root 261K 1970年01月01日 03:00 libcore.so -r-xr-xr-x 1 root root 5.9M 1970年01月01日 03:00 libreoxide.so ``` Am I getting it wrong?

Are you using the dev branch when building against main of reoxide? Since this is template repository, I wanted to make sure that the main branch here tracks the stable releases of reoxide. I'm up for suggestions how to make this nicer, I guess we could have a dev branch in the main reoxide repo as well 😅

Are you using the `dev` branch when building against `main` of reoxide? Since this is template repository, I wanted to make sure that the `main` branch here tracks the stable releases of reoxide. I'm up for suggestions how to make this nicer, I guess we could have a dev branch in the main reoxide repo as well 😅

I am using main against main. main branch of reoxide, builds decompile and the main of plugin checks decomp. Not sure the main here is tracking the main at reoxide :) . I am using the latest main for both

I am using `main` against `main`. main branch of reoxide, builds `decompile` and the main of plugin checks `decomp`. Not sure the main here is tracking the main at reoxide :) . I am using the latest main for both

Ah yes that is what i meant. If you use dev from here and build against main of reoxide it should build (there is a warning regarding this in the readme)

Ah yes that is what i meant. If you use `dev` from here and build against `main` of reoxide it should build (there is a warning regarding this in the readme)

huh! my bad.
so the main here is time travelling 😄

huh! my bad. so the main here is time travelling 😄

I got it building. I'm just curious why building it requires reoxide to be present. Because it can only be applicable for use with reoxide?
Can we also have pre-built plugin libraries as part of the reselease?

I got it building. I'm just curious why building it requires reoxide to be present. Because it can only be applicable for use with reoxide? Can we also have pre-built plugin libraries as part of the reselease?

Building it requires reoxide to be present, because the plugins need access to the internal Ghidra functionality, and it gets this by linking to libreoxide.so (which contains all of the necessary Ghidra functions as well as the reoxide communication wrappers). Because Ghidra is written in C++ we need to make sure the plugin ABI matches the ABI of the compiled libreoxide.so. As far as I am aware, there are no specific guarantees we have besides "as long as you compile it with the same compiler and the same language standard, it should work".

For other Linux distributions, there is the dockerfile which compiles the plugin in manylinux2014, the same way we distribute reoxide to PyPI, therefore guaranteeing that we compile it with the same compiler as the public stable release of reoxide. When distributing on Nix, you can distribute it separately, as long as you use the same compiler for building reoxide and the plugins. It would therefore also be nice if we could provide Nix users a template on how they can compile plugins so that it matches the reoxide nix package.

Besides that, there is an experimental Rust API that is a subset of the C++ API. For Rust we added a C wrapper around the most commonly used methods, which gives us better ABI stability and also allows us to use different compilers. The plan is to evolve this wrapper into a nice, safe wrapper with good user experience, but as of now the C++ interface (this repository) is the main way to write plugins and it will be for the foreseeable future.

Building it requires reoxide to be present, because the plugins need access to the internal Ghidra functionality, and it gets this by linking to `libreoxide.so` (which contains all of the necessary Ghidra functions as well as the reoxide communication wrappers). Because Ghidra is written in C++ we need to make sure the plugin ABI matches the ABI of the compiled `libreoxide.so`. As far as I am aware, there are no specific guarantees we have besides "as long as you compile it with the same compiler and the same language standard, it should work". For other Linux distributions, there is the dockerfile which compiles the plugin in `manylinux2014`, the same way we distribute reoxide to PyPI, therefore guaranteeing that we compile it with the same compiler as the public stable release of reoxide. When distributing on Nix, you can distribute it separately, as long as you use the same compiler for building reoxide and the plugins. It would therefore also be nice if we could provide Nix users a template on how they can compile plugins so that it matches the reoxide nix package. Besides that, there is an experimental Rust API that is a subset of the C++ API. For Rust we added a C wrapper around the most commonly used methods, which gives us better ABI stability and also allows us to use different compilers. The plan is to evolve this wrapper into a nice, safe wrapper with good user experience, but as of now the C++ interface (this repository) is the main way to write plugins and it will be for the foreseeable future.

Also, the reoxide pip package contains the needed API header files. The reoxide command as used in meson.build is mainly used as convenience for finding the paths to the header files, the paths to the libreoxide.so and the installation directory for the plugin.

The real "necessary" part for building boils down to this part of the meson file:

Lines 23 to 28 in ef4856f
reoxide=declare_dependency(
dependencies:[
cc.find_library('reoxide',dirs:reoxide_bin_dir),
],
include_directories:reoxide_dir/'include'
)
Also, the `reoxide` pip package contains the needed API header files. The `reoxide` command as used in `meson.build` is mainly used as convenience for finding the paths to the header files, the paths to the `libreoxide.so` and the installation directory for the plugin. The real "necessary" part for building boils down to this part of the meson file: https://codeberg.org/ReOxide/plugin-template/src/commit/ef4856f1a4a146b6b07e5969ad60289f9ce47abd/meson.build#L23-L28
Sign in to join this conversation.
No Branch/Tag specified
main
dev
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ReOxide/plugin-template#1
Reference in a new issue
ReOxide/plugin-template
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?