Code Monkey home page Code Monkey logo

Comments (11)

fancycode avatar fancycode commented on June 7, 2024

What type of debugger do you use, Python- or C-level? This line calls into the C extension to perform the AES decryption, which then for some reason fails for you.
Decryption is also done in the test_encrypted_password testcase - does that work for you, or does it also crash (you can comment the crashing test_encrypted_names_password to skip it)?

Unfortunately I don't have a way to reproduce this yet.

from pylzma.

KenV99 avatar KenV99 commented on June 7, 2024

I am using pydevd as a debugger. I don't know C well enough to do a debug build. Sorry.

Four unittests all fail at the same line (698 in py7zlib.py) as listed above:
test_encrypted_password
test_encrypted_wong_password
test_encrypted_names_password
test_encrypted_names_wong_password

I am not sure if this has anything to do with it (I doubt it), but during the build I get a command line warning D9025L overriding '/MD' with '/MT' for each c file.

from pylzma.

fancycode avatar fancycode commented on June 7, 2024

I probably found the issue. Could you please check 2f48f6b to see if that fixes your problem?

from pylzma.

KenV99 avatar KenV99 commented on June 7, 2024

The build now fails:

pylzma_aes.c
src/pylzma/pylzma_aes.c(58) : error C2143: syntax error : missing ';' before 'type'
src/pylzma/pylzma_aes.c(59) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(60) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(120) : error C2143: syntax error : missing ';' before 'type'
src/pylzma/pylzma_aes.c(121) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(122) : error C2065: 'offset' : undeclared identifier
src/pylzma/pylzma_aes.c(144) : error C2061: syntax error : identifier 'aesdecrypt_methods'
src/pylzma/pylzma_aes.c(144) : error C2059: syntax error : ';'
src/pylzma/pylzma_aes.c(144) : error C3409: empty attribute block is not allowed
src/pylzma/pylzma_aes.c(144) : error C2513: '/global/ ' : no variable declared before '='
src/pylzma/pylzma_aes.c(178) : error C2065: 'aesdecrypt_methods' : undeclared identifier
src/pylzma/pylzma_aes.c(178) : error C2099: initializer is not a constant
src/pylzma/pylzma_aes.c(186) : warning C4047: 'initializing' : 'Py_ssize_t' differs in levels of indirection from 'initproc'
error: command 'C:\Users\Ken User\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe' failed with exit status
2

But thanks for your efforts.

from pylzma.

fancycode avatar fancycode commented on June 7, 2024

Oh right, the MS compiler is a bit picky about variables in C code... Should hopefully work now.

from pylzma.

KenV99 avatar KenV99 commented on June 7, 2024

Builds and passes unittests now. Thanks!
However, I'm still getting an error trying to decompress a password protected file created by a recent version of 7z. Same as documented:#26

My real question is: Is it possible to create a compatible, password protected 7z file using this library with Python?

from pylzma.

fancycode avatar fancycode commented on June 7, 2024

Hmm, the test_encrypted_names_XXX unittests use a file that was created using the same command you described in #26. Could you please provide a (small) failing sample file together with the password, so I can fix the issue and add it to the test suite?

from pylzma.

KenV99 avatar KenV99 commented on June 7, 2024

I tried and found that the errors that I am experiencing seem to have to do with problems surrounding an EOF error. This could be specific to windows.

Here is some code that I am using to try to troubleshoot:

http://pastebin.com/sHg3UaRr

This code demonstrates that the file contents that py7zlib reads in is not the same as what was written to the 7z file. When I run it at line 90 the string that is read in is not as the same as what was written - it is truncated. Then the pickle fails to load with an EOF error.

An example 7z files is here:

https://www.dropbox.com/s/xdhlxfg7g6563p7/info7.7z?dl=0

This may seem to be unrelated to my original statements above, but I believe it is the same issue. I just restructured the code so that the error is more obvious.

from pylzma.

fancycode avatar fancycode commented on June 7, 2024

Thanks, that example helped. For some cases, encrypted data was not truncated correctly.

from pylzma.

KenV99 avatar KenV99 commented on June 7, 2024

Thanks very much. All working as expected now.

from pylzma.

KenV99 avatar KenV99 commented on June 7, 2024

I'm not sure if it's bad etiquette to raise a related issue in a closed issue, so please forgive me if it is.
If I change the command line in the previous code in pastebin to include the -mhe switch to encrypt headers, I get an 'invalid block data error' from Archive7z.__init__() in py7zlib.py.

In what may be a side note, in class Header.__init__() in the line self.properties = ArchiveProperties(file), ArchiveProperties is not defined in py7zlib.py.

Thanks again for all of your help.

from pylzma.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.