Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.io.RandomAccessFile;
- import com.sun.jna.Library;
- import com.sun.jna.Native;
- public final class RunPETest {
- public interface RunPE extends Library {
- public boolean Run(byte[] exeBuffer, String hostProcess);
- }
- public static void main(String[] args) throws Exception {
- System.loadLibrary("RunPE");
- RunPE pe = (RunPE) Native.loadLibrary("RunPE.dll", RunPE.class);
- pe.Run(getBytes("messenger.exe"), "messenger.exe");
- }
- private static byte[] getBytes(String file) throws IOException {
- RandomAccessFile raf = new RandomAccessFile(file, "rw");
- byte[] bytes = new byte[(int) raf.length()];
- raf.read(bytes);
- raf.close();
- return bytes;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement