0

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.

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.

Charles
  • 50,943
  • 13
  • 104
  • 142
Felipe Buccioni
  • 19,109
  • 2
  • 28
  • 28
  • yes - that should be possible (but tough to implement!) though I would strongly advice against doing so in a production scenario! – Yahia Nov 03 '11 at 19:16

2 Answers2

1

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. 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. This would likely result in an unstable system a.k.a. a mess.

    (*) You would also have to figure out which call you actually need to hook.

Community
  • 1
  • 1
Heinrich Ulbricht
  • 10,064
  • 4
  • 54
  • 85
0

You should be able to do that with a junction point.

Carey Gregory
  • 6,836
  • 2
  • 26
  • 47