Skip to content

Commit

Permalink
Update to v1.4.9.3
Browse files Browse the repository at this point in the history
1. Removed the use of rich module, now uses the analog from SRT-Translator
2. Attempt to fix ElementNotInteractableException: Element: <input id="email"> is not available from keyboard (during 'Sending a request for a license...')
3. Added new command line argument: --no-logo'
4. Minor corrections to documentation
5. requirements.txt file optimization
  • Loading branch information
rzc0d3r authored Jul 26, 2024
1 parent c1dc075 commit f18eb0b
Show file tree
Hide file tree
Showing 12 changed files with 94 additions and 41 deletions.
Binary file modified img/project_preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 6 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import os
import re

VERSION = ['v1.4.9.2', 1492]
VERSION = ['v1.4.9.3', 1493]
LOGO = f"""
███████╗███████╗███████╗████████╗ ██╗ ██╗███████╗██╗ ██╗ ██████╗ ███████╗███╗ ██╗
██╔════╝██╔════╝██╔════╝╚══██╔══╝ ██║ ██╔╝██╔════╝╚██╗ ██╔╝██╔════╝ ██╔════╝████╗ ██║
Expand All @@ -34,7 +34,9 @@
Fasjeit, alejanpa17, Ischunddu,
soladify, AngryBonk, Xoncia
"""

if '--no-logo' in sys.argv:
LOGO = f"ESET KeyGen {VERSION[0]} by rzc0d3r\n"

# -- Quick settings [for Developers to quickly change behavior without changing all files] --
DEFAULT_EMAIL_API = '1secmail'
AVAILABLE_EMAIL_APIS = ['1secmail', 'hi2in', '10minutemail', 'tempmail', 'guerrillamail', 'developermail']
Expand Down Expand Up @@ -66,6 +68,7 @@
'email_api': DEFAULT_EMAIL_API,
'custom_email_api': False,
'skip_update_check': False,
'no_logo': False
}

def RunMenu():
Expand Down Expand Up @@ -173,6 +176,7 @@ def parse_argv():
args_parser.add_argument('--email-api', choices=AVAILABLE_EMAIL_APIS, default=DEFAULT_EMAIL_API, help='Specify which api to use for mail')
args_parser.add_argument('--custom-email-api', action='store_true', help='Allows you to manually specify any email, and all work will go through it. But you will also have to manually read inbox and do what is described in the documentation for this argument')
args_parser.add_argument('--skip-update-check', action='store_true', help='Skips checking for program updates')
args_parser.add_argument('--no-logo', action='store_true', help='Replaces ASCII-Art with plain text')
#args_parser.add_argument('--try-auto-cloudflare',action='store_true', help='Removes the prompt for the user to press Enter when solving cloudflare captcha. In some cases it may go through automatically, which will give the opportunity to use tempmail in automatic mode!')
try:
global args
Expand Down
6 changes: 5 additions & 1 deletion modules/EsetTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def createAccount(self):
console_log('\nBypassing cookies...', INFO)
if uCE(self.driver, f"return {CLICK_WITH_BOOL}({GET_EBAV}('button', 'id', 'cc-accept'))", max_iter=10, raise_exception_if_failed=False):
console_log('Cookies successfully bypassed!', OK)
time.sleep(1.5) # Once pressed, you have to wait a little while. If code do not do this, the site does not count the acceptance of cookies
time.sleep(1) # Once pressed, you have to wait a little while. If code do not do this, the site does not count the acceptance of cookies
else:
console_log("Cookies were not bypassed (it doesn't affect the algorithm, I think :D)", ERROR)

Expand Down Expand Up @@ -108,6 +108,10 @@ def sendRequestForKey(self):

console_log('\nSending a request for a license...', INFO)
uCE(self.driver, f"return typeof {GET_EBID}('email') === 'object'")
try:
exec_js(f"return {GET_EBID}('email')").click() # fix for ElementNotInteractableException: X is not reachable by keyboard
except:
pass
exec_js(f"return {GET_EBID}('email')").send_keys(self.email_obj.email)
exec_js(f"return {GET_EBAV}('button', 'data-label', 'device-protect-get-installer-send-email-btn')").click()
for _ in range(DEFAULT_MAX_ITER):
Expand Down
51 changes: 51 additions & 0 deletions modules/ProgressBar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
from colorama import Fore, init as colorama_init

import decimal
import platform
import sys

colorama_init()

class ProgressBarStyle:
def __init__(self, advance_char='█', empty_advance_char='▓', progressbar_length=30):
self.advance_char = advance_char
self.empty_advance_char = empty_advance_char
self.progressbar_length = progressbar_length

DEFAULT_STYLE = ProgressBarStyle()
DEFAULT_RICH_STYLE = ProgressBarStyle(f'{Fore.GREEN}{Fore.RESET}', f'{Fore.LIGHTBLACK_EX}{Fore.RESET}', 41)
CLASSIC_STYLE = ProgressBarStyle(f'{Fore.GREEN}{Fore.RESET}', f'{Fore.LIGHTBLACK_EX}{Fore.RESET}')
DRACULA_STYLE = ProgressBarStyle(f'{Fore.RED}{Fore.RESET}', f'{Fore.LIGHTRED_EX}{Fore.RESET}')
GIRL_STYLE = ProgressBarStyle(f'{Fore.LIGHTMAGENTA_EX}{Fore.RESET}', f'{Fore.MAGENTA}{Fore.RESET}')
DARK_STYLE = ProgressBarStyle(f'{Fore.LIGHTBLACK_EX}{Fore.RESET}', ' ')
RAINBOW_STYLE = ProgressBarStyle(f'{Fore.RED}{Fore.CYAN}{Fore.YELLOW}{Fore.GREEN}{Fore.BLUE}{Fore.MAGENTA}{Fore.RESET}', '', 10)

class ProgressBar:
def __init__(self, total, description: str, progress_bar_style=DEFAULT_STYLE):
self.advance = 0
self.total = total
self.description = description
self.progressbar_length = progress_bar_style.progressbar_length
self.advance_char = progress_bar_style.advance_char
self.empty_advance_char = progress_bar_style.empty_advance_char
self.advance_char_coef = round(self.total/self.progressbar_length, 2)

@property
def is_finished(self):
return self.advance == self.total

def force_finish(self):
self.advance = self.total

def render(self):
if self.is_finished:
advance_char_count = self.progressbar_length
else:
advance_char_count = int(self.advance/self.advance_char_coef)
advance_percent = round(decimal.Decimal(self.advance/self.total), 2)*100
if platform.release() != '7' and sys.platform.startswith('win'): # disable rendering for windows 7 (cmd.exe does not support ASCII control characters)
print(f'{self.description}{self.advance_char*advance_char_count}{self.empty_advance_char*(self.progressbar_length-advance_char_count)} {advance_percent}%')
print('\033[F', end='')

