Hahhaha! Fun

Source: Internet
Author: User

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.

 

 

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.