Execute an incbin'd app?

BlitzMax Forums/BlitzMax Programming/Execute an incbin'd app?

ImaginaryHuman(Posted 2010) [#1]
Is it possible to execute an application which has been incbin'd? On both windows and mac?


plash(Posted 2010) [#2]
From memory? Probably. I would avoid doing this though (I can only imagine what anti-virus software might do).

Safest to save to disk before attempting execution.


Dreamora(Posted 2010) [#3]
Nope its not possible to execute it from incbin / memory.

modern cpus don't allow code execution from "data memory" and incbin stuff is datamemory.
you would need to save it out to disk and execute from there


N(Posted 2010) [#4]
modern cpus don't allow code execution from "data memory" and incbin stuff is datamemory.
Couldn't he just copy it, map it as executable, and work from there, then? At any rate, I suspect you're wrong about this, to some degree.


Dreamora(Posted 2010) [#5]
potentially you could through some way.
But by just loading it it would be impossible unless its some stoneage os or substandard os where stuff like the nx execution flags etc are not supported


Zethrax(Posted 2010) [#6]
Here's some links with info on Data Execution Prevention, in any case. I haven't taken a good look at the info, so I don't know how relevant it is to what you're trying to do.

http://en.wikipedia.org/wiki/Data_Execution_Prevention

http://www.google.com/search?client=opera&rls=en&q=data+execution+protection&sourceid=opera&ie=utf-8&oe=utf-8


ImaginaryHuman(Posted 2010) [#7]
I wondered as much. Thanks for the info, gents. It was easier in the old days, you could just point any piece of code at the CPU and it'd run. But these are the days of `protection` ;-)

The idea of writing the file out to disk and then executing it is interesting, but I think probably a bit `unclean` for what I want to do (ie have only one file for the whole system, comprising 2 or 3 executables).


Czar Flavius(Posted 2010) [#8]
You could always delete them quickly afterwards :P


Luke111(Posted 2010) [#9]
I get the impression that this is a potentially dangerous subject.


Czar Flavius(Posted 2010) [#10]
Well it won't set your computer on fire, if that's what you mean.


Dreamora(Posted 2010) [#11]
Yeah?
Thats what the developer of Win95.CIH said too before the smoke on the Win98 machines spread from the tower ... ;)


xlsior(Posted 2010) [#12]
It'll be hard to come up with a way that works on all systems:

- Data Execution Prevention is enabled by default on windows vista & windows 7, which will prevent your program from just pointing to a piece of ram and tell it to run it from there
- Windows Vista and Windows 7 User Access Controls could prevent your program from dropping additional .exe's into the program folder post install time
- Many antivirus programs (Like McAfee) are very suspicious of executables launching from the windows temp folder