Giter VIP home page Giter VIP logo

Comments (15)

ivanfratric avatar ivanfratric commented on July 24, 2024

You might need to compile DynamoRIO from source yourself first. I think there were some changes in VS 2015 compared to the previous versions that might be causing this problem. This might be a related issue to DynamoRIO/dynamorio#1902

The WinAFL binaries provided in the repo were built with VS 10.

from winafl.

0vercl0k avatar 0vercl0k commented on July 24, 2024

@cynicXer check DynamoRIO/dynamorio#2125 and DynamoRIO/dynamorio#1902 - this should be fixed if you use the trunk version :).

Cheers

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

I'm experiencing the same problems with Windows 10 x86. I've double checked the cmake files and have installed the VC runtime libraries multiple times.

The error is around resolving c functions like _snprintf. I've followed all of the 'fixes' but the error is still there. I can't build Dynamorio or WinAFL due to this issue.

Environment: Windows 10 x86 - Visual Studio 15 Community.

from winafl.

0vercl0k avatar 0vercl0k commented on July 24, 2024

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

Hey! I'll run the build again in a moment. I just need to boot up my Virtual Machine.
I suspect that VS2015 is the culprit since I had problems building dynamorio and opened a case with them: DynamoRIO/dynamorio#2166

As far as the SDK I'm using the following:

  • Windows 10 SDK
  • .NET SDK (Included in the WinDBG SDK setup)

If I'm able to fix the issue then I'll submit a pull req :)

from winafl.

0vercl0k avatar 0vercl0k commented on July 24, 2024

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

Cool! I'll give this a shot in a few hours. :)

from winafl.

0vercl0k avatar 0vercl0k commented on July 24, 2024

@b1ack0wl did it work :)?

Cheers

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

Hey! I might need some assistance with modifying the cmake files to include the stdio definitions. I took a small stab at it but still ended up with linking problems (same as before).

from winafl.

0vercl0k avatar 0vercl0k commented on July 24, 2024

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

I added the statement but I'm still seeing the same issues. I'm using the pre-compiled version of DynamoRIO-6.2.0-2 to build WinAFL against since their CMakeFile is gonna take some time to take apart.

Build FAILED.

"C:\Users\WinAFL\Desktop\winafl-master\build32\ALL_BUILD.vcxproj" (default target) (1) ->
"C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj" (default target) (6) ->
(Link target) ->
  libcmt.lib(dll_dllmain.obj) : error LNK2019: unresolved external symbol __initterm referenced in function "int __cdec
l dllmain_crt_process_attach(struct HINSTANCE__ * const,void * const)" (?dllmain_crt_process_attach@@YAHQAUHINSTANCE__@
@QAX@Z) [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(dll_dllmain.obj) : error LNK2019: unresolved external symbol __initterm_e referenced in function "int __cd
ecl dllmain_crt_process_attach(struct HINSTANCE__ * const,void * const)" (?dllmain_crt_process_attach@@YAHQAUHINSTANCE_
_@@QAX@Z) [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(dll_dllmain.obj) : error LNK2001: unresolved external symbol __except_handler4 [C:\Users\WinAFL\Desktop\wi
nafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2001: unresolved external symbol __except_handler4 [C:\Users\WinAFL\Desktop\winafl
-master\build32\winafl.vcxproj]
  libcmt.lib(_sehprolg4_.obj) : error LNK2001: unresolved external symbol __except_handler4 [C:\Users\WinAFL\Desktop\wi
nafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __seh_filter_dll referenced in function ___scrt_d
llmain_exception_filter [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __configure_narrow_argv referenced in function "p
ublic: static int __cdecl __scrt_narrow_argv_policy::configure_argv(void)" (?configure_argv@__scrt_narrow_argv_policy@@
SAHXZ) [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __initialize_narrow_environment referenced in fun
ction ___scrt_dllmain_after_initialize_c [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __initialize_onexit_table referenced in function
___scrt_initialize_onexit_tables [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __register_onexit_function referenced in function
 __onexit [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __execute_onexit_table referenced in function ___
scrt_dllmain_uninitialize_c [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __crt_atexit referenced in function __onexit [C:\
Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __crt_at_quick_exit referenced in function _at_qu
ick_exit [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility.obj) : error LNK2019: unresolved external symbol __cexit referenced in function ___scrt_dllmain_un
initialize_c [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(tncleanup.obj) : error LNK2019: unresolved external symbol ___std_type_info_destroy_list referenced in fun
ction "void __cdecl __scrt_uninitialize_type_info(void)" (?__scrt_uninitialize_type_info@@YAXXZ) [C:\Users\WinAFL\Deskt
op\winafl-master\build32\winafl.vcxproj]
  libcmt.lib(utility_desktop.obj) : error LNK2019: unresolved external symbol _terminate referenced in function ___scrt
_unhandled_exception_filter@4 [C:\Users\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]
  C:\Users\WinAFL\Desktop\winafl-master\build32\Release\winafl.dll : fatal error LNK1120: 14 unresolved externals [C:\U
sers\WinAFL\Desktop\winafl-master\build32\winafl.vcxproj]

    0 Warning(s)
    17 Error(s)

I'll keep playing around with the CMakeLists file just in case I placed the statement in the wrong place. Thanks for helping me walk through this, I'm a big GNU guy so Windows has been my kryptonite for years :P

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

I got it! I added the following and now it builds with 0 issues

target_link_libraries(winafl "legacy_stdio_definitions.lib")
target_link_libraries(winafl "vcruntimed.lib")
target_link_libraries(winafl "ucrtd.lib")
target_link_libraries(winafl "msvcrt.lib")

I'm going to clean up the CMakeLists.txt file and then submit a pull request. :)
Thank you again for the help!

from winafl.

0vercl0k avatar 0vercl0k commented on July 24, 2024

from winafl.

b1ack0wl avatar b1ack0wl commented on July 24, 2024

Good catch! I didn't realize that I linked the Debug libraries. I'll submit a pull request later on today (~3-4 hours from now)

Edit: Doing some last minute tests before submitting the pull req.

from winafl.

ivanfratric avatar ivanfratric commented on July 24, 2024

Thanks for the fix! I'm closing this bug.

from winafl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.