BinaryAnalysisPlatform / bap-bindings

C Bindings to BAP
MIT License
15 stars 9 forks source link

better build system and new interface to disassembler #2

Closed ivg closed 7 years ago

ivg commented 7 years ago

Use autotools for configuration

Since the build system is very specific to OCaml I decided not to use automake, just autoconf, mostly for setting up installation prefix. I also moved all configuration time scripting in the configure, that allows to install and compile under different users. Not only the new build system allows us to install bap into a user specified location, but it also forms a basement for extending bindings to other bap libraries. For the latter, I've moved bap bindings into a subfolder, so that other bindings can co-exist and reuse existing infrastructure.

New low-level disassembler interface

So far only the recursive descent disassembler was exposed to the C land. This PR provides an ad-hoc low-level disassembler, that allows users to disassemble instruction by instruction and, at the same time, having an access to the semantics. I've tried to make an interface easier to use from C, by limiting the amount of intermediate opaque structures and short-circuiting some operation, e.g., bap_code_length instead of bap_code_mem -> bap_mem_length. Also the code data structure is now printable.

Remove dependency on 4.03

I got rid of the Format.kasprintf, so that the bindings can be compiled on all versions supported by BAP.