UnPack 7z file with password ?

Everything else that doesn't fall into one of the other PB categories.
hoangdiemtinh
User
User
Posts: 97
Joined: Wed Nov 16, 2022 1:51 pm

UnPack 7z file with password ?

Post by hoangdiemtinh »

I'm new to PB.
My primary language is not US/UK. I am using Google Translate.

I could not find in PB document how to extract a password 7Z file.
I see UseLzmaPacker() and https://www.purebasic.fr/english/viewto ... p&start=15.

How to unpack 7z file with password ?
PC: Windows 10 x64, 8GB RAM. PB ver: 6.x
--
I love PB5 vs PB6 :)
benubi
Enthusiast
Enthusiast
Posts: 220
Joined: Tue Mar 29, 2005 4:01 pm

Re: UnPack 7z file with password ?

Post by benubi »

There is no Password support for PureBasic internal Packer library yet.

Alternatively you could encrypt & decipher the entire archive with AES, if you are the one creating/distributing the 7z archive.

The link you posted doesn't use PureBasic's internal packer library.

It uses the "7-zip32.dll" and to list or add the files it uses the procedure SevenZipCmdLine(). You need to download this DLL, or the 64 bit version if you use 64 bit Windows (from the 7z page). You will have to adapt the code you have linked to so that the name of the DLL matches.

You can try to find help on the 7z forums (https://sourceforge.net/p/sevenzip/discussion/45797/)

This might help
https://sourceforge.net/p/sevenzip/disc ... 826c/#26f4

Code: Select all

;(untested)

FileName$="YourFile.7z"
Password$="secret_password"
SevenZipCmdLine("x "+FileName$+" -p"+Password$)


But you need to download the .dll/.so and put it with your compiled executable for it to work.
https://www.7-zip.org/download.html
User avatar
blueb
Addict
Addict
Posts: 1116
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: UnPack 7z file with password ?

Post by blueb »

- It was too lonely at the top.

System : PB 6.21(x64) and Win 11 Pro (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Post Reply