Menu

how can I verify that the archive has a password?

Help
kanejons
2024-03-14
2024-03-14
  • kanejons

    kanejons - 2024-03-14

    While studying CLient7z, I saw this line of code in Extract:

    Z7_COM7F_IMF(CArchiveExtractCallback::CryptoGetTextPassword(BSTR *password))
    {
      if (!PasswordIsDefined)
      {
        // You can ask real password here from user
        // Password = GetPassword(OutStream);
        // PasswordIsDefined = true;
        PrintError("Password is not defined");
        return E_ABORT;
      }
      return StringToBstr(Password, password);
    }
    

    Trying to use it separately, I didn't succeed. I wanted to write a function before unpacking that would check the passwords of the archive, and then only unpack it.Can you tell me how to do this?

     
  • Igor Pavlov

    Igor Pavlov - 2024-03-14

    No way to check password without unpacking for 7z archive.

     

Log in to post a comment.