Part 29 - x64 Assembly [Part 3]

For a complete table of contents of all the lessons please click below as it will give you a brief of each lesson in addition to the topics it will cover. https://github.com/mytechnotalent/Reverse-Engineering-Tutorial

Today we continue our tutorial with a simple subtract example. Let’s examine the source code:

Part 29 - x64 Assembly [Part 3] - 图1

Let’s compile and run the debugger:

Part 29 - x64 Assembly [Part 3] - 图2

Let’s run and disassemble:

Part 29 - x64 Assembly [Part 3] - 图3

As we can see very we load 16 or 0x10 hex into EAX and then subtract 5 from it in the next instruction.

Part 29 - x64 Assembly [Part 3] - 图4

We step twice and then look at the resulting value in RAX.

Part 29 - x64 Assembly [Part 3] - 图5

As we can see the result is 0xb hex or 11 decimal as expected. It is important that you try these simple examples to get a grasp of what happens when we start to debug C++ code in future tutorials.