把.com文件读取出来进行修改
才学汇编,想自己做个程序,然后修改修改,但是c#下不知道怎么操作。求代码。
FileStream fs = File.Open(@"C:\MASM611\SHI.COM", FileMode.Open, FileAccess.ReadWrite);
byte[] everybit = new byte[Convert.ToInt32(fs.Length)];
fs.Read(everybit, 0, Convert.ToInt32( fs.Length));
foreach (byte b in everybit)
{
Console.Write(b.ToString("x"));
Console.Write(" ");
}
Console.Read();
//everybit[1] = Convert.ToByte(ba,16);
fs.Close();
初步想到的,代码到这里卡住了,不会放回去....
有类似的源代码不?让我参考参考。 --------------------编程问答-------------------- .com 文件能操作吗? --------------------编程问答-------------------- File.WriteBytes(@"C:\MASM611\SHI.COM", everybit);
读文件的stream关闭后再写 --------------------编程问答--------------------
mark --------------------编程问答--------------------
FileStream fs = File.Open(@"C:\MASM611\SHI.COM", FileMode.Open, FileAccess.ReadWrite);--------------------编程问答-------------------- com
==>
FileStream fs = File.OpenRead(@"C:\MASM611\SHI.COM");
直接用debug改
debug 使用方法
http://www.angelfire.com/wizard/robbiemosaic/interests/pwindows/msdos_functional/debug.htm --------------------编程问答--------------------
补充:.NET技术 , C#