如何在文件内写入数据,而不破坏文件结构。

WBOY
Release: 2016-06-06 20:19:31
Original
1466 people have browsed it

如何在一个文件内写入数据,而且不破坏文件的结构。比如.txt .zip .db,写入数据后还能正常使用。但是看不见数据。

回复内容:

如何在一个文件内写入数据,而且不破坏文件的结构。比如.txt .zip .db,写入数据后还能正常使用。但是看不见数据。

对于TXT这样的文件,基本不现实。

对于有些文件,解析器会默认有一个“文件结束”标记,例如一段Pascal源代码,只要遇到了end.,就表示文件结束了,后面随便写什么都可以,编译器是不会对其进行编译的。

那么就有这样一个思路:我们把数据追加到文件的“结束标记”之后。
例如对于jpg文件,假设我们有一个a.jpg,我们的敏感数据是b.zip,要把它隐藏到a.jpg中,我们可以这么写:

<code>copy /b a.JPG + b.zip c.JPG
</code>
Copy after login

这样,c.jpg就是我们最后生成的文件。

此外还有一个叫“内容覆盖法”的方法,不过比较麻烦……
还有一些隐写的工具,楼主有兴趣也可以试试。

参考资料:https://program-think.blogspot.com/2011/06/use-image-hide-information.html

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!