To make sure it works, u need to use dumpbin, located in the same folder as editbin. It displays information about Common Object File Format (COFF) binary files. When /largeaddressaware is enabled, the we can see extra header "Application can handle large (>2GB) addresses"
14C machine(x86)
3 number of sections
5AB8D688 time date stamp Mon Mar 26 13:16:24 2018
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
122 characteristics
Executable
Application can handle large(>2GB) addresses
32 bit word machine
if not enabled(default):
FILE HEADER VALUES
14C machine(x86)
3 number of sections
5AB8D734 time date stamp Mon Mar 26 13:19:16 2018
0 file pointer to symbol table
0 number of symbols
E0 size of optional header
102 characteristics
Executable
32 bit word machine
From cmd:
>"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\dumpbin" /headers C:\MyFile.exe
From VS post-buid event:
call "$(DevEnvDir)..\tools\vsvars32.bat"
editbin /largeaddressaware "$(TargetPath)"
dumpbin /headers "$(TargetPath)"
if there will be some errors then use your environment verion direclty:
call "$(VS100COMNTOOLS)..\tools\vsvars32.bat" // for vs 2012.
or
call "$(VS120COMNTOOLS)..\tools\vsvars32.bat" // for vs 2013.
or with conditions:
IF EXIST "%VS100COMNTOOLS%" CALL "%VS100COMNTOOLS%vsvars32.bat"
IF EXIST "%VS110COMNTOOLS%" CALL "%VS110COMNTOOLS%vsvars32.bat"
IF EXIST "%VS120COMNTOOLS%" CALL "%VS120COMNTOOLS%vsvars32.bat"
IF EXIST "%VS140COMNTOOLS%" CALL "%VS140COMNTOOLS%vsvars32.bat"
IF EXIST "%VS150COMNTOOLS%" CALL "%VS150COMNTOOLS%vsvars32.bat"
(update) VS 2017:
call "%vsappiddir%..\tools\vsdevcmd.bat"