Skip to content

Commit

Permalink
Added emergency method of obtaining a license
Browse files Browse the repository at this point in the history
  • Loading branch information
rzc0d3r committed Feb 21, 2024
1 parent 45b5c72 commit 3bb5408
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 17 deletions.
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
██╔══╝ ╚════██║██╔══╝ ██║ ██╔═██╗ ██╔══╝ ╚██╔╝ ██║ ██║██╔══╝ ██║╚██╗██║
███████╗███████║███████╗ ██║ ██║ ██╗███████╗ ██║ ╚██████╔╝███████╗██║ ╚████║
╚══════╝╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═══╝
Project Version: v1.3.1.0
Project Version: v1.3.1.1
Project Devs: rzc0d3r, AdityaGarg8, k0re,
Fasjeit, alejanpa17, Ischunddu,
soladify
Expand Down
58 changes: 42 additions & 16 deletions modules/eset_keygen.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from .sec_email_api import *

import time
import re

class EsetKeygen:
def __init__(self, registered_email_obj: SecEmail, driver):
Expand All @@ -20,8 +19,10 @@ def sendRequestForKey(self):
console_log('Waiting for permission to request...', INFO)
uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('ion-card', 'robot', 'license-fork-slide-trial-license-card'))")
console_log('Access to the request was open!', OK)
uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('ion-button', 'robot', 'license-fork-slide-continue-button'))")

try:
uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('ion-button', 'robot', 'license-fork-slide-continue-button'))")
except:
raise RuntimeError('Access to the request is denied, try again later!')
console_log('\nPlatforms loading...', INFO)
uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('ion-card', 'robot', 'device-protect-os-card-Windows'))")
console_log('Windows platform is selected!', OK)
Expand All @@ -36,17 +37,42 @@ def sendRequestForKey(self):
def getLicenseData(self):
exec_js = self.driver.execute_script
uCE = untilConditionExecute
self.driver.get('https://home.eset.com/subscriptions')
console_log('\nLicense uploads...', INFO)
uCE(self.driver, f"return typeof {GET_EBAV}('ion-button', 'robot', 'license-list-open-detail-page-btn') === 'object'")
license_tag = exec_js(f"return {GET_EBAV}('ion-button', 'robot', 'license-list-open-detail-page-btn').href")
console_log('License is uploaded!', OK)

console_log('\nGetting information from the license...', INFO)
self.driver.get(f"https://home.eset.com{license_tag}")
uCE(self.driver, f"return typeof {GET_EBAV}('div', 'class', 'LicenseDetailInfo') === 'object'")
license_name = exec_js(f"return {GET_EBAV}('p', 'data-r', 'license-detail-product-name').innerText")
license_out_date = exec_js(f"return {GET_EBAV}('p', 'data-r', 'license-detail-license-model-additional-info').innerText")
license_key = exec_js(f"return {GET_EBAV}('p', 'data-r', 'license-detail-license-key').innerText")
console_log('Information successfully received!', OK)
try: # first method (main)
console_log('\n[V1] License uploads...', INFO)
self.driver.get('https://home.eset.com/subscriptions')
uCE(self.driver, f"return typeof {GET_EBAV}('ion-button', 'robot', 'license-list-open-detail-page-btn') === 'object'")
license_tag = exec_js(f"return {GET_EBAV}('ion-button', 'robot', 'license-list-open-detail-page-btn').href")
console_log('[V1] License is uploaded!', OK)
console_log('\n[V1] Getting information from the license...', INFO)
self.driver.get(f"https://home.eset.com{license_tag}")
uCE(self.driver, f"return typeof {GET_EBAV}('div', 'class', 'LicenseDetailInfo') === 'object'")
license_name = exec_js(f"return {GET_EBAV}('p', 'data-r', 'license-detail-product-name').innerText")
license_out_date = exec_js(f"return {GET_EBAV}('p', 'data-r', 'license-detail-license-model-additional-info').innerText")
license_key = exec_js(f"return {GET_EBAV}('p', 'data-r', 'license-detail-license-key').innerText")
console_log('[V1] Information successfully received!', OK)
except: # second method (emergency)
console_log('[V1] Algorithm error, attempt through a new algorithm...', ERROR)
console_log('\n[V2] License uploads...', INFO)
for _ in range(DEFAULT_MAX_ITER*2):
last_message = self.email_obj.read_email()[0]
last_message_id = last_message['id']
if last_message['from'] == '[email protected]':
last_message_body = self.email_obj.get_message(last_message_id)['body']
f = open('license.html', 'wb')
f.write(last_message_body.encode('utf-8'))
f.close()
break
time.sleep(DEFAULT_DELAY*2)
console_log('[V2] License is uploaded!', OK)
console_log('\n[V2] Getting information from the license...', INFO)
self.driver.get(f"file://{os.getcwd()}/license.html")
uCE(self.driver, f"return {GET_EBCN}('contents').length > 20")
license_name = exec_js(f"return {GET_EBCN}('contents')[4].innerText")
license_out_date = exec_js(f"return {GET_EBCN}('contents')[8].innerText")
license_key = exec_js(f"return {GET_EBCN}('contents')[6].innerText")
console_log('[V2] Information successfully received!', OK)
try:
os.remove('license.html')
except:
pass
return license_name, license_out_date, license_key

0 comments on commit 3bb5408

Please sign in to comment.