Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FFI examples directory is missing #33

Open
gsuberland opened this issue Feb 18, 2024 · 2 comments
Open

FFI examples directory is missing #33

gsuberland opened this issue Feb 18, 2024 · 2 comments

Comments

@gsuberland
Copy link

The readme says "see the examples directory for FFI usage of this library", but there isn't an examples directory in this repo.

(also hi)

@iximeow
Copy link
Owner

iximeow commented Mar 6, 2024

.... huh. where did that go. i'll... fix that.

(hi)

@iximeow
Copy link
Owner

iximeow commented Jun 24, 2024

well, part of the problem here is that the FFI bindings for yaxpeax-x86 are kinda useless and awful, which i think i realized when i tried writing an example before, but never got to fixing up.

yaxpeax_x86_64_fmt needs to return the number of characters it wrote to the string, especially because it never makes sure that the string is actually null terminated. it needs to make sure the string is null terminated.

yaxpeax_x86_64_decode takes a *mut long_mode::Instruction but there's no way to initialize one in a way that is stable across library versions.

half of this file is #[cfg(feature = "fmt")], but i'm not really sure feature flags on this .so make sense for some C program that may not know what features were enabled - there probably should be stub implementations if !fmt even if there are ifdefs around the declarations in a header

speaking of which, there are no header files. i think i'd assumed years ago that you can Just Bindgen It but that's not... ideal either.

i'm about 90% sure i'd called these functions by hand from a python repl just to see that yes it does work, but this is really not good enough to point anyone at 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants