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

Replaced sleeps with an event #2

Merged
merged 1 commit into from
Feb 11, 2021
Merged

Conversation

mihaly044
Copy link

Description of the problem I am trying to fix:
The original implementation suspends execution for a fixed amount of time in order to simulate waiting for the FakeDispatchRoutine to finish:

Sleep(1000);
supOpenDriver((LPWSTR)PROCEXP152, GENERIC_READ| GENERIC_WRITE, &victimDeviceHandle);
Sleep(1000);

There may be edge cases in which the execution of the fake dispatch routine does not finish in time.
When the execution does not finish in time, KDU would falsely report success before knowing our dispatch routine has finished.
Such behavior might be caused by other external software like anti-viruses suspending threads or slowing down the computer in other means.

My proposed solution:
Create a waitable event in usermode with CreateEvent, wait for it to get signaled using WaitForSingleObject and finally fire this event from the fake dispatch routine using KeSetEvent.

@hfiref0x hfiref0x merged commit f217e4a into hfiref0x:master Feb 11, 2021
hfiref0x added a commit that referenced this pull request Feb 11, 2021
Update Feb 2021.
Pull request #2 compiled variant, rtls update.
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.

None yet

2 participants