-
Book Overview & Buying
-
Table Of Contents
Reverse Engineering Armv8-A Systems
By :
Return-oriented programming (ROP) is a commonly used technique to execute a specific function without directly calling it in C code. This method is often exploited in security attacks by corrupting the stack area with specific addresses to redirect execution flow.
Consider the following assembly snippet:
01 ldp x30, x29, [sp]
02 ret
When the ret instruction is executed, the PC is updated with the value stored in the x30 register. This is because the ret instruction copies the return address from x30 into the PC, branching execution to the specified address.
This section provides an example of how a function can be executed without explicitly calling it in the source code. The following shows the content of the example code:
#include <signal.h>
#include <stdio.h>
__attribute__((noreturn)) void call_empty() {
printf("call_empty() called!\n");
}
void sig_handler(int signum) {
...