fix: resolve cflow null-targets, KeepOldMaxStack, and enable cross-platform .NET Framework builds - #33
Conversation
…atform .NET Framework builds
0a5c4e7 to
5df9406
Compare
I'm not convinced of this claim. It might eliminate warnings, especially for bogus methods that would never be executed anyway, but I can't help but wonder if the original check was introduced for a reason. Some specific deobfuscators might change the stack depth during deobfuscation passes, which would cause breakage if So it's "eliminate warnings" vs. "correctness in methods that may actually matter". I don't have concrete samples where the latter actually comes into play, though. Testability and regressions is quite a problem in this project. |
|
Here's an example where the code base explicitly depends on MaxStack calculation: |
|
thank you for the feedback, i have removed it, what about the rest? |
Looks good, thank you! |
Summary
This PR addresses critical deobfuscator engine stability issues and integrates support for compiling legacy
.NET Framework 4.8targets natively on cross-platform systems (macOS and Linux).These are high-priority, zero-side-effect bug fixes and compilation enhancements that significantly improve reliability.
Key Changes
Control Flow Emulator Safeguard (
BlockCflowDeobfuscator.cs):Global
KeepOldMaxStackSave Optimization (ObfuscatedFile.cs):MetadataFlags.KeepOldMaxStackduring saving. This bypasses the heavy, compiler-level stack-depth estimation and recalculation steps, which are prone to crashing on heavily obfuscated assemblies.In-Process Invocation Accessibility (
de4dot.cui/Program.cs):class Programinsidede4dot.cuitopublic class Programso that other projects can call itsMainmethod in-process.Cross-Platform .NET Framework Builds (
De4DotCommon.props):Microsoft.NETFramework.ReferenceAssembliesfor all .NET Framework builds, enabling standard .NET SDKs on macOS and Linux to compile thenet48solution natively.<SelfContained>property to only apply on non-framework builds, resolving the fatal build RID-check errorNETSDK1032on ARM64 hosts.