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

Improve clipboard rules #763

Merged
merged 2 commits into from
Jun 12, 2023
Merged

Improve clipboard rules #763

merged 2 commits into from
Jun 12, 2023

Conversation

mr-tz
Copy link
Collaborator

@mr-tz mr-tz commented May 26, 2023

closes #293

Lastly, we might consider consolidating the replace-clipboard-data and write-clipboard-data rules. The replace rule includes user32.EmptyClipboard but I wonder if user32.SetClipboardData would overwrite data existing data that wasn't emptied. The EmptyClipboard API could be optional in the write-clipboard-data rule.

@mr-tz mr-tz requested a review from mwilliams31 May 30, 2023 07:12
@mwilliams31
Copy link
Collaborator

@mr-tz any merit to the following aspect of #293? I'm curious what your take on the suggestion is.

Both formats are represented in the existing rule examples. Using these formats, the rule could become a basic block component of a larger function rule. The new rule could also incorporate the loop characteristic to target the read operation.

@mr-tz
Copy link
Collaborator Author

mr-tz commented Jun 1, 2023

The read clipboard rule includes, we could add a basic block scope to tie them closer together. And add match: contain loop.

        - and:
          - api: user32.GetClipboardData
          - optional:
            - number: 0x1 = CF_TEXT
            - number: 0x7 = CF_OEMTEXT
            - number: 0xD = CF_UNICODETEXT

For the write I think we're fine without the specific types.

How does that sound?

@mwilliams31
Copy link
Collaborator

Ahh, I didn't realize those formats were added in a previous commit. I'll defer to you on the basic block and loop modifications. Thanks for taking a closer look at these rules!

@mr-tz
Copy link
Collaborator Author

mr-tz commented Jun 12, 2023

Thanks @mwilliams31, all updated per you suggestions.

@mr-tz mr-tz merged commit 62598dd into master Jun 12, 2023
@mr-tz mr-tz deleted the rules52-21 branch June 12, 2023 12:27
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.

Improvements for clipboard rules
3 participants