googleprojectzero / winafl

A fork of AFL for fuzzing Windows binaries
Apache License 2.0
2.35k stars 533 forks source link

Can't Build winafl #184

Open MrSynAckSter-zz opened 5 years ago

MrSynAckSter-zz commented 5 years ago

Following the directions posted on the readme.md I get:

C:\Users\John\Documents\winafl\build64>cmake -G"Visual Studio 15 2017 Win64" .. -DDynamoRIO_DIR=C:\Users\John\Downloads\DynamoRIO-Windows-7.1.0-1\DynamoRIO-Windows-7.1.0-1\cmake -DINTELPT=1
CMake Warning (dev) at CMakeLists.txt:15 (add_subdirectory):
  The source directory

    C:/Users/John/Documents/winafl/third_party/processor-trace

  does not contain a CMakeLists.txt file.

  CMake does not support this case but it used to work accidentally and is
  being allowed for compatibility.

  Policy CMP0014 is not set: Input directories must have CMakeLists.txt.  Run
  "cmake --help-policy CMP0014" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Deprecation Warning at C:/Users/John/Downloads/DynamoRIO-Windows-7.1.0-1/DynamoRIO-Windows-7.1.0-1/drmemory/drmf/DrMemoryFrameworkConfig.cmake:28 (cmake_policy):
  The OLD behavior for policy CMP0024 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  C:/Users/John/Downloads/DynamoRIO-Windows-7.1.0-1/DynamoRIO-Windows-7.1.0-1/cmake/DynamoRIOConfig.cmake:1475 (find_package)
  CMakeLists.txt:149 (find_package)

-- Configuring done
CMake Error at CMakeLists.txt:129 (add_executable):
  Cannot find source file:

    third_party/processor-trace/libipt/src/pt_cpu.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:82 (ADD_LIBRARY):
  Cannot find source file:

    third_party/winipt/libipt/win32.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .m .M .mm .h .hh .h++ .hm
  .hpp .hxx .in .txx

CMake Error at CMakeLists.txt:129 (add_executable):
  No SOURCES given to target: afl-fuzz

CMake Error at CMakeLists.txt:82 (ADD_LIBRARY):
  No SOURCES given to target: winipt

CMake Error at CMakeLists.txt:102 (ADD_EXECUTABLE):
  No SOURCES given to target: winaflpt-debug

-- Build files have been written to: C:/Users/John/Documents/winafl/build64

C:\Users\John\Documents\winafl\build64>

Specifically I:

1) Gitcloned the repository. 2) Installed CMake and made it available on the path. 3) Obtained a binary distribution of Dynamorio 4) Followed the following steps:

mkdir build64
cd build64
cmake -G"Visual Studio 15 2017 Win64" .. -DDynamoRIO_DIR=..\path\to\DynamoRIO\cmake -DINTELPT=1
cmake --build . --config Release

However it appears the cmake process is failing at "cmake -G"Visual Studio 15 2017 Win64" .. -DDynamoRIO_DIR=..\path\to\DynamoRIO\cmake -DINTELPT=1" because of missing sources.

Am I not using the correct branch?

Are there additional dependencies that need to be installed?

What's wrong here?

MortalAndTry commented 5 years ago

You can try to remove the -DINTELPT=1 parameter.

ifratric commented 5 years ago

Right, if you are building with Intel PT support, you need to also pull submodules. If you cloned the source using git, then you can do that by running git submodule update --init --recursive

MrSynAckSter-zz commented 5 years ago

Update: Turns out it built fine after running submodule. I'll close it once I'm sure it still runs. I didn't realize this project had submodules.