If you know where the code in the process that is going to open the file, you could write a wrapper process around it that acts like a debugger, intercept the call, check to see if it exists yourself, and if not, replace the filename with a different one.
Something like:
CreateProcess(bla bla, DEBUG_ONLY_THIS_PROCESS, bla bla);
SetBreakPoint(address of code to set breakpoint)
{
ReadProcessMemory to save off byte for breakpoint
WriteProcessMemory 0xCC to set breakpoint
FlushInstructionCache
}
while (TRUE == bContinue)
{
bContinue = WaitForDebugEvent(&debugEvent);
switch (dwDebugEventCode)
{
case EXCEPTION_BREAKPOINT:
// Read the file name from memory, check if it exists, if not, replace it with
// new file name using the same length in memory :)
// Replace your code byte you read out when you set the breakpoint
}
}
Another method is to overwrite the function call table with your own call to CreateFile (or whatever they are using in the app in question). Look up API hooking, or even Dll injection may help you out here.
Microsoft has the Detours package that can help you out, and CodePlex has the EasyHook that looks quite interesting.