microsoft / microsoft/Detours

Improve failure mode if `DetourCreateProcessWithDllEx` is supplied with a DLL of wrong bitness

Open
#224 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
6.4k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
When using DetourCreateProcessWithDllEx from a 32-bit process to create a new process, while pointing lpDllName at a 64-bit DLL, strange failures occur.

I assumed that, because DetourCreateProcessWithDllEx auto-chooses the correct bitness for injection, I'd be safe to always pass the 64-bit DLL name into it.
However, that's not true (and a close read of the documentation confirms this).
Still, it would be great to either warn in the documentation about this, and/or improve the handling of this in DetourCreateProcessWithDllEx - either also auto-choose the correct bitness if parent-bitness==child-bitness, or return an error.

Detours version
https://github.com/microsoft/Detours/commit/66d6f2d34aba564d373083621cacf66ec51199b2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names DetourCreateProcessWithDllEx and its lpDllName input; begin by reading the API documentation and implementation to confirm the bitness-selection behavior. Decide whether the accepted outcome is a documentation warning, automatic selection, or an explicit error, then define completion around that choice and validate the wrong-bitness case.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.