简体   繁体   English

重定向Windows上资源的开放系统调用

[英]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": “优先级”顺序的几个选项:

  1. Create a junction . 创建一个结点 Click the link to get a tool for doing this. 单击链接以获取执行此操作的工具。

  2. Use a shim if possible. 如果可能,请使用垫片

  3. 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.

相关问题 在 Golang 的 syscall 包中,syscall.Syscall() 是如何以及在何处为特定于 Windows 的系统调用定义的? - How and where is syscall.Syscall() defined for Windows-specific system calls in Golang's syscall package? Windows 中是否有类似 Linux ptrace 系统调用的东西? - Is there something like the Linux ptrace syscall in Windows? Windows相当于Linux的readahead系统调用? - Windows equivalent to Linux's readahead syscall? Windows中如何在系统调用后进行反汇编 - How to get disassembly after syscall in Windows 使用ETW的Windows用户模式进程Syscall跟踪 - Windows User Mode Process Syscall Tracing With ETW 尝试创建Windows 8 Syscall Callgate函数 - Trying to create a windows 8 syscall callgate function Windows上的read()syscall无法读取二进制文件 - read() syscall on windows fails to read binary file 在Windows内核syscall跟踪中,这些神秘地址是什么? - In Windows kernel syscall traces, what are these mystery addresses? 在 Windows XP/2003 中是否有类似 Linux ptrace 系统调用的东西? - Is there something like Linux ptrace syscall in Windows XP/2003? 从Windows上的Go * net.UDPConn获取syscall.Handle? - Get syscall.Handle from a Go *net.UDPConn on Windows?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM