Articles 16
Tags 19

/me on reverse engineering

Work in Progress - my first steps!

Notes on fundamentals for reverse engineers

I remember the day when a friend told me that “this is fun!”- thingy we spend time doing on our weekends had a name: Reverse Engineering. I got curious about information security just after that! I really enjoy understanding deeper low-level internals of $thing. And when I decided to take a more “researcher-like” approach on it, I felt like diving into the a software developer’s perspective of computer architecture. I am planning to cover the same topic from another perspective, which is for me more comfortable and logical - I am coming from the hardware level back to software. There are plenty of extremely well written RE101 tutorials using a pletora of different tools. However not so many explaining how to get the code to analyze in first place or giving a general idea on reverse any kind of binary.

Tinkering the memory


50 shades of the memory


Reverse Engineering

I have been writing lots of notes on PROLOG and logical programming and people keep asking me, why I never write about reverse engineering. So I decide to give it a try.

I will start with stuff that I think are important for reverse engineering. It will be a bit different of the approaches I see on online tutorials, so I won’t be mad or sad if this notes are not helpful for you. BUT I will be REALLY happy if someone finds it useful!

Prolog vs Haskell


Choose the language for your problem, not the problem for your language.


Prolog vs Haskell

I have been writing lots of notes on PROLOG and some people asked me: why PROLOG? You can solve this problems in any language! And they are right! :) I also believe that it doesn’t matter which problem you have, you can solve it in any given language.

But there is more. I also believe that it is possible to find the best language for the problem you have. No one should be too attached to any language, as every single one has ups and downs!

So I decided to add here two simple examples of PROLOG code in comparison to Haskell code - both extremely elegant IMO - and I will leave it up to you to check how it would look like in your favorite imperative language :)

PROLOG - Part 8


There is logic behind everything and every rule. We sometimes negate this but every thing and every happening has a logic and reason behind it.


PROLOG Internals

In my last post I wrote about cut, fail and repeat. This time I am going to expand the understanding on internals and data structures.

Terms can be constants, variables or a structure.

  • A constant may be an atom or a number - which can be an integer or real number. We defined atom some posts ago. :)
  • A variable is a string of letters, digits and / or underscores starting with a upper-case letter or an underscore.
  • A structure represents an atomic preposition of predicates. Structures have the form blub(t1,t2,t3,...,tn) where blub is our atom and t1,t2,…,tn are our parameters. n is also the arity of our term.

Keep in mind: there is no type declaration in PROLOG. The interpreter will figure it out for you. :)

PROLOG - Part 7


Because proofs are boring. That is a given!


Controlling PROLOG

In my last post I introduced the concept of backtracking and as promised, this time I will be writing about cut, fail and repeat.

Cut

There are two main reasons to understand and use the cut feature: