pwntools icon indicating copy to clipboard operation
pwntools copied to clipboard

feat: add libc `__exit_funcs` utility class

Open hannahfluch opened this issue 3 months ago • 0 comments

closes #2633

Pwntools Pull Request

Thanks for contributing to Pwntools! Take a moment to look at CONTRIBUTING.md to make sure you're familiar with Pwntools development.

Please provide a high-level explanation of what this pull request is for.

WIP!

Adding a utility class for glibc's __exit_funcs. This can be helpful when promoting an arbitrary write and read to RCE.

See this resource for more info. A lot of exploits just use the CxaFunc and ExitHandler class shown here, so it would make sense to have the functionality in pwntools as well.

TODO

  • [ ] documentation
  • [ ] compliance with older glibc versions
  • [ ] exit handler class

Testing

Pull Requests that introduce new code should try to add doctests for that code. See TESTING.md for more information.

Target Branch

Depending on what the PR is for, it needs to target a different branch.

You can always change the branch after you create the PR if it's against the wrong branch.

Branch Type of PR
dev New features, and enhancements
dev Documentation fixes and new tests
stable Bug fixes that affect the current stable branch
beta Bug fixes that affect the current beta branch, but not stable
dev Bug fixes for code that has never been released

Changelog

After creating your Pull Request, please add and push a commit that updates the changelog for the appropriate branch.
You can look at the existing changelog for examples of how to do this.

hannahfluch avatar Oct 11 '25 13:10 hannahfluch