Hello :)
I am interposing the memcpy() function in C because the target application uses it to concatenate strings and I want to find out which strings are being created. The code is:
void * my_memcpy ( void * destination, const void * source, size_t num )
{
void *ret = memcpy(destination, source, num);
// printf ("[MEMCPY] = %s \n", ret);
return ret;
}
The function gets called succesfully but the first parameter can be whatever and I only want to trace it if the result is a string or array. I would have to ask if it is array or string. I know this can't be done straightforward: is there anyway to find out what RET points to?
I am working under MACOSX and interpositioning with DYLD.
Thank you very much.