evildictaitor wrote:

Get your native entry points to look at the calling assembly's file, take a hash and compare it to your code, and do useful things only if there's a match.


That's trivial to bypass. It is fundamentally impossible to verify the caller of a function, no amount of engineering a solution will rectify this.