代理共享库(sharedlib,shlib等)为ELF? [英] Proxy shared library (sharedlib, shlib, so) for ELF?

查看:210
本文介绍了代理共享库(sharedlib,shlib等)为ELF?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows上,创建代理DLL或多或少是常见的,这些DLL代替了原始的DLL并转发给它(在需要的任何其他操作之后)。您可以阅读此处 here 例如。



然而,Linux下的shlib munging文化是很不一样。它开始于LD_PRELOAD是Linux下的ld.so的内置功能,它只是将单独的shlib注入到进程中,并使用它定义为override的任何符号。而且,注入技术似乎定义了整个思维方向 - 一个典型的ELF黑客工具这个问题,绅士似乎与我一样的使用方法,但是首先询问他如何补丁现有的二进制文件。



不,谢谢。我不想注入或修改不是我的东西。所有我想做的是制作一个独立的代理shlib,它会调用原来的。理想情况下,会有一个工具可以与原始的.so一起提供,并创建一个C源代码,只需重定向到原来的函数,同时让我轻松地覆盖任何我想要的东西。那么这样的工具在哪里呢?

解决方案

apitrace 是一个工具,涵盖了许多平台的图形库(OpenGL,DirectX)调用的详细跟踪。对于通用解决方案来说,这可能太详细和复杂了,但至少提供了一些参考和关联。


On Windows, it's more or less common to create "proxy DLLs" which take place of the original DLL and forward calls to it (after any additional actions as needed). You can read about it here and here for example.

However, shlib munging culture under Linux is quite different. It starts with the fact that LD_PRELOAD is the builtin feature with ld.so under Linux, which simply injects separate shlib into process and uses any symbols it defines as override. And that "injection" technique seems to define whole direction of thought - here's a typical ELF hacking tool or this question, where gentleman seems to have the same usecase as me, but starts with asking how he can patch existing binaries.

No, thanks. I don't want to inject into or modify something which is nor mine. All I want to do is to make a standalone proxy shlib which will call out to the original. Ideally, there would be a tool which can be fed with the original .so and create a C source code which would just redirect to original's functions, while letting me easily override anything I want. So, where's such tool? ;-) Thanks.

解决方案

apitrace is a tool which covers detailed tracing of graphic libs (OpenGL, DirectX) calls for a number of platform. It's probably too detailed and complex for generic solution, but at least provides some reference and affinity.

这篇关于代理共享库(sharedlib,shlib等)为ELF?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