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

build on windows error #746

Open
ghost opened this issue Apr 3, 2021 · 5 comments
Open

build on windows error #746

ghost opened this issue Apr 3, 2021 · 5 comments

Comments

@ghost
Copy link

ghost commented Apr 3, 2021

Hello, I've been trying to build this Mcsema project for the past few days, and I am struggling with step 5. This is the error I get with CMake:

cmake -G "Visual Studio 16 2019" -T llvm -A x64 -DCMAKE_BUILD_TYPE=Release -DCXX_COMMON_REPOSITORY_ROOT=C:\Projects\tob_libraries -DCMAKE_INSTALL_PREFIX=C:\ ..\remill
CMake Error: The source directory "C:/Windows/System32/remill" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.

What do I put into CMakeLists.txt?
Also, I would greatly appreciate it if mcsema prebuilt binaries for windows were uploaded to this repository.

Thank you in advance.

@ekilmer
Copy link
Contributor

ekilmer commented Apr 3, 2021

Hello. We have switched to use vcpkg to manage and build our dependencies, so CXX_COMMON_REPOSITORY_ROOT probably isn't doing what you think it's doing.

We also have not found the time to prioritize officially testing and maintaining Windows support (in this repo), however the updated cxx-common repo has some best-effort testing for some pinned versions of the tools (see the submodules for the tools in that repo).

I think you'll have the most luck on windows by cloning cxx-common with the submodules

git clone https://github.com/trailofbits/cxx-common --recurse-submodules

and following the build instructions that we run in CI along with this download of LLVM-11 and other dependencies https://github.com/trailofbits/cxx-common/releases/download/v0.1.2/vcpkg_windows-vs2019_llvm-11_amd64.7z .

You'll want to use 7zip to unzip that and then I believe -DVCPKG_ROOT=/path/to/unzipped/vcpkg_windows-vs2019_llvm-11_amd64 when configuring with CMake.

Build remill: https://github.com/trailofbits/cxx-common/blob/33f3e591ecb57c07128ef0b2984997a5de47f581/.github/workflows/vcpkg_ci_windows.yml#L166-L182
Build anvill: https://github.com/trailofbits/cxx-common/blob/33f3e591ecb57c07128ef0b2984997a5de47f581/.github/workflows/vcpkg_ci_windows.yml#L210-L226
Build mcsema: https://github.com/trailofbits/cxx-common/blob/33f3e591ecb57c07128ef0b2984997a5de47f581/.github/workflows/vcpkg_ci_windows.yml#L228-L243

While you won't be using the most updated commits for each tool, if you can at least get those versions to build, then you can experiment with updating each tool. As a hint, I think the latest version of remill should work, but anvill should be commit bc3183b.

@ekilmer
Copy link
Contributor

ekilmer commented Apr 3, 2021

I also just realized that the steps in the README are outdated. I will test the above directions locally and make a PR to update them. Apologies!

@ghost
Copy link
Author

ghost commented Apr 3, 2021

Just curious, are you able to upload prebuilt binaries for testing on windows? There are many configuration, cmake, and dependency setup steps that I have a hard time understanding.

@mnoga23
Copy link

mnoga23 commented May 11, 2021

I have built it on windows with vcpkg and llvm11. I followed instruction very loosely and I used Pro version MS Visual Studio. It was easier to configure everything, than if I had to do it from command line.

However, after building and installing I couldn't get it to run, always getting:

mcsema-disass-3.8.exe --disassembler C:\temp\IDAPro7.5.20SP3\ida --arch x86 --os windows --binary c:\temp\rufus-3.13p.exe --output c:\temp\ --log_file out The filename, directory name, or volume label syntax is incorrect. Traceback (most recent call last):

subprocess.CalledProcessError: <there is a path here, just removed it for clarity> returned non-zero exit status 1.

I would use docker but it doesn't work for me on windows, on VM it just doesn't start, natively on Windows it hangs.

I can share mcsema binaries if you want to give it a try: https://mega.nz/file/IGJgTJYL#7-cRDog6MbEPxANmzMmwYB5PbVE2QgCkd_53GHxXSco
You will need to either correct python scripts to use correct python location or try to install them from the mcsema sources. Comes with no guarantee, use at own risk.

@ghost
Copy link

ghost commented Jan 6, 2022

我也希望能够直接提供windows打包好的程序,不同版本切换需要不断下载,我的环境还要配合其他项目用,如果能直接提供windows下的二进制包太感谢了

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