我successfuly截获通话read(),write(),open(),unlink(),rename(), 科瑞(),但不知何故有同样的语义拦截 STAT()未发生。我一直在使用LD_ preLOAD改变执行environmnet。
我缺少的东西吗?
在code是相当庞大,其中的一部分将是最有帮助的张贴,所以你能帮忙吗?
感谢。
编辑:我不停的插STAT()包装简单,检查是否正常工作
内部统计(为const char *路径,结构统计* BUFF){ 的printf(客户端调用:统计%的,路径); 返回1;}解决方案
编译调用一个函数 STAT();看什么引用(S)生成(纳米-g stat.o )。然后,您可以使用的功能(S)的一个更好的主意干预。提示:它可能不叫 STAT()
I have successfuly intercepted calls to read(),write(),open(),unlink(),rename(), creat() but somehow with exactly the same semantics intercepting stat() is not taking place. I have changed the execution environmnet using LD_PRELOAD.
Am I missing something?
The code is quite huge, which part of it will be most helpful to post so you can help?
Thanks.
Edit: I kept the interposed stat() wrapper simple to check if it works.
int stat(const char *path,struct stat *buff) { printf("client invoke: stat %s",path); return 1; }解决方案
Compile a function that calls stat(); see what reference(s) are generated (nm -g stat.o). Then you'll have a better idea of which function(s) to interpose. Hint: it probably isn't called stat().
更多推荐
拦截STAT()
发布评论