Open offlinemark opened 8 years ago
This mostly boils down to extending the hook capabilities, and then writing some statistics hooks right?
yeah pretty much
I added the -i
option, but it could clearly do more. What kinds of things are you thinking for this?
I guess this doesn't really make sense since bf is so minimal.
My initial thoughts were for this use case: you have a brainfuck program and you want to get certain statistics on its execution. You implement some hook functions, compile it into a shared object and then give that to the interpreter. Then at runtime, the interpreter loads the .so and calls those hooks at certain stages we support.
I like the idea of playing with some dynamic loading of symbols. Good exercise.
i think it could be cool to explore this idea of an instrumentation framework for bf. like being able to register callbacks not just after each step, but like before and after interpretation, before and after the instruction itself, on certain types of instructions, maybe even on ub. you could then use that to write analysis tools, for example
i'm basically thinking of doing something in the spirit of pin (https://software.intel.com/en-us/articles/pin-a-dynamic-binary-instrumentation-tool)