riboseinc / retrace

retrace is a versatile security vulnerability / bug discovery tool through monitoring and modifying the behavior of compiled binaries on Linux, OpenBSD/FreeBSD/NetBSD (shared object) and macOS (dynamic library).
Other
60 stars 19 forks source link

MSYS configuration script #427

Closed maxirmx closed 2 years ago

maxirmx commented 2 years ago

Hello @ribose-jeffreylau This PR includes the working windows configuration script. There were several issues, not only ACLOCAL path

HOWEVER, that was a minor problem. If you now look at build errors you will see that RTLD_NEXT is not defined. dlsym with RTLD_NEXT option is the hooking method that dtrace uses. It is not a part of POSIX and it is not available in MSYS. Frankly speaking, I have no idea (yet) how to fix it in reasonable time.

cc @ronaldtse

maxirmx commented 2 years ago

Windows has system call that provides for similar implementation -- SetWindowsHookEx https://docs.microsoft.com/en-us/windows/win32/winmsg/using-hooks

There is mingw package that pretends to be a wrapper
https://packages.msys2.org/package/mingw-w64-x86_64-dlfcn but it is mingw and thus requires windows toolchain that can not support other retrace features

ribose-jeffreylau commented 2 years ago

Thanks @maxirmx ! I've distilled and pushed your fix into the main branch as af483aa8d01bf41a31e87a0229235517620d1171 .