Posts

Showing posts from August, 2018

Reverse Engineering Puzzles #1 - stack frame and local variables

Image
Hello everyone While doing some experiments with C language I thought that it will be fine to share the interesting results with you. And this is what this new series is all about - when I find something curious I am going to write about it on my blog. Today's topic is the deeper look at the stack frame .

Brainfuck Interpreter in C - fifth day

Image
Hello everyone On the last article about writing a brainfuck interpreter, we saw that it did not works well. So today I will show how I debug this program. I solve the problem by the print it method.

Brainfuck Interpreter in C - fourth day

Image
Hello guys As you remember (or not) our interpreter has these functionalities for now: - a file has to be read as an argument - react if the file is not specified - react if the file extension is not right - react if the file is not found - read brainfuck instructions from a file - check if the char from the file is brainfuck instruction - if it is brainfuck instruction then add it to the linked list - prints all of the instructions - clear the memory (more precisely the cheap memory) from the elements of the linked list When we will have these functionalities our program should interpret any brainfuck code: - interpret brainfuck instructions right - interpret nested loops correctly - if the brainfuck instruction is '[' then push it on the stack - if memory cell value is 0 then pop '[' from the stack

Brainfuck Interpreter in C - the third day

Image
Hello again First of all, we need to remind what are we should going to do in our interpreter. In the first topic of writing this program, I wrote some important functionalities. Now it's the time to show you what we did and what we have to do in the future.