The (Extended) Instruction Pointer (EIP)
- published
- reading time
- 1 minute
What is EIP ?
The instruction pointer is simply the most important register to deal with in Reverse Engineering. Simply because if we were to alter this pointer to jump to another area in the code we would have complete control over said program flow.
Consider the following code:
void unrecheableFunction(void){
printf("Nobody ever calls me! Except Hackers!");
exit(1337);
}
int main(void){
printf("Hello from Main! My name is Cambie.");
return 0;
}
If we compile this program and run it we see the following output:
But if we are able to change the value of EIP and make it point to the memory address where the hidden function is defined, we can call it!