Archived

This topic is now archived and is closed to further replies.

Brobanx

How did they do it?

Recommended Posts

I''ve recently stepped into the realms of the Virtual Machine just as an experiment. Then I remembered back when I was coding MODs for Quake3. The code could either be compiled as a .dll, or as .vm (code used by the quake3 virtual machine). While using a .dll worked, almost all mods were released in their .vm forms, because according to id software, this prevents the mod from doing anything malicious to your comp, like wiping the hard-drive. They obviously have a very complex virtual machine working in there, considering it could compile C code. My question is, to all who have worked with virtual machines, how would they (or maybe is was just carmack) have programmed a virtual machine that can both be complex enough to allow almost all working C code, yet still know which code was dangerous, and which wasn''t? I imagine it would be very hard to detect mis-managed pointers on their own, especially in a virtual machine... or perhaps it just eliminates calls to delete files. any insight would be very appreciated.

Share this post


Link to post
Share on other sites
I dont know the Quake 3 Virtual machine, but i suppose they just didnt expose any dangerous methods to the programs running on the virtual machine.
So you might be without any methods for writing to files for example.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Pretty much what Ziphnor said. They selected a subset of the features that could not access any critical data. That makes it 100% safe (well, very close).

Anyways, a very nice concept.

Share this post


Link to post
Share on other sites