Skip to content
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

Automatically extracts salt #14

Merged
merged 2 commits into from
Aug 25, 2023
Merged

Conversation

am230
Copy link
Contributor

@am230 am230 commented Aug 25, 2023

No description provided.

@ef1500 ef1500 merged commit 559f6fd into HoloArchivists:main Aug 25, 2023
@ef1500
Copy link
Member

ef1500 commented Aug 25, 2023

Thank you very much for taking the time to make a pull request, I really appreciate it!

@am230 am230 deleted the salt-extractor branch August 25, 2023 05:50
@15532th
Copy link

15532th commented Aug 25, 2023

I believe there might be a couple of nuances that could prevent it from working after next update. Here are a couple of old versions of PlayerPage2.js, along with the current one, all prettified: https://gofile.io/d/mf3Q8e

First, variable t hardcoded in result["salt"] = t({salt}, 0); is only t in current version, it was i in previous one.
Second, within crypt_func expression if(563747==parseInt(i(283))/1*(-parseInt(i(277))/2)... alternates not only numbers but also arithmetic operations, which in turn causes minificator to use different set of parentheses:

  • previous: parseInt(n(421)) / 4 * ( - parseInt(n(423)) / 5)
  • current: parseInt(i(295)) / 4 + - parseInt(i(299)) / 5 .

@ef1500
Copy link
Member

ef1500 commented Aug 31, 2023

I have been running into errors when using the program on a fresh clone, so I have reverted it.

The error I have been running into is this:

>python twclazer.py -u facepag
facepag is live, downloading
Traceback (most recent call last):
  File "C:\Users\blahblah\TwcLazer\TwcLazer.py", line 75, in <module>
    TwAPI = TwitcastAPI.TwitcastingAPI(UserIn)
  File "C:\Users\blahblah\TwcLazer\twitcasting\TwitcastAPI.py", line 247, in __init__
    self.CurrentStreamToken = self.GetToken(self.CurrentStream.movie_id, sessionID, password)
  File "C:\Users\blahblah\TwcLazer\twitcasting\TwitcastAPI.py", line 89, in GetToken
    headers = self.GenerateAuthHeaders(f"/movies/{movieID}/token", sessionID)
  File "C:\Users\blahblah\TwcLazer\twitcasting\TwitcastAPI.py", line 76, in GenerateAuthHeaders
    seed = self.GetSalt()
  File "C:\Users\blahblah\TwcLazer\twitcasting\TwitcastAPI.py", line 55, in GetSalt
    crypt_func = re.search(crypt_func, code).group(0)
AttributeError: 'NoneType' object has no attribute 'group'

If there's something I'm missing, please let me know.

I also understand that this might break the usability of the program; I hope you understand, I'm not really sure what the best move in this situation is. My only inclination is to temporarily revert it until we work out a solution.

@am230
Copy link
Contributor Author

am230 commented Sep 2, 2023

I have been looking for a better extraction method for some time, but I have found that obfuscation can only be extracted with this method in a very few cases, and more code needs to be tracked to extract in more patterns. I have therefore found that this code is not practical enough.

I too think it should be reverted.

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