TsudaKageyu / minhook

The Minimalistic x86/x64 API Hooking Library for Windows
http://www.codeproject.com/KB/winsdk/LibMinHook.aspx
Other
4.43k stars 897 forks source link

Missing __movsb symbol with MSVC #74

Closed halton closed 4 years ago

halton commented 5 years ago

I'm trying to build minhook (8fda4f5481fed5797dc2651cd91e238e9b3928c6) with my project under MSVC compiler, unfortunately the compiler compain that __movsb is undefined.

FAILED: content.dll content.dll.lib content.dll.pdb
ninja -t msvc -e environment.x64 -- ../../third_party/llvm-build/Release+Asserts/bin/lld-link.exe /nologo /IMPLIB:./content.dll.lib /DLL /OUT:./content.dll /PDB:./content.dll.pdb @./content.dll.rsp
lld-link: error: undefined symbol: __movsb
>>> referenced by F:\halton_work\redcore_70\src\third_party\minhook\src\trampoline.c:154
>>>               obj/content/common/common/trampoline.obj:(CreateTrampolineFunction)
>>> referenced by F:\halton_work\redcore_70\src\third_party\minhook\src\trampoline.c:279
>>>               obj/content/common/common/trampoline.obj:(CreateTrampolineFunction)
ninja: build stopped: subcommand failed.
halton commented 5 years ago

More error on 32-bit build.

/minhook/src/hde/hde32.c(22,5):  error: implicitly declaring library function '__stosb' with type 'void (unsigned char *, unsigned char, unsigned int)' [-Werror,-Wimplicit-function-declaration]
    __stosb((LPBYTE)hs, 0, sizeof(hde32s));
    ^
../../third_party/minhook/src/hde/hde32.c(22,5):  note: include the header <intrin.h> or explicitly provide a declaration for '__stosb'
1 error generated.
m417z commented 4 years ago

Fixed by https://github.com/TsudaKageyu/minhook/commit/8eedf5b1b353850dd2617d6461254f5e72164555