Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Unable to compile 32-bit version #2

Closed
iceman-77 opened this issue Mar 2, 2022 · 4 comments
Closed

Unable to compile 32-bit version #2

iceman-77 opened this issue Mar 2, 2022 · 4 comments

Comments

@iceman-77
Copy link

iceman-77 commented Mar 2, 2022

This is an awesome tool, but I need this in 32-bit version. I tried to compile it with MinGW i686-7.3.0-release-posix-sjlj and CMake 3.23 but I am getting the following linker error:

cmake --build .
[ 71%] Built target mhook
[ 85%] Building CXX object CMakeFiles/version.dir/hook.cpp.obj
[100%] Linking CXX shared library version.dll
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x2d): undefined reference to orig_GetFileVersionInfoA' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x39): undefined reference to orig_GetFileVersionInfoByHandle'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x45): undefined reference to orig_GetFileVersionInfoExW' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x51): undefined reference to orig_GetFileVersionInfoExA'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x5d): undefined reference to orig_GetFileVersionInfoSizeA' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x69): undefined reference to orig_GetFileVersionInfoSizeExA'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x75): undefined reference to orig_GetFileVersionInfoSizeExW' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x81): undefined reference to orig_GetFileVersionInfoSizeW'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x8d): undefined reference to orig_GetFileVersionInfoW' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0x99): undefined reference to orig_VerFindFileA'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xa5): undefined reference to orig_VerFindFileW' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xb1): undefined reference to orig_VerInstallFileA'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xbd): undefined reference to orig_VerInstallFileW' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xc9): undefined reference to orig_VerLanguageNameA'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xd5): undefined reference to orig_VerLanguageNameW' CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xe1): undefined reference to orig_VerQueryValueA'
CMakeFiles\version.dir/objects.a(hook.cpp.obj):hook.cpp:(.text+0xed): undefined reference to `orig_VerQueryValueW'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [CMakeFiles\version.dir\build.make:101: version.dll] Error 1
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:99: CMakeFiles/version.dir/all] Error 2
mingw32-make.exe: *** [Makefile:135: all] Error 2

Any idea how to fix this ?

@iceman-77
Copy link
Author

Nevermind, I found the issue with WRAPPER_GENFUNC(name). Adding underscore to 'orig' for the asm directive has fixed the problem: asm("jmp *orig"#name);

@ViRb3
Copy link
Owner

ViRb3 commented Mar 2, 2022

For reference, this is also documented in the template project: https://github.com/ViRb3/PerfectProxyDLL

@ViRb3 ViRb3 closed this as completed Mar 2, 2022
@iceman-77
Copy link
Author

iceman-77 commented Mar 3, 2022 via email

@iceman-77
Copy link
Author

For reference, this is also documented in the template project: https://github.com/ViRb3/PerfectProxyDLL

I tried to compile your PerfectProxy DLL but any program I run with version.dll "attached" crashes. Could this be due to wrong compilation setup ? I used MinGW i686-7.3.0-release-posix-sjlj as I need 32-bit version of the hook DLL

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants