2011-10-07 01:10:44 +00:00
|
|
|
Brainfuck support for r2
|
|
|
|
========================
|
|
|
|
|
|
|
|
Plugins for brainfuck:
|
2011-10-09 02:41:53 +00:00
|
|
|
- asm.bf - brainfuck assembler and disassembler
|
|
|
|
- debug.bf - debugger using bfvm
|
|
|
|
- anal.bf - code analysis for brainfuck
|
|
|
|
- bp.bf - breakpoints support (experimental)
|
2011-10-07 01:10:44 +00:00
|
|
|
|
2011-10-09 02:41:53 +00:00
|
|
|
To debug a brainfuck program:
|
2011-10-07 01:10:44 +00:00
|
|
|
|
2011-10-09 02:41:53 +00:00
|
|
|
$ r2 -D bf bfdbg:///tmp/bf
|
2011-10-07 01:10:44 +00:00
|
|
|
|
2011-10-09 03:24:15 +00:00
|
|
|
> dc # continue
|
|
|
|
> x@scr # show screen buffer contents
|
|
|
|
|
2011-10-07 01:10:44 +00:00
|
|
|
The debugger creates virtual sections for code, data, screen and input.
|
|
|
|
|
|
|
|
TODO
|
|
|
|
----
|
|
|
|
- add support for comments, ignore invalid instructions as nops
|
2011-10-09 02:41:53 +00:00
|
|
|
- enhace io and debugger plugins to generate sections and set arch opts
|
2011-10-07 01:10:44 +00:00
|
|
|
|
|
|
|
Hello World
|
|
|
|
===========
|
|
|
|
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]
|
|
|
|
>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++
|
|
|
|
.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
|
|
|
|
|
|
|
|
$ cat << EOF
|
|
|
|
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
|
|
|
|
EOF
|