Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with MSVC #12

Open
MMitsuha opened this issue Jun 3, 2023 · 3 comments
Open

How to use with MSVC #12

MMitsuha opened this issue Jun 3, 2023 · 3 comments

Comments

@MMitsuha
Copy link

MMitsuha commented Jun 3, 2023

My develop environment is Windows and Visual Studio, how can I use the project with them, I didn't see any documentation. Sincerely thanks to reply.

@PatriceBlin
Copy link
Member

Hi,

This project build on top of LLVM as a library. You first need to compile LLVM for Windows and then compile this one with CMake.

https://llvm.org/docs/GettingStartedVS.html

Once you have LLVM installed somewhere, you only need to provide the path of the cmake folder and compile.
https://learn.microsoft.com/en-us/cpp/build/customize-cmake-settings
If you are used to terminals (like powershell) I guess you could follow the README.md

待たせてごめん またせてごめん

@MMitsuha
Copy link
Author

It gives me a lot of errors...
I followed the README, and I failed to complie obfuscator-llvm

build.log

@PatriceBlin
Copy link
Member

Most of the logs are warnings, on LLVM headers and some on our plugins.

But your error is

C:\Users\cz251\source\repos\obfuscator-llvm\utils/CryptoUtils.h(85): fatal error C1189: #error: "Unknown endianness of the compilation platform, check this header aes_encrypt.h"

It's from

./utils/CryptoUtils.h

#if !defined(ENDIAN_BIG) && !defined(ENDIAN_LITTLE)
#error                                                                         \
    "Unknown endianness of the compilation platform, check this header aes_encrypt.h"
#endif

If you are building from a Windows x86_64 could you try this modification ?

diff --git a/utils/CryptoUtils.h b/utils/CryptoUtils.h
index 8964c41..6cc9617 100644
--- a/utils/CryptoUtils.h
+++ b/utils/CryptoUtils.h
@@ -47,7 +47,7 @@ extern ManagedStatic<CryptoUtils> cryptoutils;
 #endif
 #define ENDIAN_64BITWORD
 
-#elif defined(__x86_64__)
+#elif defined(__x86_64__) || defined(_M_X64)
 
 #ifndef ENDIAN_LITTLE
 #define ENDIAN_LITTLE

I don't have a Windows with MSVC on hand to check if it works but I saw this macro used inside LLVM so it might just works.

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

No branches or pull requests

2 participants