c# 对加密的MP4文件进行解密
2024-10-19 01:19:33
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 =;
MessageBox.Show(len.ToString());
byte[] buff1 = new byte[len];
byte[] buff2 = new byte[];
FileStream fs = new FileStream(res, FileMode.Open);
fs.Read(buff1, , (int)len);
fs.Close();
OppositeByteArray(buff1,ref buff2);
FileStream fw = new FileStream(res, FileMode.Open);
for (int i = ; i < ; i++)
{
fw.WriteByte(buff2[i]);
}
//fw.Write(buff1, 0, (int)len);
fw.Write(buff1,,(int)len);
fw.Close();
fileinfo = new FileInfo(res);
}
/// <summary>
/// 把一个字节数组按位取反,得到一个新的字节数组
/// </summary>
/// <param name="inputData"></param>
/// <param name="outputData"></param>
public static void OppositeByteArray(byte[] inputData, ref byte[] outputData)
{
int len = inputData.Length; int temp; for (int i = ; i < len; i++)
{
temp = (int)inputData[i];//原字节数组字节转成int型
outputData[i] = (byte)~temp;//取反后赋给输出字节数组 } }
}
}
最新文章
- Maven No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK? 问题
- unix basic command
- java、tomcat环境变量的配置(针对windows)
- log4net 日志跟踪程序
- SPOJ 1108 Card Trick 暴力模拟
- 【转】Application.mk 文件语法规范
- GO:格式化代码
- spring MVC中文乱码相关总结
- 基于visual Studio2013解决面试题之1405归并排序
- 关于angularjs+typeahead的整合
- linux-c/c++调试利器gdb、ddd小试
- javascript语句语义大全(7)
- 去掉iframe默认滚动条后影响正常滚动以及js解决高度自适应。
- 反反爬虫 IP代理
- java 堆、栈、方法区/ 类变量、成员变量、局部变量
- centos7 openssl 生成证书给自己使用
- C:指针遍历二维数组
- java面试题复习(七)
- Jmeter如何把响应数据的结果保存到本地的一个文件
- Office 365实现单点登录系列(5)—配置单点登录
热门文章
- POPTEST老李分享session,cookie的安全性以及区别 3
- (删)Java线程同步实现二:Lock锁和Condition
- js按值传递和按引用传递
- POI框架实现创建Excel表、添加数据、读取数据
- 银盛支付ecshop,shopex,shopnc在线支付接口,php版本支付接口开发
- (转)使用string.Format需要注意的一个性能问题
- 作死上CODEVS,青铜题
- bzoj4826 [Hnoi2017]影魔
- 新型钓鱼手段预警:你看到的 аррӏе.com 真是苹果官网?
- RedHat 7.1 下安装 Zabbix监控程序详解(适合linux初级用户)