Page 2 of 2

Re: zBin Packer SDK - Crossplattform

Posted: Sun Nov 25, 2012 7:02 am
by ts-soft
skywalk wrote:Hi ts-soft,
Can you check if this is correct? ...
I think, the help is not correct. The ciphering using always 16 Bytes.
skywalk wrote:And PB5 updated to zlib v125, so safe to use internal compressBound() and crc32().

Code: Select all

destLen = compressBound(sourceLen)  ; destLen = sourceLen + 13 + (Int(sourceLen / 100))

FileHeader\crc = crc32(#Null, *mem, size)    ; CRC32Fingerprint(*mem, size)
Thanks for the hint, i have changed to compressBound, crc is unchanged, this make no difference.

Re: zBin Packer SDK - Crossplattform

Posted: Sun Nov 25, 2012 7:03 am
by ts-soft
Update:
History wrote:; V 1.6.3 12/11/25
; using compressBound(sourceLen)
; changed stringcompare with not to = 0 for compatibility to PB 5.00

Re: zBin Packer SDK - Crossplattform

Posted: Wed Sep 23, 2015 8:52 pm
by JCV
I tried to update the code to PB 5.4 Beta but I'm getting crc error when reading *.ico files but ok with png in zbin file. Any idea?

Code: Select all

UseMD5Fingerprint()
;If MD5Fingerprint(*keybuffer, #zBin_HASH_Size) <> PeekS(@\Header\HASH[0], -1, #PB_Ascii)
If Fingerprint(*keybuffer, #zBin_HASH_Size, #PB_Cipher_MD5) <> PeekS(@\Header\HASH[0], -1, #PB_Ascii)

Code: Select all

UseCRC32Fingerprint()
;If CRC32Fingerprint(*dest, MemorySize(*dest)) = \FileInfo(Number - 1)\crc
If Val("$" + Fingerprint(*dest, MemorySize(*dest), #PB_Cipher_CRC32)) = \FileInfo(Number - 1)\crc

Re: zBin Packer SDK - Crossplattform

Posted: Wed Sep 23, 2015 9:18 pm
by ts-soft
Add at the end of "zBin_Common.pbi"

Code: Select all

CompilerIf #PB_Compiler_Version >= 540
  UseMD5Fingerprint()
  Procedure.s MD5Fingerprint(*hashbuffer, Size)
    ProcedureReturn Fingerprint(*hashbuffer, Size, #PB_Cipher_MD5)
  EndProcedure
  UseCRC32Fingerprint()
  Procedure CRC32Fingerprint(*mem, size)
    ProcedureReturn Val("$" + Fingerprint(*mem, size, #PB_Cipher_CRC32))
  EndProcedure
CompilerEndIf
I hope, this works.

Greetings Thomas

Re: zBin Packer SDK - Crossplattform

Posted: Thu Sep 24, 2015 7:31 am
by JCV
Hi Thomas, its still crc error. It only happens when reading *.ico files in zbin. I'm testing the gui unpacker code.
\FileInfo(Number-1)\crc
negative value when reading *.ico in zBinUnpack_CatchFile. Reading png is ok.

Re: zBin Packer SDK - Crossplattform

Posted: Wed Sep 30, 2015 5:31 pm
by DK5UR
It's an unsigned long comparing with integer probem.
NicTheQuick pointed me to this at http://www.purebasic.fr/german/viewtopi ... 75#p332175 :idea: .
Just replace each
\FileInfo(Number-1)\crc
in the zBin_Unpack.pbi with

Code: Select all

\FileInfo(Number-1)\crc & $ffffffff
This do the trick, quick and dirty

Heinz

Re: zBin Packer SDK - Crossplattform

Posted: Thu Oct 01, 2015 9:12 am
by JCV
Thanks DK5UR! It did the trick.

Re: zBin Packer SDK - Crossplattform

Posted: Thu Oct 22, 2015 5:36 am
by ts-soft
Update:
Historie wrote:; V 1.7.0 15/10/22
; changed crc fingerprint and casting to reflect new PB5.40
; changed waponez-example to comptatible with modern GrafikCards
; some GUI changes to work with GTK3
; all tools recompiled and tested

Re: zBin Packer SDK - Crossplattform

Posted: Thu Oct 22, 2015 7:43 pm
by GoodNPlenty
Thank You for the update and awesome packer SDK :D