Metadata block with End Header are not big for our test archive (smaller than 300 bytes). 7-Zip File Manager and type «3000 100G» in «Split to volumes, bytes:» field (100G means that second part can not be larger than 100 GB). We have two parts: a.7z.001 (3000 bytes) and a.7z.002 (740 bytes). Then we copy a.7z.001 to bad.7z and try to open bad.7z. And we get the message «Can not open file ‘bad.7z’ as archive», so we have corrupted archive. We see that Start Header is OK. Correct size is 3740 bytes, but our «bad.7z» is only 3000 bytes. And we don’t see End Header at the end of archive. Conclusion: archive probably was truncated. Now we want to create another «good» 7z archive that contains good Start Header, End Header. Compressed Data block from bad.7z inside that new «good» archive. If LZMA method was used, then first byte in compressed data is always 0 and high bit of second byte is also 0. So if we see 00 in first byte and from 00 to 7F in second byte, probably LZMA method was used (not LZMA2).
n
If first byte in compressed data is not 0 or if the value of second byte is higher then 7F, then it’s not LZMA stream. It can be LZMA2 (or AES encrypted stream). So we select some big file for that new archive. In some cases you can use even bad.7z as that big file. But we use 7-zip.chm. We rename 7-zip.chm (91020 bytes) to file raw.dat and we compress raw.dat to raw.7z with LZMA method with big dictionary size value. The dictionary size must be equal or larger than dictionary size in bad.7z. 7z is (84898 bytes) that is much larger than bad.7z, as required. 7z is smaller than «bad.7z», you must create another raw.7z with another raw.dat that is larger. 7z and type «32 100G» in «Split to volumes, bytes:» field. Note that the value 2968 is equal to size of «bad.7z.002». When you recover real archive, you must use exact size of your bad.7z.002. We press «Extract» for raw.7z.001 file. It will extract raw.dat file and probably it will show «Data Error» message. Now we have raw.dat file that contains recovered stream from bad.7z. Most of 7z archives are solid. If bad.7z archive is not solid, then recovered stream contains data for one file. It can also contain some garbage data at the end. No we must use some parser software that will look raw.dat, search file signatures and extract some files from that file. You need 7-Zip 19.00 or later version. Press Extract command to extract these files. So we have recovered some of the original files, but without original names. 7-Zip parser can find archives in raw file. But it doesn’t recognize another files, like xml, html, jpg, png files and so on. So probably you need some another parser software to extract files from raw file.
n
Can I use 7-Zip in a commercial organization? Yes, 7-Zip is free software. You can use it on any computer. How can I set file associations to 7-Zip in Windows 7 and Windows Vista? You must run 7-Zip File Manager in administrator mode. Right-click the icon of 7-Zip File Manager, and then click Run as administrator. Then you can change file associations and some other options. Why 7z archives created by new version of 7-Zip can be larger than archives created by old version of 7-Zip? New versions of 7-Zip (starting from version 15.06) use another file sorting order by default for solid 7z archives. Old version of 7-Zip (before version 15.06) used file sorting «by type» («by extension»). Parameters field in «Add to archive» window, (or -mqs switch for command line version). You can get big difference in compression ratio for different sorting methods, if dictionary size is smaller than total size of files.
n
If there are similar files in different folders, the sorting «by type» can provide better compression ratio in some cases. Note that sorting «by type» has some drawbacks. For example, NTFS volumes use sorting order «by name», so if an archive uses another sorting, then the speed of some operations for files with unusual order can fall on HDD devices (HDDs have low speed for «seek» operations). Increase dictionary size. It can help when ‘qs’ is not used. Specify ‘qs’ in Parameters field (or use -mqs switch for command line version). If you think that unusual file order is not problem for you, and if better compression ratio with small dictionary is more important for you, use ‘qs’ mode. Why can’t 7-Zip open some ZIP archives? In 99% of these cases it means that the archive contains incorrect headers. Other ZIP programs can open some archives with incorrect headers, since these programs just ignore errors.
n