Skip to content

Conversation

rbran
Copy link
Contributor

@rbran rbran commented Apr 24, 2025

No description provided.

@emesare emesare self-assigned this Apr 24, 2025
@emesare emesare added the Component: Rust API Issue needs changes to the Rust API label Apr 24, 2025
@rbran rbran force-pushed the impl_data_renderer branch from 2a70d41 to f09dd6a Compare April 25, 2025 12:59
@emesare emesare added this to the H milestone Apr 25, 2025
@emesare
Copy link
Member

emesare commented May 2, 2025

Would like to see some tests for this, some of it was started here but still incomplete

ddad753

@rbran
Copy link
Contributor Author

rbran commented May 5, 2025

Would like to see some tests for this, some of it was started here but still incomplete

ddad753

That's the data_notification, not the data_renderer.

@emesare
Copy link
Member

emesare commented May 5, 2025

Would like to see some tests for this, some of it was started here but still incomplete
ddad753

That's the data_notification, not the data_renderer.

🤦 Thanks, something felt off when I sent that comment, disregard!

@lukbukkit
Copy link

Just for future reference, this PR addresses #6485 if I'm not mistaken.

I would profit from this API for my current project as I assume it offers performance benefits compared to its Python counterpart (#3082). Is there anything I can contribute to complete this PR, e.g. implement the missing tests?

@rbran
Copy link
Contributor Author

rbran commented Sep 5, 2025

Just for future reference, this PR addresses #6485 if I'm not mistaken.

I would profit from this API for my current project as I assume it offers performance benefits compared to its Python counterpart (#3082). Is there anything I can contribute to complete this PR, e.g. implement the missing tests?

This PR is missing the tests, plus I didn't finish this PR because I felt that I didn't get exactly how the API is supposed to work.

@rbran
Copy link
Contributor Author

rbran commented Sep 5, 2025

I was trying to write the API first by imagining how the user would like to use the API, then writing it in the most "zero cost abstraction" way possible.

But I couldn't get exactly how the user would want to use it API, I just ended up writing wrappers around the the C functions.

Maybe because you need to use this, you are in a much better position for writing it.

@lukbukkit
Copy link

Thanks for getting started with the PR. I think your approach of "just" writing a wrapper for C functions is totally valid. I found the API pretty intuitively to use as it's similar to its Python / C++ counterparts which have some documentation.

In my initial experiments, BinaryNinja crashed when using the API's Rust implementation due to the CoreDataRenderer being freed directly after being registered as there are no more references pointing to it, see data_renderer.rs#140.

I've remodeled the internal implementation after the CoreTypePrinter and now it works pretty reliably. You can see my changes in lukbukkit@24702e8. When I have some spare time, I'll try to finish the PR. Should I open a new PR once my changes are ready? Creating a lot of tests might prove a bit difficult because my license doesn't support running headlessly, but I'll see what I can do about it.

@rbran
Copy link
Contributor Author

rbran commented Sep 6, 2025

Should I open a new PR once my changes are ready?

Yes, Just remember to mark this PR, so it can be closed.

Creating a lot of tests might prove a bit difficult because my license doesn't support running headlessly, but I'll see what I can do about it.

It don't need to include many tests, just to prove that the implementation works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Rust API Issue needs changes to the Rust API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants