I have a C source file that I'm not allowed to change and it is defined as follows:
int main(int argc, char *argv[])
{
//doing something
return 0
}
void __magic()
{
__asm__("jmp %esp");
}
I do not use the fucntion __magic in my code, it is just declared after the main. I wish to find the address of the function __magic. How can I do that without having to declare the funtion before the main? I use gdb for debugging purposes.
P.S I'd also like to know whether this function is even saved in my process memory since there is no declaration/use of it. might the compiler just not add that function?