3 ms·
True that this is annoying, but there is a solution. https://stackoverflow.com/a/25986612/82294 https://stackoverflow.com/a/25986612/82294
by dietrichepp 6y ago
True that this is annoying, but there is a solution. https://stackoverflow.com/a/25986612/82294 https://stackoverflow.com/a/25986612/82294
- gruez 6y agoNow we just have to wait until that method gets abused enough by devs and microsoft ends up spoofing that too.
- derefr 6y agoThere's an ultimate future-proof solution, though: just generate, in a loop, a series of assemblies that each purport compatibility with Windows ABI vX.Y.Z; spawn those in a separate process; and get them to return what version of Windows they perceive. Once the number stops going up, that's the version you're on. No real way to get around that without misinforming fresh, valid applications.
- cesarb 6y ago> just generate, in a loop, a series of assemblies that each purport compatibility with Windows ABI vX.Y.Z The Microsoft developers already thought of that trick. What you declare is not compatibility with "Windows ABI vX.Y.Z"; you declare compatibility with an UUID which represents that Windows version. That is, if you're compatible with Windows 8 you say "I'm compatible with 4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38", if you're compatible with Windows 8.1 you say "I'm compatible with 1f676c76-80e1-4239-95bb-83d0f6d0da78", and so on. Since you cannot predict the UUID for future Windows versions, you cannot pretend to be compatible with them.
- LambdaComplex 6y ago> Since you cannot predict the UUID for future Windows versions, you cannot pretend to be compatible with them. Until a clueless product manager tells you to just iterate through all possible UUIDs to check :)
- anonexpat 6y agoIf I had a dollar every time I had to explain this to a PM or a CISO (!!)...
- flingo 6y agoIs there any API you can go through to get the UUID of the current ABI, all the ones seen by the system, or all of the ones for each windows ABI without network access? Trivially, you grab the UUIDs from a server somewhere. A smarter trick is to get these UUIDs from the system you're running on.
- asveikau 6y agoThere used to be some configurations that had kernelbase.dll but not kernel32. (Windows phone used to be like that, maybe windows on arm?) I would consider checking for ntdll instead of kernel32. (Or kernelbase if kernel32 gets file not found.)