beehive-lab / mambo

A low-overhead dynamic binary instrumentation and modification tool for ARM (both AArch32 and AArch64 support) and RISC-V (RV64GC).
Apache License 2.0
318 stars 69 forks source link

Add documentation to the struct fields and functions of the API of ma… #115

Closed mskordal closed 6 months ago

mskordal commented 6 months ago

…mbo used in the tutorial or exercise 1.

Doxygen-style documentation isa added. Namely, the following fields of struct code_ctx are documented: void read_address int inst void write_p

And the following functions: mambo_context mambo_register_plugin(void) int mambo_register_pre_basic_block_cb(mambo_context ctx, mambo_callback cb) int mambo_register_post_basic_block_cb(mambo_context ctx, mambo_callback cb) int mambo_register_pre_thread_cb(mambo_context ctx, mambo_callback cb) int mambo_register_post_thread_cb(mambo_context ctx, mambo_callback cb) void mambo_get_source_addr(mambo_context ctx) int mambo_get_thread_id(mambo_context ctx)

In mambo_get_thread_id the precondition that ctx->thread_data should not be null is added, to avoid calling the function during the constructor and cause segfault.