radare2/doc/brainfuck.md

38 lines
943 B
Markdown
Raw Normal View History

2024-02-29 10:50:53 +00:00
# Brainfuck support for r2
Plugins for brainfuck:
2024-02-29 10:50:53 +00:00
* `debug.bf` - debugger using bfvm
* `arch.bf` - code analysis for brainfuck
* `bp.bf` - breakpoints support (experimental)
To debug a brainfuck program:
2024-02-29 10:50:53 +00:00
```sh
r2 -D bf bfdbg:///tmp/bf
2024-02-29 10:50:53 +00:00
> dc # continue
> x@scr # show screen buffer contents
```
The debugger creates virtual sections for code, data, screen and input.
2024-02-29 10:50:53 +00:00
## TODO
2024-02-29 10:50:53 +00:00
* add support for comments, ignore invalid instructions as nops
* enhance io and debugger plugins to generate sections and set arch opts
2018-02-27 09:54:54 +00:00
2024-02-29 10:50:53 +00:00
## Hello World
```brainfuck
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]
>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++
.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
2018-02-27 09:54:54 +00:00
```
2024-02-29 10:50:53 +00:00
```sh
$ cat << EOF
>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-]>++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++.------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++.
EOF
2018-02-27 09:54:54 +00:00
```