capstone-rust / capstone-rs

high-level Capstone system bindings for Rust
213 stars 75 forks source link

implement bindings for tablegen #139

Closed gogo2464 closed 1 year ago

gogo2464 commented 1 year ago

I am writting a cryptanalysis library. I need to get statistics on opcodes repartition on the code. So I need to generate any valid assembled <-> disassembled instructions on a BiBTreeMap.

Could you implement bindings for tablegen please?

If really you disagree, could you assign me to this issue please?

tmfink commented 1 year ago

@gogo2464 I'm not super familiar with it, but I think that TableGen would be useful outside of the context of capstone/disassembly.

As such, I think it would make sense to for low-level "tablegen-sys" bindings and high-level "tablegen" crate to live outside of this repo. I see that there is a seemingly abandoned tablegen-rs crate. You may be able to take over that project if you contact the owner. In fact, that's how I became an owner of this project. :smile:

Also, https://gitlab.com/taricorp/llvm-sys.rs might be useful.

If and when there are useful changes to be made to capstone-rs that take advantage of tablegen, I would be happy to look at the PRs. For now, I'm going to close this issue.

gogo2464 commented 1 year ago

I was going to expose the capstone api here: https://github.com/capstone-engine/capstone/issues/1945.

If I finish this PR could you accept mine in your repository please?

tmfink commented 1 year ago

If there's new API in the capstone C library, I'm of course open to adding it to the Rust bindings. I can't make any promises, but I'll definitely review your PR and work towards merging if it's in a good state.

Also, please mention me in your PR to the C library so I can provide feedback there, too.

gogo2464 commented 1 year ago

Great! see you when I will do the other PR!

Thank you for the feedback purposal.

gogo2464 commented 1 year ago

@tmfink there is already a work on for the tablegen API: https://github.com/capstone-engine/capstone/issues/1945#issuecomment-1370483447