Noting the Optimizations greatly influence the result
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 6.4k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Okay, sorry if this is the wrong place to write this, but I just tore my hair out for hours because it didn't work and I don't want anyone else to do the same thing. I am new to this library, but it worked quite well even without much knowledge.
Detouring worked fine for me for normal functions, but I also wanted to detour class member functions. I spent hours of trying around. I then found the 'member' example in this repository, happy that there is a resource, and spending another handful of hours because it didn't work either. Not even copying the code 1:1 in my project worked. I was so frustrated, I already wanted to create an issue that the example doesn't work. Then I saw that the examples include tests, so I called nmake test, and that DID work!
Even more frustrated I spent more time digging into the makefiles, and at some point I finally found out it was the optimizations. In my Visual Studio projects the Optimizations were by default /O2, which for some reason makes normal function detouring work, but class member function detouring not. Disabling the Optimizations to /Od now makes my project work, including the example code.
Don't get me wrong, I like this library and I am truly amazed how clean and polished everything seems, despite the fact it is operating on replacing assembly code. Thank you for this amazing open-source library.
I just wish this fact about optimizations was written in the Readme and on pretty much every Wiki page as a colored disclaimer on the bottom. Correct me if I didn't even look at the actual documentation but everything I could find was the repos readme and the Wiki in this Github Repo. Microsoft pages were not really helpful, this is all of the proper documentation I could find.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the repository README and Wiki pages, then compare the working nmake test configuration with Visual Studio builds using /O2 and /Od, focusing on the member example. Done means documenting the optimization requirement and its effect on class member function detouring in the README and relevant Wiki guidance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100