Page 3 of 3
about PureLZMA Bug?
Posted: Mon Aug 08, 2011 8:29 am
by shu7734
purebasic 4.51
PureLZMA 4.5X
modify PureLZMA-Packer_Test_2.pb filepath
run the Example
have a error
PureLZMA_Archive_AddFiles
Invalid Memory Access
Re: about PureLZMA Bug?
Posted: Mon Aug 08, 2011 8:40 am
by citystate
you'd probably be better off asking your questions in the
PureLZMA thread...
Re: about PureLZMA Bug?
Posted: Mon Aug 08, 2011 9:13 am
by c4s
...And post an example code where we can reproduce your error.
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 10:47 am
by gnozal
Update (PB4.5x and PB4.6x versions)
Changes :
- added PureLZMA_FreeBuffer() function to free memory allocated by PureLZMA functions PureLZMA_Compress() or PureLZMA_UnCompress().
It seems that (since PB4.5x ?) the main module can't free memory allocated by a userlibrary without an IMA.
- PureLZMA-Packer and PureLZMA-Packer-Mem no longer need the PureLZMA library : the LZMA library is included to avoid memory allocation issues.
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 12:55 pm
by graph100
hello Gnozal,
useful work indeed !!
Do you not intend to extend your work to a Pure7Zip or something like this ? This would be of even greater use ! With all archives
I say that because you already got the Lzma packer working, so why don't adapt it to read existing archives ?
[edit] and I need this feature for one of my project

but I don't have much time to try and implement this all

Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 1:07 pm
by gnozal
graph100 wrote:Do you not intend to extend your work to a Pure7Zip or something like this ? This would be of even greater use !
No, although the library uses the LZMA algorithm, which is one of many supported by 7-ZIP, it does no provide support for 7-ZIP archives.
Personally, for handling *.7z files I use
PureWCX / PureWCX-U +
7-ZIP.wcx.
Code example :
Code: Select all
*SevenZIP = PureWCX_U_LoadPlugin("c:\WinNT\WinCmd\7-Zip\7zip.wcx")
If *SevenZIP
hArc = PureWCX_U_OpenArchive(*SevenZIP, "c:\Purebasic\wcx\Test-pack.7z")
If hArc
While PureWCX_U_GetFileInfo(*SevenZIP, hArc, @HeaderData.PureWCXFileInfo)
Debug "Archive name : " + HeaderData\ArcName
Debug "Archived file : " + HeaderData\Filename
Debug "Archived file packed size : " + Str(HeaderData\PackSize)
Debug "Archived file unpacked size : " + Str(HeaderData\UnpSize)
PureWCX_U_NextFile(*SevenZIP, hArc)
Wend
PureWCX_U_CloseArchive(*SevenZIP, hArc)
EndIf
PureWCX_U_FreePlugin(*SevenZIP)
EndIf
End
Another possibility might be
7-ZIP32.DLL, but the API is in Japanese and the English documentation seems way behind the Japanese version. I believe there are some sources posted in this forum.
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 2:17 pm
by graph100
ah, but it is not multi-os. I have done some search, but nobody had done a wrapper for the 7za.dll or 7z.dll
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 3:33 pm
by jassing
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 4:10 pm
by graph100
well, the guys Mistrel have done a qood job, but, as he said in the first post :
Mistrel wrote:There is a DLL available on SourceForge but it uses a nonstandard COM interface. Maybe srod can figure out what to do with that.
and his dll only does Lzma compress / uncompress without the 7zip header (actually it's not really a header)
I'm searching for a simple mean to unpack common archives like zip, rar, 7zip, etc.. the easier and safer way would be the get a wrapper in PB of 7za.dll or 7z.dll from the 7zip projet.
Because it would be keep updated. Unfortunately, the dll does not use common COM interface. And I don't understand the source.
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Mon Aug 08, 2011 4:22 pm
by ts-soft
graph100 wrote:
I'm searching for a simple mean to unpack common archives like zip, rar, 7zip, etc.
The simple way is to use 7zG.exe
Small, not running example:
Code: Select all
zip = RunProgram("7zG.exe", "x " + #DQUOTE$ + Archiv + #DQUOTE$ + " -o" + #DQUOTE$ + DestPath + #DQUOTE$, SourcePath, #PB_Program_Open)
If zip
While Not WaitProgram(zip)
Wend
Select ProgramExitCode(zip)
Case 1
MessageRequester(#ProgrammName$, "Eine oder mehrere Dateien sind in Benutzung durch eine andere Anwendung" + #LF$ + "und konnte nicht gepackt werden!", #MB_ICONINFORMATION)
Case 2
MessageRequester(#ProgrammName$, "Fatal error", #MB_ICONERROR)
Case 8
MessageRequester(#ProgrammName$, "Nicht genug Speicher vorhanden!", #MB_ICONINFORMATION)
EndSelect
CloseProgram(zip)
EndIf
Re: PureLZMA : compress/uncompress data using LZMA algo
Posted: Tue Aug 09, 2011 11:25 am
by graph100
well, I don't want to steal the topic from gnozal

and I should have explain in detail what I needed :
I'm searching for a way to extract archives from a lot of common format like zip rar, on all platform (window / linux / mac) and to extract them in memory. Not on the disk.
For example, if the archive contain images, you extract them in memory, display it with catchimage(), and free it simply. You can also save them onto the disk. It would allow a lot of possibility.
So the easier to have a cross platform thing to do that is to have a code in PB which reproduce the 7z behaviour. them we would be completely independent !
I have begun to document on the zip format, and to read it. But I have not the time and enough documentation to advance it all throughout.