1

I'm looking to programmatically run through an installation disc and set the compatibility mode for hundreds of exe's & msi's. But I've run into a snag.

For files not on ROM the registry key created is:

HKCU\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers
D:\MyDirectory\MyFile.exe   REG_SZ   ~ WIN7RTM

But for files on ROM like a DVD or CD the registry key created is:

HKCU\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers
SIGN.MEDIA=<SomeHexValue> <LocalPath>   REG_SZ   ~ WIN7RTM

I'm looking to find out how the "SomeHexValue" is calculated. There is one archived post at msdn where it is suggested that the hex value is based on file size (then later retracted). But that is not the case for me on Server2019 or Server2016 as two different files with different names and sizes have the same hex value.

Anybody have an ideas here? I'm currently thinking is has something to do with the local path. Am hoping someone has run into this before. Pickings on the net seem very slim.

chrismec
  • 123
  • 5
  • Been doing some additional testing on Windows 10. does seem to be consistent across windows platforms. It doesnt appear to be path related at all. The above msdn link is closer I think. I created some dummy exe's on a windows 10 machine and found some interesting results. These files are not executables at all but text files containing characters renamed to exe. It seems the SIGN.MEDIA hex value is a signature of the file length and the name. I'm working on deciphering the algorithm used. Next comment show the result of the test files. – chrismec Sep 24 '20 at 12:06
  • Filename, Content, SIGN.MEDIA Value; "a.exe", 0, 7F; "a.exe", 00, 1F; "a.exe", 000, 3F; "a.exe", 0000, DF; "1.exe", 0, DF; "a.exe", 1111, DF **Line breaks do not seem to work for comments... – chrismec Sep 24 '20 at 12:16

0 Answers0