Jump to content
Ferenc

RS 11 FMX zip file with password

Recommended Posts

Hi,

 

Does anybody know a way (component, source code) how we can use password for FMX Android and iOS?

I found the TEncryptedZipFile on http://www.uweraabe.de/Blog/2017/05/07/tzipfile-with-password-encryption-part-3/ which worked with RS 10.4. But with RS 11 the created protected zip file cannot be unzipped on another system with a different zip component (VCL), the right password is not right. The component on mobiles can unzip protected files created with another zip component (VCL), it works.

  • Thanks 1

Share this post


Link to post

I have just found this issue with TEncryptedZipFile in Delphi 11

worked in 10.4 with no issue

in 11, I cannot unzip using 7zip

 

@Uwe Raabe Is this something you have already noticed or tackled yourself?

Share this post


Link to post
4 hours ago, Martin Sedgewick said:

 

@Uwe Raabe Is this something you have already noticed or tackled yourself?

I will have a look ASAP.

  • Thanks 1

Share this post


Link to post

The problem is caused by a change in the TStream.CopyFrom code made in D11. Someone forgot to override TZCompressionStream.GetSize returning -1 to make it work with that change.

TZCompressionStream raises "EZCompressionError with message 'Invalid ZStream operation!'"

TZCompressionStream.CopyFrom raises SZInvalid

Zlib, tZCompressionStream.GetSize() throws an unnecessary exception

 

Fortunately its is said to be fixed in D11.1.

 

For the meantime I added a workaround available in the latest version: https://github.com/UweRaabe/EncryptedZipFile

Share this post


Link to post

 

Code-Snippet i got from a friend long ago might be useful ?

//From: BoB Team-PEiD

 

Function  GetPolyCrc32(Address : Pointer; Size : DWord) : DWord;
Asm
// input:  EAX=data, EDX=size

    PushAD
    XChg    EAX, EDX          // EDX = Address ..
    XChg    EAX, ECX          // ECX = Size ..
//    Mov     EDX, Buffer
//    Mov     ECX, NumBytes
    Xor     EAX, EAX

// input:  EDX=data, ECX=size, EAX=crc
// output: EAX=crc, EDX+=ECX, ECX=BL=0

    Jecxz   @L4
    Not     EAX
@L1:
    Xor     AL, [EDX]
    Inc     EDX
    Mov     BL, 8
@L2:
    Shr     EAX, 1
    Jnc     @L3
    Xor     EAX, $EDB88320
@L3:
    Dec     BL
    Jnz     @L2
    Loop    @L1
    Not     EAX
@L4:
    Mov     [ESP + PushAD_EAX], EAX
    PopAD
End;

Edited by reshup

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×