خرید بک لینک

After a puzzle in puzzles.SE which involved a hidden file appended to a gif, I have a question regarding appended .rar files.

By this question I understand why I can add a .rar file content at the end of any known image format, as long as such format declares their data length in some way that any compliant reader would load only the required amount of bytes, and not read until end of file.

I can generate such file like this:

$ cat myimg.jpg myhidden.rar > myimg.jpg

Which works for any of the mentioned formats and will happily open as a regular image in the image viewer.

What surprised me is that I can actually open the hidden file! This is:

$ sudo apt-get install unrar
$ unrar e myimg.jpg

and will extract the files inside the contents of myhidden.rar

And my question is: How is that possible? My first thought in the matter would be that when I try to open my file, the .rar header is not found at the top (instead, a strange format the rar... parser, should not recognize), but somehow the utility manages to find the actual rar file and open it. I noticed this works both in Ubuntu and in Windows with WinRAR.

What am I missing? Does this work with other formats as well? (concretely: .zip, .7z, .tar.gz).

برچسب: نویسنده: استخدام کار تاريخ: جمعه 7 خرداد 1395 ساعت: 4:16

صفحه بندی