Skip to content

Fix FileOpen DRM#962

Open
freyta wants to merge 5 commits intonoDRM:masterfrom
freyta:master
Open

Fix FileOpen DRM#962
freyta wants to merge 5 commits intonoDRM:masterfrom
freyta:master

Conversation

@freyta
Copy link
Copy Markdown

@freyta freyta commented Feb 20, 2026

Updated the FileOpen DRM so it uses the new URL encryption scheme.

Fixed the computation of the machine and disk keys, so you can decrypt previously opened files from your computer. Previously the machine key was always generating "22222222", and the machine code was slightly off so the last 2 digits were wrong.

Removed unused imports, cleaned up unused code (Linux and fopn_flock)
Added encrypted URL request and responses.
Updated from Windows Vista, to Windows 10 64-bit
@freyta
Copy link
Copy Markdown
Author

freyta commented Feb 20, 2026

If someone else can upload a PDF that wasn't decrypting to try and debug it that would help. I don't know if my changes break previous requests - I haven't got a PDF to test with..

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have many file open files, mainly Australian standards I've paid for but don't open. how do i send them to you to try. Not sure what to do with that script. does it need compiling to run? I posted the debug out of calibre, is thats of any use. back on the apprentice page. let me know how to get it to you.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need Python 2.7 installed to run this script - maybe I should update it for Python 3.

These are the modules I have installed:

certifi @ certifi-2019.11.28.tar.gz
pycrypto @ pycrypto-2.6.1.tar.gz
pywin32==225

certifi and pycrypto were both installed as packages downloaded.

Then to run it you an just double click it, or I use the command prompt and type in

C:\Python27\python27.exe "ineptpdf8.6.0.pyw"

Some providers still use the original URL scheme (i.e. not base64 encoded) - these weren't working. Now they should.
@vysmaty
Copy link
Copy Markdown

vysmaty commented Mar 27, 2026

Idea for improvement. ;)
I had a problem with: "Error: Unexpected EOF"

When I handle lines 2397-2401 it with a try-except block, it works.

        else:
            try:
                self.parser.seek(index)
                (_,objid1) = self.parser.nexttoken() # objid
                (_,genno) = self.parser.nexttoken() # genno
                #assert objid1 == objid, (objid, objid1)
                (_,kwd) = self.parser.nexttoken()
            except Exception as e:
                # Some PDFs specify an out of bounds offset (like 0xFFFFFFFF) for deleted objects
                # instead of properly marking them as free objects in stream. Handle gracefully.
                return None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants