Is there any fundamental way to protect people from doing this sort of thing by designing your game code in a certain way?
The only sane method is to keep critical pieces of the code on servers you control and never give it to the users' computers at all. The hard part is making this square with keeping the game fast enough to be playable.