Tip: Binary Strings (WMI, NVidia)

I had to solve a problem reading monitor EDID values from the NVidia WMI provider and found it difficult to parse the results into readable / comparable values.

q: (properties "EDID" of it as string) of select objects "* from Display" of wmis "ROOT\CIMV2\NV"
A: EDID=＀ÿ감Fㅌ䠸ᤉЁ㒵砠ᴺ껵㕏△倍ꕔK肁䂩Ñ佱āāāā㰨ꂀ끰䀣‰6䐆!ᨀ%00＀夀䝙乃㈵䡐ㄸੌ%00ﰀ䐀䱅⁌㉕ㄴਲ਼†%00ﴀ㠀Ṍᅑ਀†††⨁̂遐Ѕȃᘇἁጒ—ᄕ⌆Ἁ茇%01Ȁ耺焘ⴸ塀䔬؀⅄%00Ğ耝焘ᘜ堠┬؀⅄%00ƞ%1d兲Ố渠唨؀⅄%00谞퀊₊ⷠတ阾؀⅄%00%18%00%00%00%00%00%00%00%00%00%00%00%00ऀ
A: EDID=＀ÿ감F䭌䠷ᤉЁ㒵砠ᴺ껵㕏△倍ꕔK肁䂩Ñ佱āāāā㰨ꂀ끰䀣‰6䐆!ᨀ%00＀夀䝙乃㈵䡐䬷ੌ%00ﰀ䐀䱅⁌㉕ㄴਲ਼†%00ﴀ㠀Ṍᅑ਀†††̂遐Ѕȃᘇἁጒ—ᄕ⌆Ἁ茇%01Ȁ耺焘ⴸ塀䔬؀⅄%00Ğ耝焘ᘜ堠┬؀⅄%00ƞ%1d兲Ố渠唨؀⅄%00谞퀊₊ⷠတ阾؀⅄%00%18%00%00%00%00%00%00%00%00%00%00%00%00ऀ
T: 8.914 ms
I: plural string

After much searching topics in this forum and at developer.bigfix.com, I went through all sorts of “binary_string” casts without success. Eventually the simplest form I came up with that’s usable is

q:  (following texts of firsts "=" of (selects "EDID from Display" of wmis "ROOT\CIMV2\NV" as string) as binary_string) as hexadecimal
A: 00ffffffffffff0010ac46f04c31384809190104b53420783a1df5ae4f35b3250d5054a54b008180a940d100714f0101010101010101283c80a070b023403020360006442100001a000000ff00595947434e3532504838314c0a000000fc0044454c4c2055323431330a2020000000fd00384c1e5111000a202020202020012a02031df15090050403020716011f1213142015110623091f0783010000023a801871382d40582c450006442100001e011d8018711c1620582c250006442100009e011d007251d01e206e28550006442100001e8c0ad08a20e02d10103e9600064421000018000000000000000000000000000000000000000000000000000009
A: 00ffffffffffff0010ac46f04c4b374809190104b53420783a1df5ae4f35b3250d5054a54b008180a940d100714f0101010101010101283c80a070b023403020360006442100001a000000ff00595947434e35325048374b4c0a000000fc0044454c4c2055323431330a2020000000fd00384c1e5111000a20202020202001f802031df15090050403020716011f1213142015110623091f0783010000023a801871382d40582c450006442100001e011d8018711c1620582c250006442100009e011d007251d01e206e28550006442100001e8c0ad08a20e02d10103e9600064421000018000000000000000000000000000000000000000000000000000009

This meets my needs and is comparable to the values as they are stored in the registry. Hope this helps someone in the future.

2 Likes

To follow-up with my intended usage, what I’m doing is using the NVidia WMI providers and scripts to “lock” the EDID for connected monitors. With two NVidia cards and up to 8 monitors attached, we are finding some serious performance / freezing issues when the NVidia card chokes on detecting the attached monitors. The workaround we have is to lock the EDID data to disable NVidia’s auto-detection.

This involves using the NVidia sample script “setEDID.ps1” to detect the attached monitors, export their EDID data, and then import that on the video card as a “forced” EDID value.

The Relevance I have now, scans the currently-attached monitors using the NVWMI provider, and finds any that are not present in the EDIDLockData registry key where the NVidia driver stores it:

q: exists ( (following texts of firsts "=" of (selects "EDID from Display" of wmis "ROOT\CIMV2\NV" as string) as binary_string) as hexadecimal as string) whose (it is not contained by value "EDIDLockData" of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\DisplayDatabase" of registry as string) 
A: True
T: 7.683 ms
I: singular boolean

q:  unique values of ( (following texts of firsts "=" of (selects "EDID from Display" of wmis "ROOT\CIMV2\NV" as string) as binary_string) as hexadecimal as string) whose (it is not contained by value "EDIDLockData" of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\nvlddmkm\DisplayDatabase" of registry as string) 
A: 00ffffffffffff0010ac46f04c4b374809190104b53420783a1df5ae4f35b3250d5054a54b008180a940d100714f0101010101010101283c80a070b023403020360006442100001a000000ff00595947434e35325048374b4c0a000000fc0044454c4c2055323431330a2020000000fd00384c1e5111000a20202020202001f802031df15090050403020716011f1213142015110623091f0783010000023a801871382d40582c450006442100001e011d8018711c1620582c250006442100009e011d007251d01e206e28550006442100001e8c0ad08a20e02d10103e9600064421000018000000000000000000000000000000000000000000000000000009
T: 538.269 ms
I: plural string with multiplicity

per https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#EDID_1.4_data_format, part of the EDID data presented by the monitor should represent the monitor’s Serial Number. A monitor serial number not found in the registry should, I think, be enough to tell me that a monitor is missing from my forced EDID list.

1 Like