Closed zh522130 closed 3 weeks ago
I am not familiar with the box64 source code. If I were to modify the box64 source code myself to add the LD_PRELOAD dynamic library's source code into box64, mainly to modify the function arguments or the buffer pointed to by the passed pointer, how much work would it involve? Which parts would I need to modify? I hope to get some guidance.
It seems that the functions intercepted by BOX64_LD_PRELOAD are only called once. On the x64 platform, I see that the function is intercepted multiple times, but with box64, it is intercepted only once.
Looks like an elf loader issue. I have to chec this. It should work, but there seems to be an issue somewhere...
Looks like an elf loader issue. I have to chec this. It should work, but there seems to be an issue somewhere...
From the observed phenomenon, I suspect that the issue is due to the dynamic library functions being intercepted only the first time they are loaded. When testing without restarting the program running under box64, every time the program reloads the dynamic library, the interception information is printed. However, if the dynamic library is not reloaded, and the function is called multiple times, the interception information will no longer be printed.
@ptitSeb Thank you. I think I should close this issue. I suspect that my earlier debugging caused some system problems. After I restarted the system, I could no longer reproduce the phenomenon. Now, LD_PRELOAD is working normally.
Ok, glad it works!
I want to use
BOX64_LD_PRELOAD
to modify the arguments passed to a function. I have verified that this works on the x64 platform without any issues. However, when I useBOX64_LD_PRELOAD=myintercept.so box64 myapp
to make the modification, the log shows that the modification was successful, but the final result indicates that the arguments were not actually modified.