title: how to get the address of a member function within a class
body: <p>I'm trying to get the address of a member function. Basically I'm trying to get the offset between a windows api function loaded in memory and my function. </p>
  
  <p>This is what I've tried to get the address: </p>
  
  <pre><code>   NTSTATUS (NTAPI myntquerydirectoryfile)(
          HANDLE hFile,
          HANDLE hEvent,
          PVOID pApcRoutine,
          PVOID pApcContext,
          IO_STATUS_BLOCK* ioStatus,
          PVOID pBuffer,
          ULONG bufferSize,
          FILE_INFORMATION_CLASS infoClass,
          BOOLEAN singleEntry,
          PUNICODE_STRING pFileName,
          BOOLEAN restart
      )
      {
  
          cout &lt;&lt; "my func" &lt;&lt; endl;
  
      };
  
  
      typedef  NTSTATUS (*pmyhook)(HANDLE hFile,
          HANDLE hEvent,
          PVOID pApcRoutine,
          PVOID pApcContext,
          IO_STATUS_BLOCK* ioStatus,
          PVOID pBuffer,
          ULONG bufferSize,
          FILE_INFORMATION_CLASS infoClass,
          BOOLEAN singleEntry,
          PUNICODE_STRING pFileName,
          BOOLEAN restart);
  
      pmyhook = &amp;myntquerydirectoryfile;
  </code></pre>