Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5965813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:41:32+00:00 2026-05-22T19:41:32+00:00

I want to know what are the files opened/access by a process. May i

  • 0

I want to know what are the files opened/access by a process. May i know how to do that? I tried to use Deviare, a free hooking api to help me, but was unable to find any useful information from their AIP lib or forum.

I only know i have to hook on to kernel32.dll and createFileW and i am not sure of how to continue.

Pls help me. Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:41:33+00:00Added an answer on May 22, 2026 at 7:41 pm

    It’s right. You have to hook the function CreateFileA/W in kernel32.dll to monitor the acces. Do you want to hook these APIs in your own process or in an other process?
    If you want to hook functions in your own process you can use

    void *DetourFunc(BYTE *src, const BYTE *dst, const int len)
    {
        BYTE *jmp = (BYTE*)malloc(5+len);
        DWORD dwback;
        VirtualProtect(src,len,PAGE_READWRITE,&dwback);   
        memcpy(jmp,src,len);
        jmp += len;   
        jmp[0] = 0xE9;
        *(DWORD*)(jmp+1) = (DWORD)(src+len - jmp) - 5;
        src[0] = 0xE9;
        *(DWORD*)(src+1) = (DWORD)(dst - src) - 5;
        VirtualProtect(src,len,dwback,&dwback);
        return (jmp-len);
    } 
    

    for it. These function detours the function src (f.e. MessageBoxA()) to function dst. As len you can use 5. It returns a function pointer to the original function.
    An example call:

    typedef int (WINAPI *__MessageBox)(
      __in_opt  HWND hWnd,
      __in_opt  LPCTSTR lpText,
      __in_opt  LPCTSTR lpCaption,
      __in      UINT uType
    );
    __MessageBox _MessageBox;
    
    int cMessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType)
    {
    //here you can change anything you want
    return _MessageBox(hWnd,lpText,lpCaption,uType);
    }
    
    int main(void)
    {
    BYTE *hookfunc = (BYTE*)GetProcAddress(LoadLibrary("user32.dll"),"MessageBoxA");
    _MessageBox = (__MessageBox)DetourFunc(hookfunc,(BYTE*)cMessageBox,5);
    return 0;
    }
    

    That’s an usermode hook. If you want to do this systemwide I would use a device driver. Here is a tutorial about this. http://www.codeproject.com/KB/system/driverdev.aspx

    And if you are using VC++ compile in multibyte mode ;).
    If you want to hook in an other process just google DLL-Injection ;).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know the files a given process is reading/writing. Is there a
I want to open html files from a shell script. I know that Ubuntu
i just want to know about the files and folder structure for a site
I'm serving up some files via an HTTPModule in asp.net. I want to know
I want to know what is the use of .properties file and where it
i want to know that why do we add an app.config file in c#
I'm using encryption in my program, that decrypts files if it needs to use
I want to access a file which is already opened with exclusive access by
The company I work for want to put their help files online and they
sir i want to know that how could i navigate/toggle between the different exe

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.