I am looking to edit a binary file to replace one function by another function in Linux.
For eg.
#include<stdio.h>
int test(int a,int b)
{
return a+b;
}
main()
{
int c=test(3,2);
printf("%d\n",c);
}
I want to change the function test() to something else, say multiply editing just the binary file.
Can someone please guide me on how to edit the binary file to replace a function in linux (Debian) ?
Take a look at here to get a idea of reverse engineering a elf binary.