Calling DetourCreateProcessWithDllsW crashes .NET applications compiled for Any-CPU
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 6.4k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Detour version: 4.0.1
I am using Detours to create new processes with a DLL loaded via DetourCreateProcessWithDlls() API. However, there is a specific .NET application that crashes shortly after launch. This application is using .NET Framework 2.0 and ClickOnce deployment model. It was compiled with Any CPU option and contains PE32 magic header while running as a 64 bit process on 64 bit CPU.
Has anyone experienced anything like this before? The application in question is proprietary ScreenConnect client and I do not have source code for it. I tried building a sample C# application using similar parameters but it did not crash.
Crash error
Faulting application name: ScreenConnect.WindowsClient.exe, version: 23.6.8.8644, time stamp: 0xf76f9523
Faulting module name: KERNELBASE.dll, version: 10.0.22621.2215, time stamp: 0x83983b0b
Exception code: 0xe0434352
Fault offset: 0x000000000006531c
Faulting process id: 0x0x164C
Faulting application start time: 0x0x1D9FA43E200E298
Faulting application path: C:\Users\mpak\AppData\Local\Apps\2.0\AA1N2LCV.23C\6HZ4P8A6.L92\scre..tion_25b0fbb6ef7eb094_0017.0006_f4fdb97c32013242\ScreenConnect.WindowsClient.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: fcad11ba-4ed5-4239-ad48-7cf640691c03
Faulting package full name:
Faulting package-relative application ID:
Additional context
I have also enabled DETOUR_TRACE macro and attaching the output here
detour_crash.log
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DetourCreateProcessWithDllsW entry point and review the attached detour_crash.log alongside the reported Any-CPU, PE32, ClickOnce, and .NET Framework 2.0 conditions. Reproduce the crash with a comparable application if possible; done would require identifying a reproducible Detours failure and a test or documented case that distinguishes it from the proprietary ScreenConnect application.
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
- Needs clarification
- Newbie friendliness
- 25/100