How to determine the OS (linux or windows) just by using assembly? (x86)

Viewed 161

I want to see if its possible to determine the OS just by using assembly

the only related question i found was this : What are techniques for determining running OS in assembly language at runtime?

but it doesn't really answer it. they are saying there is likely no way to do it but i doubt it, there has to a be way considering how vast the x86 architecture is (like looking at special register values, using some barely known x86 instructions and so on)

basically lets say you can write an assembly code, but don't know in advance which operating system it is going to get executed on (an application in that OS will jump to this blob of binary code)

now you need to detect whether its a Windows operating system or Linux, just in assembly (x86), how will you do it? the trick is to do it in a way that reduces the possibility of crashing as much as possible.

(Please don't ask why wouldn't you know the OS your code is executing on, its not part of the question, just assume you are in a situation that you just don't know)

0 Answers
Related