Skip to content

Add python 2 tools to extract watermarks, generate a hosts watermark,… #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dfj
Copy link

@dfj dfj commented Sep 14, 2016

… and add README

@takeshixx
Copy link
Owner

Thanks for the pull request @dfj. However, the wm_decrypt.py script is already compatible with Python 2, so I think a dedicated Python 2 version of the script would make no sense. If you encounter any problems with the script feel free to send pull requests for it or open an issue. I've changed the shebang interpreter to just "python".

Unfortunately there are some errors in the pull request. The major one is the format of the watermarks:

[24 byte watermark a]..[24 byte watermark n][1 byte checksum][6 byte EOF mark]

The right format would look like this:

[24 byte watermark a]..[24 byte watermark n][4 byte length][3 byte EOF mark]

The EOF sequence is just the three ASCII chars "EOF". The 4 Bytes before that denote the total length of all watermarks (only the watermarks, without the length itself and the "EOF" string) as a 4 Byte little endian integer. So this will allow roughly 178956970 (2**32/24) watermarks to be included in this format.

In regards to the proper format, the wm_gen.py script also works with the wrong watermark format. However, I think a script that extracts/generates the serial in the watermark from a Red Star instance would be a handy tool to check where a watermark is coming from. But I would have to have a further look in the opprc binary to see how it exactly generates the watermark.

@dfj
Copy link
Author

dfj commented Sep 15, 2016

Thanks for the great feedback! Hopefully I've now got it in a better state to merge.


The general format of the watermarks is:

[24 byte watermark a]..[24 byte watermark n][4 byte checksum][3 byte EOF mark]

Choose a reason for hiding this comment

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

I'd not use a to design the 1st watermark. I guess an interval a ... n is misleading, and recommend 1 ... n instead.

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