Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix manual hooks storing their name badly #774

Merged
merged 2 commits into from
Aug 25, 2024

Conversation

ASpoonPlaysGames
Copy link
Contributor

They weren't storing the null terminator since strlen doesn't include it. This meant that any ManualHooks were logging their name blindly and just reading random memory until they hit a null terminator.

I also moved over to just using std::string instead of doing manual allocations etc. since we are doing C++ here we have these tools why not use them.

Testing:

  1. Launch the game without the PR and observe OnCommandSubmittedHook doesn't log it's own name properly when enabled (there are also others)
  2. Launch the game with this PR and observe that this is now fixed.

@ASpoonPlaysGames ASpoonPlaysGames added needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Aug 25, 2024
@ASpoonPlaysGames
Copy link
Contributor Author

Broken log: (line 924)
nslog2024-08-25 20-15-11.txt

Copy link
Member

@EladNLG EladNLG left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at everything, changes are obvious, and make sense.

Have not tested, but i think @GeckoEidechse did

Copy link
Member

@GeckoEidechse GeckoEidechse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cannot reproduce in testing with the CI builds but I trust @ASpoonPlaysGames to have done the testing with the isolated change and so I'm signing it off together with the review by @EladNLG.

@GeckoEidechse GeckoEidechse merged commit 3e2d403 into R2Northstar:main Aug 25, 2024
5 checks passed
Copy link
Contributor

@RoyalBlue1 RoyalBlue1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good and now its more in line how c++ should be written

ASpoonPlaysGames added a commit to ASpoonPlaysGames/NorthstarLauncher that referenced this pull request Aug 26, 2024
Fix manual hooks storing their name wrong and move to just using std::string since it's much more convenient and this isn't C
ASpoonPlaysGames added a commit to ASpoonPlaysGames/NorthstarLauncher that referenced this pull request Aug 26, 2024
Fix manual hooks storing their name wrong and move to just using std::string since it's much more convenient and this isn't C
@GeckoEidechse GeckoEidechse removed needs testing Changes from the PR still need to be tested needs code review Changes from PR still need to be reviewed in code labels Aug 30, 2024
@ASpoonPlaysGames ASpoonPlaysGames deleted the fixes/hook-logging branch September 5, 2024 12:52
wolf109909 pushed a commit to R2NorthstarCN/NorthstarLauncher that referenced this pull request Sep 8, 2024
Fix manual hooks storing their name wrong and move to just using std::string since it's much more convenient and this isn't C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants