ARM Reverse Engineering (Part 34 – Hacking Double Variables)

ARM Reverse Engineering (Part 34 – Hacking Double Variables)

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

Let’s review our code.

int main(void) {

            double myNumber = 1337.77;

 

            std::cout << myNumber << std::endl;

 

            return 0;

}
No alt text provided for this image

Let’s debug!

No alt text provided for this image

Let’s set a breakpoint at main+24 and continue.

No alt text provided for this image

We see the strd r2, [r11, #-12] and we have to fully understand that this means we are storing the value at the offset of -12 from register r11 into r2. Let’s now examine what exactly resides there.  

No alt text provided for this image

Voila! We see 1337.77 at that offset location or specifically stored into 0x7efff230 in memory.

No alt text provided for this image

Let’s step into twice which executes the vldr d0, [r11, #-12] as we understand that 1337.77 will now be loaded into the double precision math coprocessor d0 register. Let’s now print the value at that location below.

No alt text provided for this image

Let’s hack the d0 register!

No alt text provided for this image

Now let’s reexamine the value inside d0.

No alt text provided for this image

Let’s continue.

No alt text provided for this image

Successfully hacked!

Next week we will dive into the SizeOf Operator.

要查看或添加评论,请登录

Kevin Thomas的更多文章

社区洞察

其他会员也浏览了