Valhalla Legends Archive

Programming => General Programming => Topic started by: l2k-Shadow on August 18, 2007, 10:57 PM

Title: Run a file from memory?
Post by: l2k-Shadow on August 18, 2007, 10:57 PM
let's say i have a buffer that holds the contents of an executable... what would be the best way to map that buffer inside memory and run the exe which it holds, without writing it to a file?
Title: Re: Run a file from memory?
Post by: rabbit on August 19, 2007, 12:12 AM
By writing it to a file.
Title: Re: Run a file from memory?
Post by: Camel on August 19, 2007, 01:00 AM
Make a function pointer to the entry point and call it?
Title: Re: Run a file from memory?
Post by: l2k-Shadow on August 19, 2007, 01:24 AM
Quote from: Camel on August 19, 2007, 01:00 AM
Make a function pointer to the entry point and call it?

yeah well that wouldn't work if you use other segments of the file other than the code segment, would it.
Title: Re: Run a file from memory?
Post by: iago on August 19, 2007, 10:17 AM
Quote from: l2k-Shadow on August 19, 2007, 01:24 AM
Quote from: Camel on August 19, 2007, 01:00 AM
Make a function pointer to the entry point and call it?

yeah well that wouldn't work if you use other segments of the file other than the code segment, would it.

Wow, is it really necessary to be an asshole when somebody tries to help?
Title: Re: Run a file from memory?
Post by: MyndFyre on August 19, 2007, 09:27 PM
This (http://forum.valhallalegends.com/index.php?topic=15579.0) might be a related or relevant topic.