Some people often send interesting pictures on some forums. After "Save as", you find this is a normal picture. However, if you change the extension name to .rar, you will find that it can be decompressed normally. After decompression, there are some other files, such as BT seeds (You know ). So what is the principle? In fact, the principle is very simple. You can also do it yourself without any additional software. Let's talk about the principle and how to do it.
1. jpg and rarfile formats
We don't need to know all the format information here, as long as we know something useful.
JPG format is compressed by discrete cosine transformation. Its format is as follows:
SOI (0xffd8)
App0 (0xffe0)
[Appn (0 xffen)] Optional
Dqt (0 xffdb)
Sof0 (0xffc0)
DHT (0xffc4)
SOS (0 xffda)
Compressed Data
EOI (0xffd9)
To put it simply, the JPG format starts with ffd8 and ends with ffd9. general image browsers. For example, if Microsoft's Image Viewer reads the ffd9 field after the compressed data, it will be automatically terminated. This is a very good property: we can add anything at the end of the JPG file without affecting the image display.
Now let's look at the RAR format-unfortunately, the author of The RAR format has died, and the RAR format itself is confidential. However, we found that the rarfile is Rar! And the RAR decompression process seems to have ignored all Rar! Before.
Therefore, we only need to write the contents of the rarfile to the back of the JPG file!
2. Implementation Method
In Windows, for example, qianuxn.jpgand qianxun.rar, we only need to execute the following command:
Copy/B qianxun.jpg?qianxun.rar
The following figure shows a compressed file after saving the file and changing the extension to rar, which can be decompressed.