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

ISPASS 2023 - MAMBO for RISC-V #95

Closed ShvetankPrakash closed 7 months ago

ShvetankPrakash commented 1 year ago

Recently saw there was paper published using MAMBO for RISC-V DBM! Are there any instructions for how to set this up to profile a RISC-V executable? I am having trouble getting this setup. Any instructions would be much appreciated! Thanks :)

ShvetankPrakash commented 1 year ago

I see the riscv branch but the build instructions are not updated for this port it seems?

jkressel commented 1 year ago

Hi, Firstly, thanks for pointing that out, we will update the README.

In order to build MAMBO on RISC-V, the following instructions should work: https://github.com/beehive-lab/mambo/tree/riscv#build

This will build a base system through which you can run an executable eg. if you wanted to run top, you would do run it like so ./dbm /bin/top

Current plugins can be found in the plugins/ directory. Some currently contain ARM specific code so will need porting to RISC-V. To build a plugin, go to the top of makefile and uncomment the plugins you would like to build. Then rerun make. It will now build mambo with the plugin(s) enabled. Then run as before. As an example, uncomment https://github.com/beehive-lab/mambo/blob/riscv/makefile#L7 to enable the instruction mix plugin.