Search code examples
c#packer.net-7.0anti-piracynative-aot

Native AOT - possible to generate Map file for use with VMprotect or other tools?


Using Native AOT for some mostly console + MessageBox applications, working well (using suppression option to allow Windows Forms)

https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/

However, I need to generate MAP files to use VMprotect to its full potential.

Is there some way to enable MAP file generation in this situation?

Tried passing the /MAP:xxxx flag and it isn't supported

dotnet publish -r win-x64 -c Release /MAP:mymap.map

Maybe there is some super under the hood way to achieve this?

Are C++ compilers ever even utilized in the Native AOT build chain?


Solution

  • Issue answered here:

    https://github.com/dotnet/runtime/issues/80992

    <ItemGroup>
       <LinkerArg Include="/MAP:$(TargetName).map" />
    </ItemGroup>