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

Fix __CreateFile implmentation to include access mask and creation disposition #1309

Merged
merged 3 commits into from Feb 28, 2023

Conversation

kbsec
Copy link

@kbsec kbsec commented Feb 6, 2023

Checklist

Which kind of PR do you create?

  • This PR only contains minor fixes.
  • This PR contains major feature update.
  • This PR introduces a new function/api for Qiling Framework.

Coding convention?

  • The new code conforms to Qiling Framework naming convention.
  • The imports are arranged properly.
  • Essential comments are added.
  • 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.
  • Changelog has been updated in my PR.

Target branch?

  • The target branch is dev branch.

One last thing


The current implementation of _CreateFile for emulating the kernel32.dll$CreateFile functions does not properly use the dwCreationDisposition flags or the access mask. This pr does not fully fix the issue, but _CreateFile now properly handles most access masks, and creation dispositions. The notable exception is GENERIC_WRITE, with no truncation and no create new file will return a handle that is writable. This is consistent with the current implementation, and while a bug, is likely only fixable by using os.open instead of open.

@kbsec kbsec changed the title Dev Fix __CreateFile implmentation to include access mask and creation disposition Feb 6, 2023
@xwings xwings merged commit 2f5ae46 into qilingframework:dev Feb 28, 2023
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

4 participants