I am developing a C# program that will load files and get information such as loaded file created date, modification date, size etc. Another thing that I need to know is whether the loaded file (executable.exe
) is linked with the LARGEADDRESSAWARE
flag. The FileInfo class doesn't provide this information.
Does anyone know how in C# can I find out whether a given executable.exe is linked with the LARGEADDRESSAWARE
flag (to handle addresses larger than 2 GB)?
Here is some code that checks for the Large Address Aware flag. All you have to do is pass a stream that is pointed to the start of an executable.
From Will's answer above I'm using the following in my x86 setup package:
The MSDN documentation for
/LARGEADDRESSAWARE
states:If you're looking for a way to do this programatically, you could invoke dumpbin from your application and parse the output.
Update:
There is also a good blog post here that discusses the issue in more depth.