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

win_injector: seperate readfile and writefile to different files #1319

Merged
merged 6 commits into from
Oct 26, 2021

Conversation

manorit2001
Copy link
Contributor

@manorit2001 manorit2001 commented Oct 22, 2021

Related #936

This is tested on Win7 x64 only

@drakvuf-jenkins
Copy link
Collaborator

Can one of the admins verify this patch?

@tklengyel
Copy link
Owner

@drakvuf-jenkins This is OK to test

@manorit2001
Copy link
Contributor Author

Hi Tamas,

Do I need to shorten the switch cases reported by codeQL or would it be fine?

@tklengyel
Copy link
Owner

CodeQL looks fine, I think it's good to merge

@tklengyel tklengyel merged commit 3fdb370 into tklengyel:master Oct 26, 2021
@manorit2001 manorit2001 deleted the readfile-refactor branch October 26, 2021 16:36
tklengyel pushed a commit that referenced this pull request May 31, 2022
* libinjector, win: Update prototypes of cleanup() helpers

Pass drakvuf as explicit argument to simplify a future commit. This
also improves consistency with the corresponding code for Linux.

* libinjector, win: Fix intermittent timeouts

After restoring the saved CPU registers, each injection method waits
for the next trap before exiting the injector loop. This means that
the target thread, continuing to execute the original program, needs
to trigger the same trap before the injector can finish. And that leads
to unpredictable waits. For example, waits of a few minutes were
observed when testing injector against explorer.exe under Windows 7
Enterprise (x64). Further, injector could wait forever in case the
target thread never revisits the trap.

The waits were introduced when refactoring injection methods in commit
3fdb370 ("win_injector: seperate readfile and writefile to
different files  (#1319)").

Fix this issue by arranging for the injector loop to exit immediately
after restoring the saved CPU registers.

* libinjector, win: Update signal number passed to drakvuf_interrupt()

Use SIGINT instead of SIGDRAKVUFERROR when the injector succeeded.
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.

3 participants