1

I have a video file and an exe file which only runs when both of them are in the same directory. Both video and exe files are zip compressed (.zip) and I have to write a program which would properly run exe file (and the video file it needs) without extracting them to the hard drive.

I know how to convert the contents of the zip file into streams (using dotNetZip) and run the exe file through that stream without extraction on hard (using Assembly.Load()), but I don’t know how to give the streamed video file to the exe file. Note: I don’t have access to exe file source code.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
Farzad Nozarian
  • 352
  • 2
  • 13
  • nobody can give you a real answer without dissecting the EXE and at least knowing how the EXE accesses the video file... for example: is the EXE taking a commandline param ? is the EXE capable of taking StandardInput as the source for the video file ? Is the video filename "hardcoded" in the EXE ? etc. – Yahia Sep 09 '12 at 19:30
  • possible duplicate of [Load an EXE file and run it from memory using C#](http://stackoverflow.com/questions/3553875/load-an-exe-file-and-run-it-from-memory-using-c-sharp) – Joe Sep 09 '12 at 22:32

2 Answers2

0

You can unzip 2 files into memory but still your exe will not be able to find the movie file, you can try to inject different code using reflection

MichaelT
  • 7,574
  • 8
  • 34
  • 47
0

Assuming the exe will accept the video stream as input and not just the video file - take your video stream and write it to your exe's process's StandardInput property.

If the exe does not have this capability you may have to use reflection and probe deeper into your loaded assembly to find an interface that takes a stream instead of a filename.

gordy
  • 9,360
  • 1
  • 31
  • 43