c# - readbytes of a file and running it -
i have 2 .net files ! once c#.net , 1 vb.net :)
now want read bytes of , running :)
dim mybyte byte() = system.io.file.readallbytes("e:\projects\expired.exe") system.reflection.assembly.load(mybyte)
could not load file or assembly '8192 bytes loaded mybyte
you have read file, stuffs (decrypt?), write content new file , run it. (you can embed file in project resources if want):
// read file content project resources byte[] filecontent = myproject.properties.resources.myfile; // <do stuffs file content here> // write new file content temp file string tempfile = "yourfile.exe"; file.writeallbytes(tempfile , filecontent ); // run app process proc = process.start(new processstartinfo(tempfile));
Comments
Post a Comment