Recent

Author Topic: PV_Unpacker for ZIP, RAR, TAR  (Read 525 times)

domasz

  • Sr. Member
  • ****
  • Posts: 276
PV_Unpacker for ZIP, RAR, TAR
« on: September 16, 2023, 10:19:40 am »
Here's my little library to unpack various files in pure Pascal.

Supported:
- ZIP (store & deflate)
- TAR
- RAR (store)
- RAR 5(store)

Does not support encryption.

It's a really simple library right now. You won't create a competitor to WinZIP or WinRAR with it but you can use it to:
- unpack TAR files (should unpack all TAR files)
- unpack most popular ZIP files and files based on ZIP (ODT, DOCX, JAR)

It can work fully on streams - can read archive from a stream and can extract all files to streams.

All input is welcome. If you find it has any value I will add more formats, subformats and features.

Usage example:
Code: Pascal  [Select][+][-]
  1. uses PV_Unpacker;
  2.  
  3. var i: Integer;
  4. begin
  5.   if not OpenDialog1.Execute then Exit;
  6.  
  7.   Unp := TUnpacker.Create(OpenDialog1.Filename); //or open from TStream
  8.  
  9.   if Unp.GetFormat = '' then ShowMessage('Unsupported'); //or:
  10.   if Unp.Count < 0 then ShowMessage('Unsupported');
  11.  
  12.   for i:=0 to Unp.Count-1 do begin
  13.     Memo1.Lines.Add( Unp.GetName(i) );
  14.   end;
  15.  
  16.   if Unp.CanUnpack(0) then Unp.Extract(0, 'output.jpg'); //or extract to TStream
  17.  
  18.   Unp.Free;
  19.  
« Last Edit: September 18, 2023, 11:48:21 am by domasz »

domasz

  • Sr. Member
  • ****
  • Posts: 276
Re: PV_Unpacker for ZIP, RAR, TAR
« Reply #1 on: September 18, 2023, 11:50:38 am »
Update- now supported:

- ZIP (store, deflate)
- RAR (store)
- LZH (store)
- TAR
- WAD (PWAD, IWAD, WAD2)
- BH
- PAK

domasz

  • Sr. Member
  • ****
  • Posts: 276
Re: PV_Unpacker for ZIP, RAR, TAR
« Reply #2 on: September 28, 2023, 07:00:37 pm »
More formats added. Now on Github:
https://github.com/PascalVault/Lazarus_Unpacker

 

TinyPortal © 2005-2018