Hi,
Is there any way that I can get the address of a function which is declared static in another file?
File1.c
static int func1()
{
}
File2.c
{
void *addr;
addr = getAddressOf("func1");
}
void *getAddressOf(char *fn_name)
{
/* Magic here */
}
My intent is to replace the address of the func1 with the func2, so that whenever the func1 is called from file1, func2 will be invoked.
Once I get the address.
I also tried --wrap but it is not working for the static function.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 353 |
Nodes: | 16 (2 / 14) |
Uptime: | 75:01:53 |
Calls: | 7,639 |
Calls today: | 3 |
Files: | 12,802 |
Messages: | 5,691,789 |