I want to change malloc, memcpy and free function and use this libhooker with LD_PRELOAD.
I change them, and test them for some test cases. but in one of them, my code doesn't work correct and don't know why.
Test Case:
int main()
{
string s = "Hello";
return 0;
}
my code output:
malloc[0x8229170-0x8229182]
[memcpy] source address 0x8048850 is not allocated.
free(0x8229170)
I don't know how c allocate memory for constant string and why my code is wrong.
Thanks in advance.