拦截STAT()

编程入门 行业动态 更新时间:2024-10-13 18:20:52
本文介绍了拦截STAT()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我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()

本文发布于:2023-10-08 14:50:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1472944.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:STAT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!