[英]Redirect the open syscall of resource on Windows
Let me first explain my situation: 首先让我解释一下我的情况:
I have an old application and don't have any possibility of changing it. 我有一个旧的应用程序,没有任何可能更改它。 This application works with sqlite tables, one of them being a "temporary" database, but does not create temporary tables in memory but rather uses normal tables.
此应用程序使用sqlite表,其中一个是“临时”数据库,但不会在内存中创建临时表,而是使用普通表。
I install this application in a terminal server and the problem is that the application tries to read from a static path from the temporary table. 我在终端服务器上安装了此应用程序,问题是该应用程序尝试从临时表的静态路径中读取。
I need to redirect the "open syscall" to another file, so I want to know if I could do that with some software or by programming it. 我需要将“ open syscall”重定向到另一个文件,所以我想知道是否可以使用某些软件或对其进行编程。
Several options in order of "preferableness": “优先级”顺序的几个选项:
Create a junction . 创建一个结点 。 Click the link to get a tool for doing this.
单击链接以获取执行此操作的工具。
If the above are not possible then you could use Madshi's madCodeHook lib to intercept the(*) call. 如果上述方法不可行,则可以使用Madshi的madCodeHook lib库拦截(*)调用。 Somebody over here is having a similar question, the discussion there also applies to your situation.
这里有人有类似的问题,那里的讨论也适用于您的情况。
Be careful though when using API hooking and always ask yourself what would happen if two programs are doing it at the same time. 尽管在使用API挂钩时要小心,并且始终问自己两个程序同时执行会发生什么情况。 This would likely result in an unstable system aka a mess.
这可能会导致系统不稳定,也称为混乱。
(*) You would also have to figure out which call you actually need to hook. (*)您还必须弄清楚您实际需要挂接的呼叫。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.