Run executable program (.exe) from memory in Java

I want to run a program in memory on Windows. I do not want to write the file to disk. I just want to pass an array of bytes (which is the program I want to execute) as a parameter.

I am not qualified enough to write my own code for this. Again, this should be Windows native.

The program I want to execute in memory is not a Java program. This is an executable file (.exe)! The executable is designed to read and run IN MEMORY, not through Runtime.getRuntime (). Exec ("example.exe");

+4
source share
1 answer

I can not comment, otherwise I would have done it. Here you can find useful information where people are trying to solve the same problem using C ++. Pray to say if you are trying to write a program that is cross-platform or just Windows? Your use of ".exe" points to windows only.

CreateProcess from memory buffer

Theoretically, you should do this work using the Windows API calls if you are not trying to do this cross platform.

+2
source

All Articles