c++visual-studio-2013windows-7gflags

gflags does not flag any binary


I'm trying to run gflags x64 on my Release x64 binary built by Visual Studio 2013 to detect access violations.

I downloaded Windows Debugging Tools from Microsoft website.
I added C:\Program Files (x86)\Windows Kits\10\Debuggers\x64 to my PATH environment variable, gflags and windbg are found in Windows prompt.

Edit: Added already tried commands

I tried to flag with following commands:
gflags /p /enable D:\MyBinary.exe /full /protect
gflags /p /enable D:\MyBinary.exe
gflags /p /enable MyBinary.exe /full /protect
gflags /p /enable -i MyBinary.exe /full /protect
gflags /p /enable /i MyBinary.exe /full /protect
gflags -p -enable -i MyBinary.exe -full -protect

then I want to check if binary is properly flagged with
gflags /p

MyBinary.exe is not listed, gflags /p displays nothing.

I retried by disabling UAC to see if it's different, no better result.
I also tried to flag another binary (notepad++.exe), still no flagging.

What's wrong with my commands ?


Solution

  • In an Administrator prompt, this command is working:
    D:\>gflags /p /enable MyBinary.exe /full /protect path: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options mybinary.exe: page heap enabled