CreateFiledwDesiredAccess is weird. Qiling supports GENERIC_READ and GENERIC_WRITE, but CreateFile natively uses FILE_READ_DATA and FILE_WRITE_DATA (Generic Access Rights). This PR doesn't translate the GENERIC_* values to specific file access rights (Qiling doesn't have all of the involved constants), but it does allow Qiling to recognize the FILE_* rights.
Do you know about winmd files? It should be possible to dump constants and generate hook method stubs from the definitions in the winmd files. https://github.com/microsoft/win32metadata
Checklist
Which kind of PR do you create?
[x] This PR only contains minor fixes.
[ ] This PR contains major feature update.
[ ] This PR introduces a new function/api for Qiling Framework.
Coding convention?
[x] The new code conforms to Qiling Framework naming convention.
[x] The imports are arranged properly.
[x] Essential comments are added.
[x] 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.
CreateFile
dwDesiredAccess
is weird. Qiling supportsGENERIC_READ
andGENERIC_WRITE
, butCreateFile
natively usesFILE_READ_DATA
andFILE_WRITE_DATA
(Generic Access Rights). This PR doesn't translate theGENERIC_*
values to specific file access rights (Qiling doesn't have all of the involved constants), but it does allow Qiling to recognize theFILE_*
rights.Do you know about winmd files? It should be possible to dump constants and generate hook method stubs from the definitions in the winmd files. https://github.com/microsoft/win32metadata
Checklist
Which kind of PR do you create?
Coding convention?
Extra tests?
Changelog?
Target branch?
One last thing