Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added module reloading API and CLI interface#243

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
calebstewart wants to merge2 commits intomaster
base:master
Choose a base branch
Loading
fromfeature/241/support-reloading-modules

Conversation

@calebstewart
Copy link
Owner

Description of Changes

This PR adds the ability to reload pwncat modules at runtime. This is facilitated through the addition of a new flag for theManager.load_modules method, which now takes aforce keyword argument, which forces reloading of previously loaded modules. Further, there is now a newManager.reload_module method which accepts either a module instance or a module name to be reloaded specifically. Bothload_modules andreload_module methods will also attempt to fix the current module context if a module is being reloaded, and reset any module configurations, which could fail if the module arguments have changed during reload. If a module-specific configuration fails to apply after reloading the module (likely because the module arguments changed on disk), a warning is printed and that configuration is lost.

Lastly, this PR adds new arguments to two pwncat commands:load andrun. First, theload command now as either--force/-f or--reload/-r arguments. These are synonyms which force a reload of modules during loading (through the force argument ofManager.load_modules). Second, therun command now accepts a--reload/-r argument which forces the selected module to be reloaded viaManager.reload_module prior to execution, which should be useful when debugging a new module (or a misbehaving old module).

Fixes#241.

Please note anynoqa: comments needed to appease flake8.

Major Changes Implemented:

  • Addedforce argument toManager.load_modules to enable reloading modules.
  • Added theManager.reload_module method to reload a specific module.
  • Added--force/-f and--reload/-r arguments to theload command (#241).
  • Added the--reload/-r argument to therun command to reload modules prior to executing.

Pre-Merge Tasks

  • Formatted all modified files w/python-black
  • Sorted imports for modified files w/isort
  • Ranflake8 on repo, and fixed any new problems w/ modified files
  • Ranpytest test cases
  • Added brief summary of updates to CHANGELOG (under[Unreleased])

For issues with pre-merge tasks, see CONTRIBUTING.md

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support reloading of custom modules using "reload"

2 participants

@calebstewart

[8]ページ先頭

©2009-2025 Movatter.jp