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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -