In any case, doing this to an API is just plain nasty... but I believe at least under European law it's still getting trumped by the right to interoperability and reverse engineering.
And the Hackintosh equivalent was dsmos.kext. Which would "inject" the required system calls to trick OSX into running on non Apple hardware.
[1] https://www.folklore.org/StoryView.py?project=Macintosh&stor...
Another interesting case was, Nintendo released a floppy disk with their logo relief and use its presence for DRM purpose. When third party released a compatible floppy disk, Nintendo sued them for trademark violation. Nintendo lost.
> "Do you byte, when I knock?"
After uploading, the host computer would send an "unlock request" with the string "LEGO®", at which point the RCX would return the other half of the rhyme:
> "Just a bit off the block!"
I assume the only reason for jumping through these hoops was to have a legal excuse to discourage other companies from making interoperable products. I have no idea whether this strategy would have actually held up in court; in any case, there were plenty of homebrew tools that just embedded the magic strings anyway.