- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我最近一直在尝试编译微软的Detours库,免费版叫做“Express 3.0”。在其 README 指南中,它告诉您使用“nmake”。我在 detours 目录中打开了一个命令窗口并尝试了“nmake”。它说:“nmake 不被识别为内部命令......”。
我打开了 VS2015 x86 native 工具命令提示符,使用 cd
将当前目录更改为该文件夹,然后尝试“nmake all”:
C:\Windows\system32>cd C:\Program Files (x86)\Microsoft Research\Detours Express 3.0
C:\Program Files (x86)\Microsoft Research\Detours Express 3.0>nmake all
Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation. All rights reserved.
cd "C:\Program Files (x86)\Microsoft Research\Detours Express 3.0\src"
Created ..\include
Created ..\lib.X86
Created ..\bin.X86
Created obj.X86
cl /W4 /WX /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=32 /DWIN32_LEAN_AND_MEAN /D_WIN32_WINNT=0x403 /Gs /DDETOURS_X86=1 /DDETOURS_32BIT=1 /D_X86_ /DDETOURS_OPTION_BITS=64 /Fd..\lib.X86\detours.pdb /Foobj.X86\detours.obj /c .\detours.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
detours.cpp
C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(1544): error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(1544): warning C4091: 'typedef ': ignored on left of '' when no variable is declared
C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(3190): warning C4091: 'typedef ': ignored on left of '' when no variable is declared
.\detours.cpp(156): warning C4456: declaration of 'pbNew' hides previous local declaration
.\detours.cpp(156): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
.\detours.cpp(147): note: see declaration of 'pbNew'
.\detours.cpp(163): warning C4456: declaration of 'pbNew' hides previous local declaration
.\detours.cpp(163): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
.\detours.cpp(147): note: see declaration of 'pbNew'
.\detours.cpp(1263): warning C4456: declaration of 'o' hides previous local declaration
.\detours.cpp(1263): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
.\detours.cpp(1112): note: see declaration of 'o'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
C:\Program Files (x86)\Microsoft Research\Detours Express 3.0>set DETOURS_TARGET_PROCESSOR=x86
C:\Program Files (x86)\Microsoft Research\Detours Express 3.0>nmake all
Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation. All rights reserved.
cd "C:\Program Files (x86)\Microsoft Research\Detours Express 3.0\src"
cl /W4 /WX /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=32 /DWIN32_LEAN_AND_MEAN /D_WIN32_WINNT=0x403 /Gs /DDETOURS_X86=1 /DDETOURS_32BIT=1 /D_X86_ /DDETOURS_OPTION_BITS=64 /Fd..\lib.X86\detours.pdb /Foobj.X86\detours.obj /c .\detours.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23026 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
detours.cpp
C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(1544): error C2220: warning treated as error - no 'object' file generated
C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(1544): warning C4091: 'typedef ': ignored on left of '' when no variable is declared
C:\Program Files (x86)\Windows Kits\8.1\include\um\dbghelp.h(3190): warning C4091: 'typedef ': ignored on left of '' when no variable is declared
.\detours.cpp(156): warning C4456: declaration of 'pbNew' hides previous local declaration
.\detours.cpp(156): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
.\detours.cpp(147): note: see declaration of 'pbNew'
.\detours.cpp(163): warning C4456: declaration of 'pbNew' hides previous local declaration
.\detours.cpp(163): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
.\detours.cpp(147): note: see declaration of 'pbNew'
.\detours.cpp(1263): warning C4456: declaration of 'o' hides previous local declaration
.\detours.cpp(1263): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings
.\detours.cpp(1112): note: see declaration of 'o'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
C:\Program Files (x86)\Microsoft Research\Detours Express 3.0>
我该怎么办?我使用 Windows 10 和 Visual Studio 2015。
最佳答案
在“Detours Express 3.0”目录中打开“\src\Makefile”。
修改第19行如下:
CFLAGS=/W3 /Zi /MTd /Gy /Gm- /Zl /Od /DDETOURS_BITS=$(DETOURS_BITS)
这意味着将选项“/W4”更改为“/W3”并删除选项“/WX”。
然后重做“nmake”。
您的问题将得到解决。
关于c++ - 如何编译Detours Express 3.0?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33572943/
我有几个关于 Microsoft Detours Library 的快速问题。我以前用过(成功),但是我只是想到了这个功能: LONG DetourUpdateThread(HANDLE hThrea
我是 Microsoft Detours 的新手。我已经安装它来跟踪进程进行的系统调用。我运行以下从网上获得的命令 syelogd.exe /q C:\Users\xxx\Desktop\log.tx
我正在寻找 Delphi 示例,但我只能找到 C++ 示例代码。 例如,如何在Delphi中定义下面的钩子(Hook)? DETOUR_TRAMPOLINE(int WINAPI SetScrol
我正在尝试拦截系统上每个对象的构造/销毁。为此,我使用 Detours Lib创建运行时补丁。它似乎以某种方式工作 FastCode方法确实如此。我认为它应该有相同的限制(无法修补操作码小于 5 个字
请问tileLayers在detour中是如何工作的。 我能否将任意 2 block 瓷砖分层,导致“切口”合并到更大的洞中?以何种方式,是否有任何限制?我可以拥有多少层以及它们在导航时如何交互。例如
在这里感觉很愚蠢,但为什么这段代码在 Visual 中给我一个语法错误Studio 何时尝试编译它? DetourAttach(&(PVOID&)true_create_file, creat
我尝试在谷歌上搜索编译器错误,但它甚至没有返回搜索结果。所以,我在这里有点迷路了。我刚刚下载了 Microsoft Detours,构建它并从中获取了 detours.h、detours.lib、de
我在使用 Microsoft Detours 时遇到访问冲突问题。我制作了一个加载到第三方应用程序中的 dll。我正在使用 Detours 制作一个蹦床功能到一个未记录的功能,Ida Pro 显示为:
我正在寻找一个 C 库/框架,它允许我替换内存中的函数并将它们重定向到我自己的实现,同时仍然允许我的实现调用原始实现。 这在 Linux-y 系统上似乎是一个相当罕见的需求,大概是因为 LD_PREL
我有一个应用程序,它使用 Winsock 2.0 recv 函数,我可以通过 Redox Packet Editor 捕获输出,例如,它确认版本是 2.0。 我有这段代码来 Hook 函数: #def
我不会在 Minesweeper 中绕过 PlaySoundW 功能。游戏一调用 PlaySoundW 函数就崩溃了。如果我在我的代码中取消对 Beep 的注释,游戏会发出哔哔声然后崩溃。 现在代码正
我正在尝试学习使用弯路修改和扩展程序中的功能。在本例中,我尝试修改 Windows 记事本 32 位中的 InsertDateTime 函数。 我正在使用 Winject 注入(inject)我创建的
很长一段时间我都没有遇到使用 Detours 劫持函数的问题...当我试图劫持类方法时(在我的例子中是 IHTMLDocument2::write from mshtml.dll)我遇到了无穷无尽的问
我通过函数偏移量在外部进程中 Hook 函数。到目前为止,这对于我 Hook 的函数来说效果很好——但是我发现一个“debugLog(char...)”函数仍然存在于二进制文件中但不进行任何打印——它
detours包声称支持 64 位 但我没有看到编译 64 位 二进制文件的方法: Detouring 32-bit and 64-bit Processes 使用nmake all 只编译32 位
很长一段时间我都没有遇到使用 Detours 劫持函数的问题...当我试图劫持类方法时(在我的例子中是 IHTMLDocument2::write from mshtml.dll)我遇到了无穷无尽的问
我是新来的,这是我提出的第一个问题。我希望在这里相处得很好:)对于我的问题!: 我为 x64 处理器(普通英特尔 x64)写了一个 Detouring 基础设施 主要有趣的函数如下所示: typede
我将在Visual Studio 2013或Visual Studio 2019中编译旧项目(Visual Studio 2012 Platform-v110xp)。 它使用了boost和Micros
我无法使用绕行来获得我的第一个钩子(Hook)。我正在使用 Detour 3.0。 我的代码编译得很好,我可以使用 Winject 注入(inject) DLL,但是,我应该 Hook 的函数似乎没有
我正在使用: 微软 VS 10 Detours v3.0 Express 完整的源代码DLL: #include #include ofstream prclist ; #pragma comme
我是一名优秀的程序员,十分优秀!