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

Add new HookSwitch hook type #1500

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

Paul2803k
Copy link

@Paul2803k Paul2803k commented Oct 11, 2024

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • The reference of the new code is pointed out.

Extra tests?

  • No extra tests are needed for this PR.
  • I have added enough tests for this PR.
  • Tests will be added after some discussion and review.

Changelog?

  • This PR doesn't need to update Changelog.
  • Changelog will be updated after some proper review.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


@Paul2803k Paul2803k changed the title ✨ feature: add new HookSwitch hook type. Add new HookSwitch hook type Oct 11, 2024
@Paul2803k Paul2803k marked this pull request as ready for review October 11, 2024 19:58
@Paul2803k
Copy link
Author

Hello everyone!

While using Qiling I stumbled across an interesting use case. I needed to start recording assembly instructions from a begin memory address to an end one. The existing hook_code didn't seem to be useful as the program counter could "jump" in and out of the defined range of memory.

My idea for this use case is to add a new HookSwitch type of hook. This would essentially act as a hook that the user can switch on and off by defining 2 memory addresses. Because it behaves like the base class Hook, not many changes are required for this to work properly and it should not break any of the existing code. For what it is worth, it works great in my project :)

The name of the hook itself wasn't well thought so feel free to recommend a new one if needed, same for the documentation that I added.

Cheers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant