Understanding how the EIP works in x86 32-bit processor | cpuinfo
Posts Understanding how the EIP works in x86 32-bit processor
Post
Cancel

Understanding how the EIP works in x86 32-bit processor

Extended Instruction Pointer (EIP)

EIP is a register inside the x86 32-bit processor that points to the next instruction to be executed. The EIP changes after execution of every instruction and it is 32-bit in size.

Pre-requisite installations

PEDA extention for gdb can be installed using the following steps:

1
2
git clone https://github.com/longld/peda.git ~/peda
echo "source ~/peda/peda.py" >> ~/.gdbinit

Exercises

Files for exercise

eipdemo.c

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <stdio.h>

int add(int a, int b)
{
    int sum = 0;
    sum = a+b;
    return sum;
}

int main(int argc, char const *argv[])
{
    int result = 0;

    result = add(10,20);

    printf("Addition: %d\n", result);
    
    return 0;
}
This post is licensed under CC BY 4.0 by the author.