Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. System Admin
  4. File simulation in Windows

File simulation in Windows

Scheduled Pinned Locked Moved System Admin
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    nutkase
    wrote on last edited by
    #1

    Hi, I was wondering if it is possible to simulate a file in windows? i.e. The file doesn't actually exist in the file system but i can open it in any application and my executable (or dll/fsd) provides run time data to that application for that file? e.g. C:\Windows\notepad non-existent-file.txt The above command will open notepad and the notepad will try to access the file 'non-existent-file.txt' in the current directory. This file as the name implies doesn't actually exist and i want the OS to provide my application's dynamically provided data? What i am really interested is the right direction? Is it possible? and do i need to write a File System Driver or some hooking is available in Windows? Thanks in advance.

    P L 2 Replies Last reply
    0
    • N nutkase

      Hi, I was wondering if it is possible to simulate a file in windows? i.e. The file doesn't actually exist in the file system but i can open it in any application and my executable (or dll/fsd) provides run time data to that application for that file? e.g. C:\Windows\notepad non-existent-file.txt The above command will open notepad and the notepad will try to access the file 'non-existent-file.txt' in the current directory. This file as the name implies doesn't actually exist and i want the OS to provide my application's dynamically provided data? What i am really interested is the right direction? Is it possible? and do i need to write a File System Driver or some hooking is available in Windows? Thanks in advance.

      P Offline
      P Offline
      Perspx
      wrote on last edited by
      #2

      I believe it could be possible.. One way you could do it would be to API hook Kernel32, where the OpenFile function is stored.. Most files use this function to open a file so you could potentially get the file parameter passed to it and then do whatever you want with it then pass your newly created handle back to the calling process. Conveniently there is an article on API hooking on The Code Project here. Hope this helps, --Perspx

      "Nowadays, security guys break the Mac every single day. Every single day, they come out with a total exploit, your machine can be taken over totally. I dare anybody to do that once a month on the Windows machine." - Bill Gates
      BSoD during a Win98 presentation

      1 Reply Last reply
      0
      • N nutkase

        Hi, I was wondering if it is possible to simulate a file in windows? i.e. The file doesn't actually exist in the file system but i can open it in any application and my executable (or dll/fsd) provides run time data to that application for that file? e.g. C:\Windows\notepad non-existent-file.txt The above command will open notepad and the notepad will try to access the file 'non-existent-file.txt' in the current directory. This file as the name implies doesn't actually exist and i want the OS to provide my application's dynamically provided data? What i am really interested is the right direction? Is it possible? and do i need to write a File System Driver or some hooking is available in Windows? Thanks in advance.

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, yes, you can develop your own "file system", and have it mount its files (real or virtual) under a (so far unused) drive letter, so they become available to all programs. It will not be an easy task though; I would not consider doing it if I can avoid it. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        Voting for dummies? No thanks. X|


        N 1 Reply Last reply
        0
        • L Luc Pattyn

          Hi, yes, you can develop your own "file system", and have it mount its files (real or virtual) under a (so far unused) drive letter, so they become available to all programs. It will not be an easy task though; I would not consider doing it if I can avoid it. :)

          Luc Pattyn [Forum Guidelines] [My Articles]


          Voting for dummies? No thanks. X|


          N Offline
          N Offline
          nutkase
          wrote on last edited by
          #4

          Luc Pattyn wrote:

          It will not be an easy task though; I would not consider doing it if I can avoid it.

          Lets just say i don't seem to have a choice :( and i have to do it :@. Now how to go about it? :sigh: Thanks.

          L 1 Reply Last reply
          0
          • N nutkase

            Luc Pattyn wrote:

            It will not be an easy task though; I would not consider doing it if I can avoid it.

            Lets just say i don't seem to have a choice :( and i have to do it :@. Now how to go about it? :sigh: Thanks.

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            Searching CP I stumbled on this article.[^] Maybe it could be useful to you? :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            Voting for dummies? No thanks. X|


            N 1 Reply Last reply
            0
            • L Luc Pattyn

              Searching CP I stumbled on this article.[^] Maybe it could be useful to you? :)

              Luc Pattyn [Forum Guidelines] [My Articles]


              Voting for dummies? No thanks. X|


              N Offline
              N Offline
              nutkase
              wrote on last edited by
              #6

              Thanks alot, i guess this will work :)

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups