博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
c# 对加密的MP4文件进行解密
阅读量:4317 次
发布时间:2019-06-06

本文共 1852 字,大约阅读时间需要 6 分钟。

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.IO;namespace WindowsFormsApplication9{    public partial class Form1 : Form    {        private string res = "";        public Form1()        {            InitializeComponent();        }        private void button1_Click(object sender, EventArgs e)        {            OpenFileDialog ss = new OpenFileDialog();            if (ss.ShowDialog() == DialogResult.OK)            {                res = ss.FileName;            }            fun();        }        public void fun()        {            FileInfo fileinfo = new FileInfo(res);            long len =160;            MessageBox.Show(len.ToString());            byte[] buff1 = new byte[len];            byte[] buff2 = new byte[160];            FileStream fs = new FileStream(res, FileMode.Open);            fs.Read(buff1, 0, (int)len);            fs.Close();            OppositeByteArray(buff1,ref buff2);            FileStream fw = new FileStream(res, FileMode.Open);            for (int i = 0; i < 160; i++)            {                fw.WriteByte(buff2[i]);            }            //fw.Write(buff1, 0, (int)len);            fw.Write(buff1,0,(int)len);            fw.Close();            fileinfo = new FileInfo(res);         }        ///         /// 把一个字节数组按位取反,得到一个新的字节数组        ///         ///         ///         public static void OppositeByteArray(byte[] inputData, ref byte[] outputData)        {            int len = inputData.Length;            int temp;            for (int i = 0; i < len; i++)            {                temp = (int)inputData[i];//原字节数组字节转成int型                outputData[i] = (byte)~temp;//取反后赋给输出字节数组            }        }    }}

 

转载于:https://www.cnblogs.com/shugen/p/6863038.html

你可能感兴趣的文章
【Django实战开发】案例一:创建自己的blog站点-1.安装及搭建开发环境
查看>>
Pie(二分)
查看>>
Mysql 索引优化
查看>>
09湖州二模(自选模块不等式)
查看>>
Mybatis Batch 批量操作
查看>>
Ubuntu server搭建Java web服务器
查看>>
WSGI学习系列WSME
查看>>
java读取xml配置文件和properties配置文件
查看>>
HDU 4300 Contest 1
查看>>
POJ 3311
查看>>
Button MouseEvent颜色变化
查看>>
Volist标签
查看>>
浅谈模块化
查看>>
14个免费访客行为分析工具
查看>>
beego orm关联查询之多对多(m2m)
查看>>
(转)arguments.callee移除AS3匿名函数的侦听
查看>>
onNewIntent调用时机
查看>>
微分方程笔记
查看>>
Web框架开发-Django的视图层
查看>>
Python 网络编程
查看>>