Part 43 - Hacking Pointers!

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

We are at the end of the road. This is the final video in the x64 series. The final topic is that of pointers.

What are pointers? Let us start with an example.

Part 43 - Hacking Pointers! - 图1

A pointer is nothing more than a memory address. When we compile we will clearly see where lottery_number lives in mapped memory (this is a running example unlike our unmapped Radare examples).

Part 43 - Hacking Pointers! - 图2

Let’s add a true pointer to the example:

Part 43 - Hacking Pointers! - 图3

We see the same value:

Part 43 - Hacking Pointers! - 图4

Let us experiment more:

Part 43 - Hacking Pointers! - 图5

We see the pointer address point to a new address:

Part 43 - Hacking Pointers! - 图6

Remember pointers are memory addresses of other variables. Let’s look at it another way:

Part 43 - Hacking Pointers! - 图7

Let us compile:

Part 43 - Hacking Pointers! - 图8

We deference by doing the following:

Part 43 - Hacking Pointers! - 图9

Then we compile:

Part 43 - Hacking Pointers! - 图10

We can see the deference pointer is equal to 777.

Part 43 - Hacking Pointers! - 图11

We can see the example with an array:

Part 43 - Hacking Pointers! - 图12

Let’s debug:

Part 43 - Hacking Pointers! - 图13

Then we disassemble:

Part 43 - Hacking Pointers! - 图14

Let’s hack!

Part 43 - Hacking Pointers! - 图15

Let’s re-examine the binary:

Part 43 - Hacking Pointers! - 图16

We can see we hacked the value of 3 with 6.

Part 43 - Hacking Pointers! - 图17

We can see we have made the successful hack.

I hope over the years through the literal hundreds of x86, ARM and x64 tutorials you have a basic knowledge of how to do GOOD to protect critical infrastructures from malicious hands by understanding how the enemy works. Go and do GOOD work!