2011-10-07 01:10:44 +00:00
|
|
|
Brainfuck support for r2
|
|
|
|
========================
|
|
|
|
|
|
|
|
Plugins for brainfuck:
|
2018-02-27 09:54:54 +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
|
|
|
|
2018-02-27 09:54:54 +00:00
|
|
|
r2 -D bf bfdbg:///tmp/bf
|
2011-10-07 01:10:44 +00:00
|
|
|
|
2018-02-27 09:54:54 +00:00
|
|
|
> dc # continue
|
|
|
|
> x@scr # show screen buffer contents
|
2011-10-09 03:24:15 +00:00
|
|
|
|
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
|
2017-09-30 09:58:41 +00:00
|
|
|
- enhance io and debugger plugins to generate sections and set arch opts
|
2011-10-07 01:10:44 +00:00
|
|
|
|
|
|
|
Hello World
|
|
|
|
===========
|
2018-02-27 09:54:54 +00:00
|
|
|
|
|
|
|
```
|
2011-10-07 01:10:44 +00:00
|
|
|
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]
|
|
|
|
>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++
|
|
|
|
.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
|
2018-02-27 09:54:54 +00:00
|
|
|
```
|
2011-10-07 01:10:44 +00:00
|
|
|
|
2018-02-27 09:54:54 +00:00
|
|
|
```
|
2011-10-07 01:10:44 +00:00
|
|
|
$ cat << EOF
|
|
|
|
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
|
|
|
|
EOF
|
2018-02-27 09:54:54 +00:00
|
|
|
```
|