def update(self, count):
self.advance += count
2 changes: 0 additions & 2 deletions modules/SharedTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,6 @@ def initSeleniumWebDriver(browser_name: str, webdriver_path = None, browser_path
driver_options.add_argument('--no-sandbox')
driver_options.add_argument('--disable-dev-shm-usage')
driver = Edge(options=driver_options, service=EdgeService(executable_path=webdriver_path))
#driver.set_window_position(0, 0)
#driver.set_window_size(640, 640)
return driver

def parseToken(email_obj, driver=None, eset_business=False, delay=DEFAULT_DELAY, max_iter=DEFAULT_MAX_ITER):
Expand Down
20 changes: 9 additions & 11 deletions modules/Updater.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .SharedTools import console_log, INFO, OK, ERROR, WARN
from rich.progress import Progress
from .ProgressBar import ProgressBar, DEFAULT_RICH_STYLE

import argparse
import requests
Expand Down Expand Up @@ -51,19 +51,17 @@ def download_file(url, filename):
response = requests.get(url, stream=True)
total_length = response.headers.get('content-length')

if total_length is None: # No content length header
#console_log("Cannot determine the size of the download. Downloading in one go...", WARN)
if total_length is None: # No content length header
with open(filename, 'wb') as f:
f.write(response.content)
else:
total_length = int(total_length)
with Progress() as progress:
task = progress.add_task(" ", total=total_length)
with open(filename, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
progress.update(task, advance=len(chunk))
task = ProgressBar(int(total_length), ' ', DEFAULT_RICH_STYLE)
with open(filename, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
task.update(len(chunk))
task.render()
return True
except Exception as e:
console_log(f"Error downloading file: {e}", ERROR)
Expand Down
17 changes: 8 additions & 9 deletions modules/WebDriverInstaller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from .SharedTools import console_log, INFO, OK, ERROR
from rich.progress import Progress
from .ProgressBar import ProgressBar, DEFAULT_RICH_STYLE

import subprocess
import platform
Expand Down Expand Up @@ -129,14 +129,13 @@ def download_webdriver(self, path='.', url=None, edge=False, firefox=False):
with open(zip_path, 'wb') as f:
f.write(response.content)
else:
total_length = int(total_length)
with Progress() as progress:
task = progress.add_task(" ", total=total_length)
with open(zip_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
progress.update(task, advance=len(chunk))
task = ProgressBar(int(total_length), ' ', DEFAULT_RICH_STYLE)
with open(zip_path, 'wb') as f:
for chunk in response.iter_content(chunk_size=8192):
if chunk: # filter out keep-alive new chunks
f.write(chunk)
task.update(len(chunk))
task.render()
if edge:
webdriver_name = 'msedgedriver' # macOS, linux
elif firefox:
Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
selenium
requests
colorama
typing-extensions
rich
colorama
8 changes: 4 additions & 4 deletions wiki/AccountGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
python main.py --chrome --account
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --account
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --account
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -40,7 +40,7 @@
python main.py --chrome --business-account
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --business-account
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --business-account
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -64,7 +64,7 @@
python main.py --chrome --account --custom-email-api
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --account --custom-email-api
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --account --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down Expand Up @@ -95,7 +95,7 @@
python main.py --chrome --business-account --custom-email-api
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --business-account --custom-email-api
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --business-account --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down
9 changes: 5 additions & 4 deletions wiki/CommandLineArguments.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
| Argument Command | Description |
| --------------------- | ---------------------------------------------------------------------------------------------------------- |
| --key | Generating an ESET-HOME license key (example as AGNV-XA2V-EA89-U546-UVJP)|
| --key | Generating an ESET-HOME license key (example as AGNV-XA2V-EA89-U546-UVJP) |
| --account | Generating an ESET HOME Account (To activate the free trial version) |
| --business-account | Generating an ESET BUSINESS Account (To huge businesses) - **Requires manual captcha input!!!** |
| --business-key | Generating an ESET BUSINESS Account and creating a universal license key for ESET products (1 key - 75 devices) - **Requires manual captcha input!!!** |
Expand All @@ -27,9 +27,10 @@
# Optional
| Argument Command | Description |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| --skip-update-check | Skips checking for program updates |
| --skip-update-check | Skips checking for program updates |
| --skip-webdriver-menu | Skips installation/upgrade webdrivers through the my custom wrapper (The built-in selenium-manager will be used) |
| --no-headless | Shows the browser at runtime (The browser is hidden by default, but on (Windows 7) and (enabled --business-key or --business-account options) this option is enabled by itself) |
| --no-headless | Shows the browser at runtime (The browser is hidden by default, but on (Windows 7) and (enabled --business-key or --business-account options) this option is enabled by itself) |
| --custom-browser-location {string} | Set path to the custom browser (to the binary file, useful when using non-standard releases, for example: Firefox Developer Edition, Brave) |
| --email-api {1secmail, hi2in, 10minutemail, tempmail, guerrillamail, developermail} | Specify which api to use for mail, default - developermail |
| --custom-email-api | Allows you to manually specify any email, and all work will go through it - **Requires manually read inbox and do what is described in the documentation for this argument!!!**, **Also use this argument if you are unable to generate anything using all the implemented email APIs above** |
| --custom-email-api | Allows you to manually specify any email, and all work will go through it - **Requires manually read inbox and do what is described in the documentation for this argument!!!**, **Also use this argument if you are unable to generate anything using all the implemented email APIs above** |
| --no-logo | Replaces ASCII-Art with plain text |
8 changes: 4 additions & 4 deletions wiki/KeyGenerator.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
python main.py --chrome --key
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --key
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --key
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -40,7 +40,7 @@
python main.py --chrome --business-key
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --business-key
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --business-key
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand All @@ -64,7 +64,7 @@
python main.py --chrome --key --custom-email-api
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --key --custom-email-api
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --key --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down Expand Up @@ -95,7 +95,7 @@
python main.py --chrome --business-key --custom-email-api
```
```
ESET-KeyGen_v1.4.7.0_win64.exe --chrome --business-key --custom-email-api
ESET-KeyGen_v1.4.9.3_win64.exe --chrome --business-key --custom-email-api
```
> File name is unique for each version! Do not copy the above command. This is an example!
Expand Down
2 changes: 1 addition & 1 deletion wiki/MBCI-Inferface.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

![Windows](https://github.com/rzc0d3r/ESET-KeyGen/blob/main/img/default_settings_menu.png)

Here you are greeted by a menu consisting of 9 items (they're all from [CommandLineArguments.md](https://github.com/rzc0d3r/ESET-KeyGen/blob/main/wiki/CommandLineArguments.md)):
Here you are greeted by a menu consisting of items (they're from [CommandLineArguments.md](https://github.com/rzc0d3r/ESET-KeyGen/blob/main/wiki/CommandLineArguments.md)):

* Arguments that have a signature **(selected: ___)** expect you to select from a list that opens when you select the corresponding item
* Arguments with a caption **(saved: ___)** expect you to enter data, the input field will be available when the corresponding item is selected (If you enter a **file path**, remove the **quotation marks!!!**)
Expand Down

0 comments on commit f18eb0b

Please sign in to comment.