Skip to content

Add \Device\KsecDD emulation and mask 32-bit syscall arguments#2

Merged
AdvDebug merged 2 commits into
AdvDebug:mainfrom
ELJoOker2004:fix/syscall-arg-masking-ksecdd
Jun 4, 2026
Merged

Add \Device\KsecDD emulation and mask 32-bit syscall arguments#2
AdvDebug merged 2 commits into
AdvDebug:mainfrom
ELJoOker2004:fix/syscall-arg-masking-ksecdd

Conversation

@ELJoOker2004
Copy link
Copy Markdown
Contributor

  • Emulate \Device\KsecDD (RNG + memory encrypt/decrypt) so the bcrypt/CNG DllMain succeeds during Windows PE process initialization.
  • Mask ULONG syscall arguments that were read as 64-bit; some ntdll builds leave garbage in the upper 32 bits, which broke handler argument checks.

- Emulate \Device\KsecDD (RNG + memory encrypt/decrypt) so the bcrypt/CNG
  DllMain succeeds during Windows PE process initialization.
- Mask ULONG syscall arguments that were read as 64-bit; some ntdll builds
  leave garbage in the upper 32 bits, which broke handler argument checks.
@AdvDebug
Copy link
Copy Markdown
Owner

AdvDebug commented Jun 4, 2026

@codex review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9491c3ae18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Brovan/Core/Emulation/OS/Windows/Devices/KsecDevice.cs Outdated
@AdvDebug
Copy link
Copy Markdown
Owner

AdvDebug commented Jun 4, 2026

Tested it too and looks good to go. Thank you!

@AdvDebug AdvDebug merged commit 98e78cc into AdvDebug:main Jun 4, 2026
2 checks passed
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.

2 participants