So I used wrap to override the malloc call in my program, I didn't think that if I exec'd another it would work, and it didn't. I figure this is because it wasn't linked with my program. How could I overwrite a C call in another program?Sample:void* __wrap_malloc(size_t size) {    void* mal = __real_malloc(size);    printf(malloced %i @ %i\n, size, mal);    return mal;}int main(int argc, char *argv[]) {    malloc(1024);    execl(/bin/bash, /bin/bash, (char *) NULL);    return 0;}
Overwriting a C system after exec?
c;linux
Define an environment variable LD_PRELOAD to point to a shared library overriding required functions.See http://hackerboss.com/overriding-system-functions-for-fun-and-profit/