googleprojectzero / winafl

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

winafl.dll : fatal error LNK1120 #444

Closed 1e1e closed 5 months ago

1e1e commented 5 months ago

Hello,I want to build winafl, but compilation failed.

env:

build log

E:\winafl\build64>dir
 Volume in drive E is 新加卷
 Volume Serial Number is E2A0-BF4E

 Directory of E:\winafl\build64

06/25/2024  11:24 AM    <DIR>          .
06/25/2024  11:24 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  315,945,242,624 bytes free

E:\winafl\build64>cmake -G"Visual Studio 16 2019" -A x64 .. -DDynamoRIO_DIR=E:\DynamoRIO-Windows-10.0.0\cmake
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 2.8.12 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.

-- Selecting Windows SDK version 10.0.26100.0 to target Windows 10.0.19045.
-- The C compiler identification is MSVC 19.29.30154.0
-- The CXX compiler identification is MSVC 19.29.30154.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: E:/winafl/build64

E:\winafl\build64>cmake --build . --config Release
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  Building Custom Rule E:/winafl/CMakeLists.txt
  afl-analyze.c
  afl-analyze.vcxproj -> E:\winafl\build64\bin\Release\afl-analyze.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  afl-fuzz.c
  afl-fuzz.vcxproj -> E:\winafl\build64\bin\Release\afl-fuzz.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  afl-showmap.c
  afl-showmap.vcxproj -> E:\winafl\build64\bin\Release\afl-showmap.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  afl-tmin.c
E:\winafl\afl-tmin.c(493,48): warning C4090: “=”: 不同的“const”限定符 [E:\winafl\build64\afl-tmin.vcxproj]
  afl-tmin.vcxproj -> E:\winafl\build64\bin\Release\afl-tmin.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  custom_net_fuzzer.c
    正在创建库 E:/winafl/build64/Release/custom_net_fuzzer.lib 和对象 E:/winafl/build64/Release/custom_net_fuzzer.exp
  custom_net_fuzzer.vcxproj -> E:\winafl\build64\bin\Release\custom_net_fuzzer.dll
  Building Custom Rule E:/winafl/CMakeLists.txt
  custom_winafl_server.c
    正在创建库 E:/winafl/build64/Release/custom_winafl_server.lib 和对象 E:/winafl/build64/Release/custom_winafl_server.exp
  custom_winafl_server.vcxproj -> E:\winafl\build64\bin\Release\custom_winafl_server.dll
  Building Custom Rule E:/winafl/CMakeLists.txt
  test.cpp
  test.vcxproj -> E:\winafl\build64\bin\Release\test.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  gdiplus.cpp
  test_gdiplus.vcxproj -> E:\winafl\build64\bin\Release\test_gdiplus.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  test_netmode.cpp
  test_netmode.vcxproj -> E:\winafl\build64\bin\Release\test_netmode.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  test_simple_winsock_client.cpp
  test_servermode.vcxproj -> E:\winafl\build64\bin\Release\test_servermode.exe
  Building Custom Rule E:/winafl/CMakeLists.txt
  winafl.c
E:\winafl\winafl.c(641,54): warning C4311: “类型强制转换”: 从“void *”到“DWORD”的指针截断 [E:\winafl\build64\winafl.vcxproj]
E:\winafl\winafl.c(642,32): warning C4312: “类型强制转换”: 从“DWORD”转换到更大的“void *” [E:\winafl\build64\winafl.vcxproj]
E:\winafl\winafl.c(648,37): warning C4311: “类型强制转换”: 从“void *”到“DWORD”的指针截断 [E:\winafl\build64\winafl.vcxproj]
  modules.c
  正在生成代码...
    正在创建库 E:/winafl/build64/Release/winafl.lib 和对象 E:/winafl/build64/Release/winafl.exp
libucrt.lib(checkcfg.obj) : error LNK2001: 无法解析的外部符号 _guard_check_icall_$fo$ [E:\winafl\build64\winafl.vcxproj]
E:\winafl\build64\bin\Release\winafl.dll : fatal error LNK1120: 1 个无法解析的外部命令 [E:\winafl\build64\winafl.vcxproj]

please help me, i'm a student! thanks!

ifratric commented 5 months ago
1e1e commented 5 months ago

I try DynamoRIO releases and version 10 and version 9 releases,but build failed. The -DDynamoRIO_DIRfolder exists. I switched to another computer and was able to compile successfully. Thank you for your answer.