-
Notifications
You must be signed in to change notification settings - Fork 3
Use ntdll.dll
rather than KERNEL32.dll
to intercept windows library calls
#51
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -734,6 +734,21 @@ InvokeRequest { | |
- to be honest I don't really understand what's happening precisely and I don't want to dig further. | ||
But I'm happy to have found a solution quickly but I expect this to bite me back in the future | ||
|
||
#### NtCreateFile use flags different from the doc | ||
|
||
- doc: https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile | ||
- from the doc `NtCreateFile` is supposed to use flags such as: | ||
- FILE_GENERIC_READ: 0x00120089 | ||
- FILE_GENERIC_WRITE: 0x00120116 | ||
- FILE_READ_DATA: 0x00000001 | ||
- from the experimentations we get values such as: | ||
- open file in read only: 0x80100080 | ||
- open file in write only: 0x40100080 | ||
- this matches other known windows constants that exist are: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding some references for the future: So makes sense that these values are in different from the supposed flag values. |
||
- GENERIC_READ: 0x80000000 | ||
- GENERIC_WRITE: 0x40000000 | ||
- we will use these flags eventhough this is different from what described from the doc | ||
|
||
### Docker on Windows | ||
|
||
- Docker daemon can be started by launching Docker desktop | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
foo | ||
/ABKj | ||
8F!qT,x-p��vL^5tM.z |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this approach is not ideal as it introduces possibly out of bound reads/overflows and does not take advantage of the idea of the
UNICODE_STRING
approach.I think we should rely on
nt-string
crate to handle this conversion for us, as we will likely use this in multiple occasions when interacting with windows strings.https://colinfinck.de/posts/nt-string-the-missing-windows-string-types-for-rust/ for reference
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good advice 👍. I will look into it