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
320 stars 69 forks source link

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

Closed mskordal closed 7 months ago

mskordal commented 8 months ago

…mbo used in the tutorial or exercise 1.

Continuation of #115

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.

Add documentation to the struct fields and functions of the API of mambo used in the tutorial or exercise 1.

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.