I am looking into parsing 7z files without using any packages - simply by reading the bytes and handling them with my own code. The 7z format is however very badly documented from what I can find.
I managed to parse the front header of the 7z file using the info on the info page about corrupted archives. The only information regarding parsing the end header of 7z files I can find is 7zFormat.txt, here's the relevant snippet of "documentation":
Header
~~~~~~
BYTE NID::kHeader (0x01)
[]
ArchiveProperties
[]
[]
BYTE NID::kAdditionalStreamsInfo; (0x03)
StreamsInfo
[]
[]
BYTE NID::kMainStreamsInfo; (0x04)
StreamsInfo
[]
[]
FilesInfo
[]
BYTE NID::kEnd
I also have extracted the bytes that are part of the end header from a file I am using testing, it looks as follows:
[
'01', '04', '06', '00', '01', '09', 'c1', 'b5',
'10', '00', '07', '0b', '01', '00', '01', '21',
'21', '01', '09', '0c', 'c1', 'ae', '10', '00',
'08', '0a', '01', 'b9', 'e8', 'c3', 'a6', '00',
'00', '05', '01', '19', '08', '00', '00', '00',
'00', '00', '00', '00', '00', '11', '0d', '00',
'61', '00', '2e', '00', '70', '00', '6e', '00',
'67', '00', '00', '00', '14', '0a', '01', '00',
'20', 'fb', '01', '59', '7c', '0e', 'da', '01',
'15', '06', '01', '00', '20', '00', '00', '00',
'00', '00'
]
I am capable of decoding which parts of this header are supposed to contain what - but absolutely no clue how to interpret the actual bytes. How should I go about interpreting/reading this header? (Answer is preferred as concept, if there is example code, would help most if it is Node.js or Python)
If my post is lacking any important info, please let me know. Thanks for reading!