PureLZMA : compress/uncompress data using LZMA algo

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

shu7734
User
User
Posts: 30
Joined: Thu May 15, 2008 5:53 am

about PureLZMA Bug?

Post 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
Win7X64 Purebasic5.22x86DEMO
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Re: about PureLZMA Bug?

Post by citystate »

you'd probably be better off asking your questions in the PureLZMA thread...
there is no sig, only zuul (and the following disclaimer)

WARNING: may be talking out of his hat
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: about PureLZMA Bug?

Post by c4s »

...And post an example code where we can reproduce your error.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
graph100
Enthusiast
Enthusiast
Posts: 115
Joined: Tue Aug 10, 2010 3:17 pm

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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 :cry: but I don't have much time to try and implement this all :cry:
_________________________________________________
My Website : CeriseCode (Warning : perpetual changes & not completed ;))
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
graph100
Enthusiast
Enthusiast
Posts: 115
Joined: Tue Aug 10, 2010 3:17 pm

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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
_________________________________________________
My Website : CeriseCode (Warning : perpetual changes & not completed ;))
jassing
Addict
Addict
Posts: 1745
Joined: Wed Feb 17, 2010 12:00 am

Re: PureLZMA : compress/uncompress data using LZMA algo

Post by jassing »

User avatar
graph100
Enthusiast
Enthusiast
Posts: 115
Joined: Tue Aug 10, 2010 3:17 pm

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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.
_________________________________________________
My Website : CeriseCode (Warning : perpetual changes & not completed ;))
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
graph100
Enthusiast
Enthusiast
Posts: 115
Joined: Tue Aug 10, 2010 3:17 pm

Re: PureLZMA : compress/uncompress data using LZMA algo

Post 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 ! :mrgreen:
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.
_________________________________________________
My Website : CeriseCode (Warning : perpetual changes & not completed ;))
Post Reply