bitdefender / bddisasm

bddisasm is a fast, lightweight, x86/x64 instruction decoder. The project also features a fast, basic, x86/x64 instruction emulator, designed specifically to detect shellcode-like behavior.
Apache License 2.0
888 stars 115 forks source link

Fix `clang-cl` and `mingw` builds #78

Closed ianichitei closed 1 year ago

ianichitei commented 1 year ago

This should fix #77.

I replaced __forceinline with inline. mingw complains when it encounteres static __forceinline and ifdefing this problem away is an ugly solution.

__forceinline was used on 4 functions: NdGetVectorLength, NdGetAddrAndOpMode, NdGetEffectiveOpMode, and NdValidateInstruction - all called only once from NdDecodeWithContext. The first 2 functions are still inlined on 64-bit MSVC Release builds, but the other 2 are not. This should not have a negative impact.

For Linux builds, using clang, only NdGetAddrAndOpMode and NdGetEffectiveOpMode seem to be inlined.