ARM Reverse Engineering (Part 46 – Hacking Pre-Decrement Operator)

ARM Reverse Engineering (Part 46 – Hacking Pre-Decrement Operator)

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 re-examine our code.

#include <iostream>

int main(void) {
    int myNumber = 16;
    int myNewNumber = --myNumber;

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

    return 0;
}

We remember when we compile we get 15.

Let's debug.

No alt text provided for this image

Let's break.

No alt text provided for this image

Let's review what is inside r3 and hack it.

No alt text provided for this image

Now as we continue we see it did not successfully hack why is that?

No alt text provided for this image

We re-run the binary and break and see the value here at r1 hold 15.

No alt text provided for this image

When we continue we see 15 which we don't want.

No alt text provided for this image

Now we break again and print the value.

No alt text provided for this image

This time we set r1 and we can see we have successfully hacked!

No alt text provided for this image

This is your first experience with really breaking down the registers and seeing where things are stored and how it can affect outcome. Take time and run this yourself so you really have a firm handle on this.

Next week we will dive into the Post-Decrement Operator.

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

Kevin Thomas的更多文章

社区洞察

其他会员也浏览了