Can you crack it? Stage 3 solution
Once getting through stage 2 you will have an EXE file. It requires windows (I ran it in a VirtualBox VM seeing as I had no idea what it would do - can't be too careful!), cygwin and the crypt library when installing cygwin.
Running the EXE you will see that you require some kind of license.txt - if you create an empty one then you get an error about it being invalid. The next stage is working out what is required to make the license.txt file valid. Being new to this realm of reverse engineering, but being comfortable with work with ASM I tried a number of tools - strace, objdump and strings. Each yielded useful bits of information - especially strings.
However the real breakthrough came when I ran the exe file through a tool called IDA Pro - the freeware version is sufficient for this exercise.
Running the binary through IDA Pro produces a very comprehensive flow of the program. If you navigate this flow you will being to see calls to printf which relate to the message we get on the screen.
Can you crack it? Stage 2 Solution
There has been a lot of news about the "Can you crack it?" challenge that is currently to publicise GCHQ recruiting. Here is my solution for stage 2 - the implementation of the Virtual Machine, or emulator. It's actually pretty straight forward when you get a hold of a few of the nuances. I'll put a list of hints here, and then present the full solution after the fold.
- As of stage 1 - everything is centred around the x86 architecture, this means that your instructions need to mirror the behaviour of their x86 equivalents
- Firmware seems to be irrelevant - don't worry about it.
- There is no real trickery here - it's just a straight forward instruction set simulator implementation
- The programme will finish on a HALT instruction
This is actually quite a neat little program that works by decrypting itself further programme code which it then runs and decrypts the message to get to the next stage... enjoy...
XMOS Community