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 ?
UnPack 7z file with password ?
-
- User
- Posts: 97
- Joined: Wed Nov 16, 2022 1:51 pm
UnPack 7z file with password ?
PC: Windows 10 x64, 8GB RAM. PB ver: 6.x
--
I love PB5 vs PB6
--
I love PB5 vs PB6

Re: UnPack 7z file with password ?
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
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
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
Re: UnPack 7z file with password ?
Try Kenmo's include file... https://github.com/kenmo-pb/includes/bl ... r/7Zip.pbi
- 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
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