Valhalla Legends Forums Archive | General Programming | Run a file from memory?

AuthorMessageTime
l2k-Shadow
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?
August 19, 2007, 3:57 AM
rabbit
By writing it to a file.
August 19, 2007, 5:12 AM
Camel
Make a function pointer to the entry point and call it?
August 19, 2007, 6:00 AM
l2k-Shadow
[quote author=Camel link=topic=16963.msg171706#msg171706 date=1187503234]
Make a function pointer to the entry point and call it?
[/quote]

yeah well that wouldn't work if you use other segments of the file other than the code segment, would it.
August 19, 2007, 6:24 AM
iago
[quote author=l2k-Shadow link=topic=16963.msg171707#msg171707 date=1187504651]
[quote author=Camel link=topic=16963.msg171706#msg171706 date=1187503234]
Make a function pointer to the entry point and call it?
[/quote]

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

Wow, is it really necessary to be an asshole when somebody tries to help?
August 19, 2007, 3:17 PM
Myndfyr
This might be a related or relevant topic.
August 20, 2007, 2:27 AM

Search