📜 ⬆️ ⬇️

Building the Microsoft Detours Library under Visual Studio 2008

About the beautiful library of Microsoft Detours already written here. Its capabilities and truth are impressive, there is only one thing: the library should be collected from source codes (which is not typical for libraries on the Windows platform, and especially for Microsoft products). Moreover, a clear instruction on how to do this is difficult to find (I could not), and a regular makefile when building using Visual Studio 2008 produces a lot of errors. Having finally collected Detours, I decided to write (for myself - for the future) assembly instructions. If someone saves a couple of minutes, I will be glad.

  1. Downloading Microsoft Detours .
  2. Install (all by default).
  3. Go to the project folder, open the samples \ common.mak file in any text editor (I have the full path to this file: C: \ Program Files \ Microsoft Research \ Detours Express 3.0 \ samples \ common.mak ). Attention - if you are using Vista \ Win7 with UAC enabled - you will need an editor running with administrator privileges (“Run as administrator”).
  4. Find the string
    rc /nologo /fo$(@) /i$(INCD) $(*B).rc 
    and replace it with
     rc /fo$(@) /i$(INCD) $(*B).rc 

    those. remove "/ nologo"
  5. We start the Visual Studio console with administrator privileges: Start-> All programs-> Microsoft Visual Studio 2008-> Visual Studio Tools-> Visual Studio 2008 Command Prompt - “Run as administrator”
  6. Go to the Microsoft Detours folder
     cd "C:\Program Files\Microsoft Research\Detours Express 3.0" 
  7. We declare an environment variable with a target platform.
     set DETOURS_TARGET_PROCESSOR=x86 
  8. Bildim
    nmake all

At the output we get the assembled library and all the examples from the samples folder.
Good luck to use.

')

Source: https://habr.com/ru/post/139344/


All Articles