dotnet running exe file in a stream memory,possible?


I am now working a project need to read exe file into memory(buffer) and then running it in memory directly,is that possible to do it via maxscript?
I found an example for c#

After I searched forum,I found this code wolud work for read exe file into memory stream,for example,running notepad in buffer:

exe_path = "C:\\Windows\
exe_stream = (dotNetClass "").open exe_path (dotnetClass "").open
exe_buffer = dotnetobject "System.Byte[]" 200000
exe_read = (exe_stream.GetType()).GetMethod "Read"
exe_read.invoke exe_stream #(exe_buffer, 0, exe_buffer.Length)
--then here, how to run exe directly in the buffer?



This is possible, but only if the exe you want to run is an actual .net exe. This means it won’t work with notepad.exe for instance. It’s a bit elaborate so I’ve written an article on my blog about it. Go check it out:


Thanks for take too much time to answer this question,this article help me a lot!!!