Wednesday, 9 March 2011

Hyperlisk Brainfuck crackme #1

I succesfully recovered all of my files from a broken hard drive, and found a old 2008 crackme done by a friend (where are you now ?).
But it's not a usual crackme... a brainf*ck one.


In case you didn't know, Brainfuck is one of those turing complete languages that has no apparent use in the real world.
But hey, being very very simple with a limited grammar, writing an interpreter should be easy.
I've already see a BF interpreter written entirely in standard LOLCode

crackme.bf ~
>++++++++[->++++++++<]>++.++++.<++++++[->------<]>--.<+++++++[->+++++<]>.<++++++
+[->++++++<]>+++++.<++++[->----<]>-.++.++++++++.<++++++[->-----<]>.<++++++[->+
+++<]>.<++++++++[->--------<]>-----.+++.++++++++++++++.<++++++[->------<]>---.<+
+++++++[->+++++++<]>+.<+++++++[->++++++<]>+++++.-------------.----.<++++[->+++
+<]>+++.<+++++[->---<]>.-.<++++++++[->--------<]>----.<++++++[->+++++<]>++++.<++
+++++[->+++++++<]>++++++.<+++++++++[->-------<]>.<+++++[->-----<]>-.<++++++[->++
++++<]>++++.<+++++++[->+++++++<]>.---------.-----------.+++++++++++++.------.---
.++++++++++.--------.<++++++++++[->---------<]>-------..<+++++++++[->++++++++<]>
+++++.<++++[->++++<]>+.-------.<++++[->++++<]>+++.<+++++++++[->---------<]>---.<
+++++++++[->++++++++<]>+.++++++++++.<+++++++++[->---------<]>--.<+++++++++[->+++
++++++<]>+++.------------.---.<++++++++[->--------<]>-----.<++++++++++[->+++++++
+<]>.<+++++[->---<]>.<++++[->++++<]>++..++++.--------.+++.--------------.<++++++
[->------<]>-.<+++++++[->-------<]>----.[<]>[-]>[-]>>>>>>>>>>>+<<<<<<<<<<<++++++
+++[-<++++++++>]>[-]+++++++++++[-<+++++++++++>]>[-]+++++++++++[-<++++++++++>
]<++>>[-]++++++++++[-<++++++++++>]<+>>[-]+++++++++++[-<++++++++++>]<++++>>[-],--
--------[++++++++++>,----------]<<[<]>[[-<<<<<<->>>>>>]<<<<<<[+[>]>-<]>+[-<]<[<]
>>>>>>>>]>-[[-]>[-]<+++++++++[->+++++++++<]>++.<+++++[->+++++<]>+++.+++..+++++++
.<+++++++++[->--------<]>-----.------------.<+++++++++[->+++++++++<]>++++++++.--
--------.++++++.<+++++++++[->---------<]>----.<++++++++[->++++++++<]>++++.+++++.
-----.++++++++++.<++++++++[->--------<]>-------.<+++++++++[->++++++++<]>+++++.<+
++++++++[->---------<]>---.<++++++++[->++++++++<]>+++++++.--.<+++++[->+++<]>.<++
+++++++[->---------<]>---.<+++++++++[->++++++++<]>+.+++++++++++.<++++++++[->----
----<]>------...--------------.<+++++++[->++++++<]>+.<+++++[->+++++<]>+..+++++++
++++.<++++++++++[->--------<]>.<+++++++++[->+++++++++<]>+++.--.+++++++.<++++[->-
---<]>.+++++.-------.<++++++++[->--------<]>------.<[-]>[-]+<]>-[[-]>[-]<+++++++
+[->++++++++<]>+++.<+++++++[->++++++<]>++.-.-------.+++++++++++.<++++[->----<]>-
.<++++[->++++<]>+++.++++++.<+++++++++[->---------<]>--------.-.<++++++++[->+++++
++<]>+.<+++++[->++++<]>++.++++++.<+++++++++[->---------<]>----.<++++++++[->+++++
+++<]>+++++++.++++++++.+++++.<+++++++++[->---------<]>---.<+++++++++[->++++++++<
]>+.+++++++++++.<+++++++++[->---------<]>--.<][-]>[-]++++++++++..<++++++++[->+++
+++++<]>++++++.<++++++[->+++++<]>++++.-------------.++++++++++++++..<+++++++++[-
>---------<]>--.<++++++++[->++++++++<]>+.+++++++++++++.+++++++++++.<+++++++++[->
---------<]>--------.<+++++++++[->++++++++<]>+++.------.<+++++[->++++<]>.<++++++
+++[->---------<]>--------.<+++++++++[->+++++++++<]>+++.-----.<+++++++++[->-----
---<]>-------.<++++++++[->++++++++<]>+++.++++++++++++.-.++++++.-----------.+++++
.+++++++.<++++[->----<]>.<+++++++[->-------<]>------...<,

You can convert BF code to C like code without much effort, 'Hyper' is serial.
Use (or code) your own BF debugger with a memory view can also be a solution instead of learning the  language.

Learn more about BF ~
>
Move the pointer to the right
<
Move the pointer to the left
+
Increment the memory cell under the pointer
-
Decrement the memory cell under the pointer
.
Output the character signified by the cell at the pointer
,
Input a character and store it in the cell at the pointer
[
Jump past the matching ] if the cell under the pointer is 0
]
Jump back to the matching [ if the cell under the pointer is nonzer

Brainfuck Developer (IDE): http://4mhz.de/bfdev.html
Sakura Card Captor image (I know the author of this crackme will like it) :

No comments:

Post a Comment