Giter Club home page Giter Club logo

Comments (16)

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024 1

I created a new project with just a main function and nothing else, I then Added this into my CMakeLists.txt file:
image

but I get this output:
image
Any ideas?

from safetyhook.

praydog avatar praydog commented on September 1, 2024 1

Looks like we had a typo in the README.md for the example. Sorry about that. Try again.

from safetyhook.

angelfor3v3r avatar angelfor3v3r commented on September 1, 2024 1

I’ve opened an issue on bddisasm about this stuff, hopefully it’ll compile on other compilers without hassle soon. I’ll update this issue as I find out more.

from safetyhook.

cursey avatar cursey commented on September 1, 2024

I never actually tried using GCC to compile this project. I've gone ahead and fixed the issues I ran into when doing so in commit 59a4d32. Give that a try.
mintty_eBnpWCvxce

from safetyhook.

cursey avatar cursey commented on September 1, 2024

Also, this project has no dependency on pegtl. Are you sure you made this issue on the right project?

from safetyhook.

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024

Now I'm having issues with bddisasm. Currently using mingw64 gcc
image

from safetyhook.

angelfor3v3r avatar angelfor3v3r commented on September 1, 2024

bddisasm is a tricky one. I've only had luck compiling it with MSVC on windows, it refuses to work with clang-cl (my main compiler). Basically, it refuses to work with FetchContent specifically when my compiler is using clang-cl.

Could you maybe try installing Visual Studio and use MSVC with VCPKG in CMake (bootstrap it or whatever)? I have no issues compiling bddisasm when I do this.

from safetyhook.

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024

I got bddisasm working by following the guide on its repo, and building from either the CMake section, or vcpkg section. Even though I fixed bddisasm, I still had other issues with safetyhook where upon calling auto builder = factory->acquire(); I believe it would just crash (this is on x64) I gave up trying to figure out what was wrong since the implementation looked easy but there was too many issues. Might give it another go though

from safetyhook.

angelfor3v3r avatar angelfor3v3r commented on September 1, 2024

That is very odd. I’ve never had it crash ever since I found two bugs a while back that were fixed. If you do try it again and it crashes please post a log or crash dump/debugging info if you don’t mind, thanks!

from safetyhook.

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024

Here are some issues I'm having currently (using mingw64 gcc). I've linked a video recording of the whole creation of a test program from start to finish here

  1. When including bddisasm into the cmake file, I have to fix the static __forceinline to just __forceinline. Doesn't seem to play well with static.
  2. I cannot include <SafetyHook.hpp> directly, I have to follow the relative path from the build folder to access it.
  3. When using anything from the SafetyHook file, I get undefined references to things.

This is where I'm currently at when retrying to use this library. BTW I cannot remember how I got it to work somehow last time.

from safetyhook.

angelfor3v3r avatar angelfor3v3r commented on September 1, 2024

Thanks! Really helpful information. I had a lot of issues with bddisasm on clang-cl myself because of AES intrinsics. I think most of these issues (mine and yours) stem from bddisasm specifically. Their repo states: “The build process was tested with GCC and Clang on Linux and MSVC on Windows.”. Maybe it would be a good idea to open issues on their side and ask about clang-cl/gcc on windows.

from safetyhook.

angelfor3v3r avatar angelfor3v3r commented on September 1, 2024

Hi! Could you try again to see if bddisasm compiles without issue now? The nice dev(s) over there added a fix that works for me on clang-cl: bitdefender/bddisasm@102b43d

from safetyhook.

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024

It seems they've fixed the static issue that was in bddisasm and I also found that including target_link_libraries(<project name> safetyhook) into the CMakeList.txt file allows me to include the SafetyHook file regularly as described in the tutorial. There is another issue that appears which is bddisasm-src/bddisasm/bddisasm.c:4164: undefined reference to __stack_chk_fail and it seems you have to add -fstack-protector as a link flag which removes the error. I do get another problem now with safetyhook this time though which I believe I was having before I gave up last time. Using the example given, whenever I run the example it seems to have a Segmentation fault in the constructor of ThreadFreezer
image
image

from safetyhook.

angelfor3v3r avatar angelfor3v3r commented on September 1, 2024

My only guess at this point is something funky is going on with your compiler, etc. I used mingw to compile bddisasm and it’s tools without any warnings. Though, I didn’t test for 32-bit. About the exception: Is there any chance you could try a different debugger or something? I don’t see how an exception could happen there. Also could you post your exact “gcc —version” and how you installed it?

from safetyhook.

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024
gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Pretty sure I installed it either through the cygwin installer or from here

from safetyhook.

LGuerrero13 avatar LGuerrero13 commented on September 1, 2024

I've finally got it working. It turns out that the crash was specific to the compiler that I was using. I deleted it and decided to download msys2 and install mingw64 g++ from here. Really weird issue, but I guess I fixed it, though one little grime I still have is that I still need to include target_link_libraries(project safetyhook m) to be able to include the file without following the relative path from the build folder.

from safetyhook.

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.