main 9ef4ab947916 cached
29 files
810.3 KB
242.8k tokens
215 symbols
1 requests
Download .txt
Showing preview only (834K chars total). Download the full file or copy to clipboard to get everything.
Repository: ssovit/x-gorogn-khronos-argus-ladon
Branch: main
Commit: 9ef4ab947916
Files: 29
Total size: 810.3 KB

Directory structure:
gitextract_k22q0caq/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── Aptfile
├── LICENSE
├── Procfile
├── README.md
├── example/
│   ├── comment.py
│   ├── gorgon.py
│   └── like_video.py
├── lib/
│   ├── ByteBuf.py
│   ├── Captcha.py
│   ├── Simon.py
│   ├── Sm3.py
│   ├── TTEncrypt.js
│   ├── TTEncrypt.py
│   ├── XArgus.py
│   ├── XGorgon.py
│   ├── XLadon.py
│   ├── Xlog.py
│   ├── aweme_v2_pb2.py
│   ├── colorit.py
│   ├── pkcs7_padding.py
│   ├── protobuf.py
│   ├── sign.py
│   └── utils.py
├── main.py
├── requirements.txt
├── run.sh
└── runtime.txt

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/FUNDING.yml
================================================
custom: https://pay.oxapay.com/43013861


================================================
FILE: .gitignore
================================================
/__pycache__/*
*.py[cod]

================================================
FILE: Aptfile
================================================
libsm6
libxrender1
libfontconfig1
libice6

================================================
FILE: LICENSE
================================================
MIT License

Copyright (c) 2023 Everbody

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


================================================
FILE: Procfile
================================================
web: uvicorn main:app --host 0.0.0.0 --port ${PORT:-5000}


================================================
FILE: README.md
================================================
# TikTok Algorithms (X-Gorgon, X-Khronos, XLOG 02, TTEncrypt 05, X-Argus, X-Ladon)

These are just few of TikTok algorithms that is used by the mobile application. It might be useful for your next TikTok project.

---

## 💖 Support the Project

If you find this project helpful and want to support its development, feel free to donate via crypto:

[![Donate](https://img.shields.io/badge/Donate-OxaPay-blue?logo=bitcoin&style=for-the-badge)](https://pay.oxapay.com/43013861)

- **BTC:** `1KA78sxnqEYPdni4txdieGJzVkH8AEn9dy`
- **ETH:** `0xfbfe8b8123572510413b10a0eda3819f29cdbf2b`
- **USDT (TRC20):** `TDDZi86Karm6d6dVWjbjtJXkTgjGaCcPFW`

Your support helps me keep this project alive and updated. Thank you!

---
[![Discord](https://discord.com/api/guilds/820856055936188456/widget.png?style=banner4)](https://discord.gg/XBHydWEYZZ)
---

## Contains?
- X-Gorgon and X-Khronos v0404
- XLOG 02 encrypt/decrypt
- TTEncrypt (also often called Device Register/Applog) encrypt/decrypt
- Captcha Solver
- X-Argus
- X-Ladon

## Requirements
- Check `requirements.txt`
- Some dependencies might be missing

## How to use?
- `pip install -r requirements.txt`
- `uvicorn main:app --reload --host 0.0.0.0 --port 8100`
- You now have FastAPI rest client on port 8100 (http://127.0.0.1:8100)

See `main.py` file and see usage example of each algorithm implementations.

## Want to contribute?

Sure, make a pull request.

[![IPRoyal](assets/proxy.jpg)](https://iproyal.com/?r=ttproxy)

---

## 🙏 Donations

Even a small contribution makes a big difference!

[![Donate](https://img.shields.io/badge/Donate-OxaPay-blue?logo=bitcoin&style=for-the-badge)](https://pay.oxapay.com/43013861)

- **BTC:** `1KA78sxnqEYPdni4txdieGJzVkH8AEn9dy`
- **ETH:** `0xfbfe8b8123572510413b10a0eda3819f29cdbf2b`
- **USDT (TRC20):** `TDDZi86Karm6d6dVWjbjtJXkTgjGaCcPFW`

---

## Disclaimer

Won't be responsible if used this for other purposes than educational. 

Again, **USE THIS FOR EDUCATIONAL PURPOSES ONLY**


================================================
FILE: example/comment.py
================================================
from urllib.parse import urlencode

import requests
from lib.sign import Sign
from lib.utils import getUNIX, md5stub



ts=getUNIX(False)
rticket=getUNIX(True)

params = f"os_api=25&device_type=SM-G930F&ssmix=a&manifest_version_code=2019091803&dpi=560&carrier_region=FR&uoo=0&region=US&carrier_region_v2=208&app_name=musical_ly&version_name=13.1.3&timezone_offset=3600&ts={ts}&ab_version=13.1.3&pass-route=1&pass-region=1&is_my_cn=0&ac2=wifi5g&ac=wifi&app_type=normal&channel=googleplay&update_version_code=2019091803&_rticket={rticket}&device_platform=android&iid=7510095057765779205&build_number=13.1.3&locale=en&version_code=130103&timezone_name=Europe%2FParis&openudid=4574be359e497627&device_id=7510093320766195206&sys_region=US&app_language=en&resolution=1440*2560&device_brand=samsung&language=en&os_version=7.1.2&aid=1233&mcc_mnc=20801"

body = urlencode({"aweme_id":"7526560697086446903","text":"Good sloth"})

headers = Sign(params,headers={
            'x-ss-req-ticket': str(getUNIX(True)),
            'x-ss-stub': md5stub(body),
            'Passport-Sdk-Version': '19',
            'Sdk-Version': '2',
            'Multi_login': '1',
            'X-Tt-Dm-Status': 'login=1;ct=1;rt=1',
            'X-Vc-Bdturing-Sdk-Version': '2.3.4.i18n',
            'X-Tt-Store-Region': 'au',
            'X-Tt-Store-Region-Src': 'uid',
            'User-Agent': f'com.zhiliaoapp.musically/320905 (Linux; U; Android 7.1.2; en_US; SM-G930F; Build/RP1A.200720.012;tt-ok/3.12.13.4-tiktok)',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            "X-Tt-Token":"03b418a67a6f330e3c87c997d3a38af867023f0760b696f42bba7d96dacae6b19662092940559e7afad8ffd53f037622d37abbebc81abcec97e25240925d43c47ad885f4cb0dd55269a329efa3c2526a9aff1126210ccf8da8a1f987df9a6139219b7--0a4e0a20663952d025253e148fea701c7f766f0a8477d42d86be6c83a33ad64fd12acd021220ee34645304f22a3dd8ca168149a70260df7076122e6bf54b05959254ee5245311801220674696b746f6b-3.0.0", # Replace with your TT Token
            "Cookie":"sessionid="
        })
response = requests.post(
            f'https://api16-normal-c-alisg.tiktokv.com/aweme/v1/comment/publish/?{params}',
            headers=headers,
            data=body,
            #proxies={'http': 'http://' + select_proxy, 'https': 'http://' + select_proxy}
        )
print(response.text)

================================================
FILE: example/gorgon.py
================================================
from ..lib.XGorgon import XGorgon

xg = XGorgon()
headers= xg.calculate("aweme_id=6948740634060639493&os_api=25&device_type=SM-G930F&ssmix=a&manifest_version_code=2019091803&dpi=560&carrier_region=FR&uoo=0&region=US&carrier_region_v2=208&app_name=musical_ly&version_name=13.1.3&timezone_offset=3600&ts=1569407751&ab_version=13.1.3&pass-route=1&pass-region=1&is_my_cn=0&ac2=wifi5g&ac=wifi&app_type=normal&channel=googleplay&update_version_code=2019091803&_rticket=1569407751490&device_platform=android&iid=6740283443298715398&build_number=13.1.3&locale=en&version_code=130103&timezone_name=Europe%2FParis&openudid=d65d0efd4bbd2ae8&device_id=6740283146010527238&sys_region=US&app_language=en&resolution=1440*2560&device_brand=samsung&language=en&os_version=7.1.2&aid=1233&mcc_mnc=20801", {"Cookie":"sessionid="})
print(headers)

================================================
FILE: example/like_video.py
================================================
from urllib.parse import urlencode

import requests
from lib.sign import Sign
from lib.utils import getUNIX, md5stub



ts=getUNIX(False)
rticket=getUNIX(True)

params = f"type=1&channel_id=1&enter_from=homepage_follow&aweme_id=7526560697086446903&os_api=25&device_type=SM-G930F&ssmix=a&manifest_version_code=2019091803&dpi=560&carrier_region=FR&uoo=0&region=US&carrier_region_v2=208&app_name=musical_ly&version_name=13.1.3&timezone_offset=3600&ts={ts}&ab_version=13.1.3&pass-route=1&pass-region=1&is_my_cn=0&ac2=wifi5g&ac=wifi&app_type=normal&channel=googleplay&update_version_code=2019091803&_rticket={rticket}&device_platform=android&iid=7510095057765779205&build_number=13.1.3&locale=en&version_code=130103&timezone_name=Europe%2FParis&openudid=4574be359e497627&device_id=7510093320766195206&sys_region=US&app_language=en&resolution=1440*2560&device_brand=samsung&language=en&os_version=7.1.2&aid=1233&mcc_mnc=20801"

body = urlencode({})

headers = Sign(params,headers={
            'x-ss-req-ticket': str(getUNIX(True)),
            'x-ss-stub': md5stub(body),
            'Passport-Sdk-Version': '19',
            'Sdk-Version': '2',
            'Multi_login': '1',
            'X-Tt-Dm-Status': 'login=1;ct=1;rt=1',
            'X-Vc-Bdturing-Sdk-Version': '2.3.4.i18n',
            'X-Tt-Store-Region': 'au',
            'X-Tt-Store-Region-Src': 'uid',
            'User-Agent': f'com.zhiliaoapp.musically/320905 (Linux; U; Android 7.1.2; en_US; SM-G930F; Build/RP1A.200720.012;tt-ok/3.12.13.4-tiktok)',
            'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
            "X-Tt-Token":"03b418a67a6f330e3c87c997d3a38af867023f0760b696f42bba7d96dacae6b19662092940559e7afad8ffd53f037622d37abbebc81abcec97e25240925d43c47ad885f4cb0dd55269a329efa3c2526a9aff1126210ccf8da8a1f987df9a6139219b7--0a4e0a20663952d025253e148fea701c7f766f0a8477d42d86be6c83a33ad64fd12acd021220ee34645304f22a3dd8ca168149a70260df7076122e6bf54b05959254ee5245311801220674696b746f6b-3.0.0", # Replace with your TT Token
            "Cookie":"sessionid="
        })
response = requests.post(
            f'https://api16-normal-c-alisg.tiktokv.com/aweme/v1/commit/item/digg/?{params}',
            headers=headers,
            data=body,
            #proxies={'http': 'http://' + select_proxy, 'https': 'http://' + select_proxy}
        )
print(response.text)

================================================
FILE: lib/ByteBuf.py
================================================
from .pkcs7_padding import pkcs7_padding_data_length
import ctypes

class ByteBuf:
    def __init__(self, data, size=None):
        if data:
            self.mem = data
        
        if size is not None:
            self.data_size = size
        elif data is not None:
            self.data_size = len(data)
        else:
            raise ValueError("Either size or data must be provided")

        self.pos = 0

    def data(self):
        return self.mem

    def size(self):
        return self.data_size

    def remove_padding(self):
        padding_size = pkcs7_padding_data_length(self.mem, self.data_size, 16)
        if padding_size == 0:
            return self.data_size
        self.data_size = padding_size
        dst = (ctypes.c_uint8 * self.data_size)()
        dst = self.mem[:self.data_size]
        self.mem = dst
        return self.mem

================================================
FILE: lib/Captcha.py
================================================
import base64

import cv2
import numpy as np


class PuzzleSolver:
    def __init__(self, base64puzzle, base64piece):
        self.puzzle = base64puzzle
        self.piece = base64piece

    def get_position(self):
        puzzle = self.__background_preprocessing()
        piece = self.__piece_preprocessing()
        matched = cv2.matchTemplate(puzzle, piece, cv2.TM_CCOEFF_NORMED)
        min_val, max_val, min_loc, max_loc = cv2.minMaxLoc(matched)
        return max_loc[0]

    def __background_preprocessing(self):
        img = self.__img_to_grayscale(self.piece)
        background = self.__sobel_operator(img)
        return background

    def __piece_preprocessing(self):
        img = self.__img_to_grayscale(self.puzzle)
        template = self.__sobel_operator(img)
        return template

    def __sobel_operator(self, img):
        scale = 1
        delta = 0
        ddepth = cv2.CV_16S

        img = cv2.GaussianBlur(img, (3, 3), 0)
        gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
        grad_x = cv2.Sobel(gray, ddepth, 1, 0, ksize=3, scale=scale, delta=delta, borderType=cv2.BORDER_DEFAULT)
        grad_y = cv2.Sobel(gray, ddepth, 0, 1, ksize=3, scale=scale, delta=delta, borderType=cv2.BORDER_DEFAULT)
        abs_grad_x = cv2.convertScaleAbs(grad_x)
        abs_grad_y = cv2.convertScaleAbs(grad_y)
        grad = cv2.addWeighted(abs_grad_x, 0.5, abs_grad_y, 0.5, 0)

        return grad

    def __img_to_grayscale(self, img):
        return cv2.imdecode(self.__string_to_image(img), cv2.IMREAD_COLOR)

    def __string_to_image(self, base64_string):
        img = base64.b64decode(base64_string)
        return np.frombuffer(img, dtype="uint8")


================================================
FILE: lib/Simon.py
================================================
from ctypes import c_ulonglong

def get_bit(val, pos):
    return 1 if val & (1 << pos) else 0

def rotate_left(v, n):
    r = (v << n) | (v >> (64 - n))
    return r & 0xffffffffffffffff

def rotate_right(v, n):
    r = (v << (64 - n)) | (v >> n) 
    return r & 0xffffffffffffffff

def key_expansion(key):
    tmp = 0
    for i in range(4, 72):
        tmp = rotate_right(key[i-1], 3)
        tmp = tmp ^ key[i-3]
        tmp = tmp ^ rotate_right(tmp, 1)
        key[i] = c_ulonglong(~key[i-4]).value ^ tmp ^ get_bit(0x3DC94C3A046D678B, (i - 4) % 62) ^ 3
    return key

def simon_dec(ct, k, c=0):
    tmp = 0
    f = 0
    key = [0] * 72

    key[0] = k[0]
    key[1] = k[1]
    key[2] = k[2]
    key[3] = k[3]

    key = key_expansion(key)

    x_i = ct[0]
    x_i1 = ct[1]

    for i in range(72-1, -1, -1):
        tmp = x_i
        f = rotate_left(x_i, 1) if c == 1 else rotate_left(x_i, 1) & rotate_left(x_i, 8)
        x_i = x_i1 ^ f ^ rotate_left(x_i, 2) ^ key[i]
        x_i1 = tmp

    pt = [x_i, x_i1]
    return pt

def simon_enc(pt, k, c=0):
    tmp = 0
    f = 0
    key = [0] * 72
    key[0] = k[0]
    key[1] = k[1]
    key[2] = k[2]
    key[3] = k[3]

    key = key_expansion(key)

    x_i = pt[0]
    x_i1 = pt[1]

    for i in range(72):
        tmp = x_i1
        f = rotate_left(x_i1, 1) if c == 1 else rotate_left(x_i1, 1) & rotate_left(x_i1, 8)
        x_i1 = x_i ^ f ^ rotate_left(x_i1, 2) ^ key[i]
        x_i = tmp

    ct = [x_i, x_i1]
    return ct



================================================
FILE: lib/Sm3.py
================================================
class SM3:
    def __init__(self) -> None:
        self.IV = [1937774191, 1226093241, 388252375, 3666478592, 2842636476, 372324522, 3817729613, 2969243214]
        self.TJ = [2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2043430169, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042, 2055708042]
    
    def __rotate_left(self, a: int, k: int) -> int:
        k = k % 32

        return ((a << k) & 0xFFFFFFFF) | ((a & 0xFFFFFFFF) >> (32 - k))

    def __FFJ(self, X: int, Y: int, Z: int, j: int) -> int:

        if 0 <= j and j < 16:
            ret = X ^ Y ^ Z
        elif 16 <= j and j < 64:
            ret = (X & Y) | (X & Z) | (Y & Z)

        return ret

    def __GGJ(self, X: int, Y: int, Z: int, j: int) -> int:

        if 0 <= j and j < 16:
            ret = X ^ Y ^ Z
        elif 16 <= j and j < 64:
            ret = (X & Y) | ((~X) & Z)

        return ret

    def __P_0(self, X: int) -> int:
        return X ^ (self.__rotate_left(X, 9)) ^ (self.__rotate_left(X, 17))

    def __P_1(self, X: int) -> int:
        Z = X ^ (self.__rotate_left(X, 15)) ^ (self.__rotate_left(X, 23))

        return Z

    def __CF(self, V_i: list, B_i: bytearray) -> list:

        W = []
        for i in range(16):
            weight = 0x1000000
            data = 0
            for k in range(i * 4, (i + 1) * 4):
                data = data + B_i[k] * weight
                weight = int(weight / 0x100)
            W.append(data)

        for j in range(16, 68):
            W.append(0)
            W[j] = (
                self.__P_1(W[j - 16] ^ W[j - 9] ^ (self.__rotate_left(W[j - 3], 15)))
                ^ (self.__rotate_left(W[j - 13], 7))
                ^ W[j - 6]
            )

        W_1 = []
        for j in range(0, 64):
            W_1.append(0)
            W_1[j] = W[j] ^ W[j + 4]

        A, B, C, D, E, F, G, H = V_i

        for j in range(0, 64):

            SS1 = self.__rotate_left(
                ((self.__rotate_left(A, 12)) + E + (self.__rotate_left(self.TJ[j], j)))
                & 0xFFFFFFFF,
                7,
            )

            SS2 = SS1 ^ (self.__rotate_left(A, 12))
            TT1 = (self.__FFJ(A, B, C, j) + D + SS2 + W_1[j]) & 0xFFFFFFFF
            TT2 = (self.__GGJ(E, F, G, j) + H + SS1 + W[j]) & 0xFFFFFFFF
            D = C
            C = self.__rotate_left(B, 9)
            B = A
            A = TT1
            H = G
            G = self.__rotate_left(F, 19)
            F = E
            E = self.__P_0(TT2)

        return [
            A & 0xFFFFFFFF ^ V_i[0],
            B & 0xFFFFFFFF ^ V_i[1],
            C & 0xFFFFFFFF ^ V_i[2],
            D & 0xFFFFFFFF ^ V_i[3],
            E & 0xFFFFFFFF ^ V_i[4],
            F & 0xFFFFFFFF ^ V_i[5],
            G & 0xFFFFFFFF ^ V_i[6],
            H & 0xFFFFFFFF ^ V_i[7],
        ]

    def sm3_hash(self, msg: bytes) -> bytes:
        msg = bytearray(msg)
        len1 = len(msg)
        reserve1 = len1 % 64
        msg.append(0x80)
        reserve1 = reserve1 + 1
        # 56-64, add 64 byte
        range_end = 56
        if reserve1 > range_end:
            range_end += 64

        for i in range(reserve1, range_end):
            msg.append(0x00)

        bit_length = (len1) * 8
        bit_length_str = [bit_length % 0x100]
        for i in range(7):
            bit_length = int(bit_length / 0x100)
            bit_length_str.append(bit_length % 0x100)
        for i in range(8):
            msg.append(bit_length_str[7 - i])

        group_count = round(len(msg) / 64)

        B = []
        for i in range(0, group_count):
            B.append(msg[i * 64 : (i + 1) * 64])

        V = []
        V.append(self.IV)
        for i in range(0, group_count):
            V.append(self.__CF(V[i], B[i]))

        y = V[i + 1]
        res = b""

        for i in y:
            res += int(i).to_bytes(4, "big")

        return res

================================================
FILE: lib/TTEncrypt.js
================================================
class TT {
  __content = [];
  __content_raw = [];
  CF = 0;
  begining = [0x74, 0x63, 0x05, 0x10, 0, 0];
  dword_0 = [
    99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118,
    202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114,
    192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49,
    21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9,
    131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209,
    0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170,
    251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143,
    146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236,
    95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34,
    42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6,
    36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213,
    78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166,
    180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3,
    246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217,
    142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230,
    66, 104, 65, 153, 45, 15, 176, 84, 187, 22,
  ];
  dword_1 = [
    16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824,
    2147483648, 452984832, 905969664,
  ];
  dword_2 = [
    0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554,
    708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108,
    1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990,
    4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216,
    2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058,
    3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343,
    3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029,
    3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995,
    899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682,
    1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444,
    1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147,
    2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269,
    3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775,
    1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265,
    1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835,
    92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566,
    1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884,
    101039829, 135050206, 437757123, 337553864, 1042385657, 807962610,
    573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024,
    2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182,
    4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980,
    1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472,
    1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354,
    159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380,
    3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550,
    3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648,
    4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073,
    2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895,
    4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213,
    2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075,
    1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761,
    841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234,
    4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144,
    2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406,
    3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436,
    875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562,
    1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056,
    933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808,
    496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806,
    1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516,
    3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154,
    2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232,
    2370213795,
  ];
  dword_3 = [
    0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694,
    824852259, 1483753576, 1400783205, 1315723890, 1164071807, 1950903388,
    2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410,
    2918353863, 2631447780, 2547432937, 2328143614, 2177544179, 3901806776,
    3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918,
    3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543,
    1559041666, 1107234197, 1257309336, 598438867, 681933534, 901210569,
    1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355,
    3224740454, 3710368113, 3593056380, 3875770207, 3960309330, 4045380933,
    4195456072, 2471224067, 2554718734, 2237133081, 2388260884, 3212035895,
    3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975,
    3955191162, 3667219033, 3516619604, 3431546947, 3347532110, 2933734917,
    2782082824, 3099667487, 3016697106, 2196052529, 2313884476, 2499348523,
    2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409,
    1635502980, 2087309459, 2003294622, 507358933, 355706840, 136428751,
    53458370, 839224033, 957055980, 605657339, 790073846, 2373340630,
    2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216,
    3160175349, 3573941694, 3725069491, 3273267108, 3356761769, 4181598602,
    4063242375, 4011996048, 3828103837, 1033297158, 915985419, 730517276,
    545572369, 296679730, 446754879, 129166120, 213705253, 1709610350,
    1860738147, 1945798516, 2029293177, 1239331162, 1120974935, 1606591296,
    1422699085, 4148292826, 4233094615, 3781033664, 3931371469, 3682191598,
    3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840,
    2988687269, 2198438022, 2282195339, 2501218972, 2652609425, 1201765386,
    1286567175, 1371368976, 1521706781, 1805211710, 1620529459, 2105887268,
    1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403,
    636813900, 788204353, 2358957921, 2274680428, 2592523643, 2441661558,
    2695033685, 2880240216, 3065962831, 3182487618, 3572145929, 3756299780,
    3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378,
    1014646705, 930369212, 711349675, 560487590, 272786309, 457992840,
    106852767, 223377554, 1678381017, 1862534868, 1914052035, 2031621326,
    1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114,
    401639597, 486441376, 768917123, 651868046, 1003007129, 818324884,
    1503449823, 1385356242, 1333838021, 1150208456, 1973745387, 2125135846,
    1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696,
    2637442643, 2520393566, 2334669897, 2149987652, 3917234703, 3799141122,
    4284502037, 4100872472, 3309594171, 3460984630, 3545789473, 3629546796,
    2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517,
    1075025698, 1260232239, 575138148, 692707433, 878443390, 1062597235,
    243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545,
    3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663,
    2460449204, 2578018489, 2226875310, 2411029155, 3198115200, 3046200461,
    2827177882, 2743944855,
  ];
  dword_4 = [
    0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294,
    590424639, 1750626376, 1699970625, 1917742170, 2135253587, 1551124588,
    1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250,
    3350065803, 3835484340, 3919042237, 4270507174, 4085369519, 3102249176,
    3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278,
    2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663,
    2187128086, 2504130317, 2555048196, 3542330227, 3727205754, 3375740769,
    3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195,
    1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173,
    1224348052, 59984867, 244860394, 428169201, 344873464, 935293895, 984907214,
    766078933, 547512796, 1844882806, 1627235199, 2011214180, 2062270317,
    1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239,
    532201772, 313773861, 830661914, 1015671571, 731183368, 648017665,
    3175501286, 2957853679, 2807058932, 2858115069, 2305455554, 2220981195,
    2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725,
    3778151818, 3963161475, 4213447064, 4130281361, 3599595085, 3683022916,
    3432737375, 3247465558, 3802222185, 4020912224, 4172763771, 4122762354,
    3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200,
    2431590963, 2648976442, 104699613, 188127444, 472615631, 287343814,
    840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892,
    1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050,
    3673637356, 3623636965, 3235995134, 3454686199, 4007360968, 3822090177,
    4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199,
    2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165,
    273792366, 492483431, 1047239000, 861968209, 612205898, 695634755,
    1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833,
    1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228,
    1436590835, 1487645946, 1337376481, 1119727848, 164948639, 81781910,
    331544205, 516552836, 1039717051, 821288114, 669961897, 719700128,
    2973530695, 3157750862, 2871682645, 2787207260, 2232435299, 2283490410,
    2667994737, 2450346104, 3647212047, 3564045318, 3279033885, 3464042516,
    3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539,
    2904027272, 2686254721, 2200818878, 2384911031, 2570832044, 2486224549,
    3747192018, 3528626907, 3310321856, 3359936201, 3950355702, 3867060991,
    4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081,
    1402811438, 1586903591, 1233856572, 1149249077, 266959938, 48394827,
    369057872, 418672217, 1002783846, 919489135, 567498868, 752375421,
    209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663,
    793451934, 1679968233, 1764313568, 2117360635, 1933530610, 1343127501,
    1560637892, 1243112415, 1192455638, 3704280881, 3519142200, 3336358691,
    3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009,
    3113855344, 2927934315, 2744104290, 2159976285, 2377486676, 2594734927,
    2544078150,
  ];
  dword_5 = [
    0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204,
    1059270954, 1214797936, 1097159550, 1517440620, 1400849762, 1817998408,
    1699839814, 2118541908, 2001430874, 2429595872, 2581445614, 2194319100,
    2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816,
    3518358430, 3399679628, 3283088770, 4237083816, 4118925222, 4002861748,
    3885750714, 1002142683, 850817237, 698445255, 548169417, 529487843,
    377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439,
    1757691577, 1474760595, 1592394909, 1174215055, 1290801793, 2875968315,
    2724642869, 3111247143, 2960971305, 2405426947, 2253581325, 2638606623,
    2487810577, 3808662347, 3926825029, 4044981591, 4162096729, 3342319475,
    3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905,
    1836772287, 1381620373, 1532285339, 1078185097, 1229899655, 1040559837,
    923313619, 740276417, 621982671, 439452389, 322734571, 137073913, 19308535,
    3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555,
    3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895,
    2330014213, 2213296395, 2566595609, 2448830231, 1305906550, 1155237496,
    1607244650, 1455525988, 1776460110, 1626319424, 2079897426, 1928707164,
    96392454, 213114376, 396673818, 514443284, 562755902, 679998000, 865136418,
    983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110,
    4030667424, 3945269170, 3794078908, 2507040230, 2623762152, 2272556026,
    2390325492, 2975484382, 3092726480, 2738905026, 2857194700, 3973773121,
    3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453,
    3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017,
    2307622919, 2459735317, 2610011675, 2081048481, 1963412655, 1846563261,
    1729977011, 1480485785, 1362321559, 1243905413, 1126790795, 878845905,
    1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243,
    3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116,
    3780097726, 3896688048, 2668221674, 2516901860, 2366882550, 2216610296,
    3141400786, 2989552604, 2837966542, 2687165888, 1202797690, 1320957812,
    1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584,
    265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814,
    821712160, 2595684844, 2478443234, 2293045232, 2174754046, 3196267988,
    3079546586, 2895723464, 2777952454, 3537852828, 3687994002, 3234156416,
    3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692,
    57326082, 410887952, 292596766, 777231668, 660510266, 1011452712, 893681702,
    1108339068, 1258480242, 1343618912, 1494807662, 1715193156, 1865862730,
    1948373848, 2100090966, 2701949495, 2818666809, 3004591147, 3122358053,
    2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233,
    4219352155, 4067639125, 3444575871, 3294430577, 3746175075, 3594982253,
    836553431, 953270745, 600235211, 718002117, 367585007, 484830689, 133361907,
    251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495,
    1418573201, 1335535747, 1184342925,
  ];
  dword_6 = [
    3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157,
    3731845041, 2445657428, 1613770832, 33620227, 3462883241, 1445669757,
    3892248089, 3050821474, 1303096294, 3967186586, 2412431941, 528646813,
    2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307,
    1101901292, 3017069671, 1604494077, 1169141738, 597466303, 1403299063,
    3832705686, 2613100635, 1974974402, 3791519004, 1033081774, 1277568618,
    1815492186, 2118074177, 4126668546, 2211236943, 1748251740, 1369810420,
    3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767,
    134480908, 2512897874, 1176707941, 2646852446, 806885416, 932615841,
    168101135, 798661301, 235341577, 605164086, 461406363, 3756188221,
    3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174,
    1479289972, 874125870, 907746093, 3698224818, 3025820398, 1537253627,
    2756858614, 1983593293, 3084310113, 2108928974, 1378429307, 3722699582,
    1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264,
    3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945,
    1916352843, 2487896798, 2555137236, 2958579944, 2244988746, 3151024235,
    3320835882, 1336584933, 3992714006, 2252555205, 2588757463, 1714631509,
    293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160,
    2017213508, 631218106, 1269344483, 2723238387, 1571005438, 2151694528,
    93294474, 1066570413, 563977660, 1882732616, 4059428100, 1673313503,
    2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118,
    3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505,
    899127202, 2286175436, 773265209, 2479146071, 1437050866, 4236148354,
    2050833735, 3362022572, 3126681063, 840505643, 3866325909, 3227541664,
    427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963,
    193497219, 2353415882, 3354324521, 1807268051, 672404540, 2816401017,
    3160301282, 369822493, 2916866934, 3688947771, 1681011286, 1949973070,
    336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085,
    3184776046, 1135389935, 3294782118, 965841320, 831886756, 3554993207,
    4068047243, 3588745010, 2345191491, 1849112409, 3664604599, 26054028,
    2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743,
    3488279077, 3395642799, 4101667470, 1202630377, 268961816, 1874508501,
    4034427016, 1243948399, 1546530418, 941366308, 1470539505, 1941222599,
    2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021,
    1639824860, 227249030, 260737669, 3765465232, 2084453954, 1907733956,
    3429263018, 2420656344, 100860677, 4160157185, 470683154, 3261161891,
    1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535,
    664706745, 3655459128, 3958962195, 731420851, 571543859, 3530123707,
    2849626480, 126783113, 865375399, 765172662, 1008606754, 361203602,
    3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671,
    1503764984, 160008576, 437062935, 1707065306, 3622233649, 2218934982,
    3496503480, 2185314755, 697932208, 1512910199, 504303377, 2075177163,
    2824099068, 1841019862, 739644986,
  ];
  dword_7 = [
    2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027,
    2984144751, 1418839493, 1348481072, 50462977, 2848876391, 2102799147,
    434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938,
    1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592,
    3963727277, 1739838676, 4250903202, 3930435503, 3206782108, 4149453988,
    2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398,
    1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525,
    886171109, 150598129, 2481090929, 1940642008, 1398944049, 1059722517,
    201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806,
    252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786,
    651029483, 1766729511, 3447698098, 2682942837, 454166793, 2652734339,
    1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112,
    4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187,
    1901997871, 2534638724, 4121318227, 1757008337, 0, 750906861, 1614815264,
    535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910,
    1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800,
    717615087, 3847203498, 384695291, 3313910595, 3617213773, 1432761139,
    2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160,
    1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528,
    2315620239, 2906624658, 3156319645, 1215313976, 82966005, 3747855548,
    3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083,
    1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855,
    2721421207, 3431482436, 959321879, 1469301956, 4065699751, 2197585534,
    1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144,
    2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568,
    2198571144, 3398190662, 700968686, 3547052216, 1009259540, 2041044702,
    3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930,
    504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170,
    1857934291, 4014189740, 2797888098, 2822345105, 2754712981, 936633572,
    2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013,
    1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468,
    634383082, 2949277029, 2398386810, 3913789102, 403703816, 3580869306,
    2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884,
    1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411,
    3697393085, 2249034635, 2232388234, 2430627952, 1115438654, 3295786421,
    2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121,
    1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965,
    3106381470, 953803233, 334231800, 3005978776, 857870609, 3151128937,
    1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487,
    550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476,
    4166623649, 2148108681, 387583245, 3664101311, 836232934, 3330556482,
    3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008,
    4238890068, 3597515707, 975967766,
  ];
  dword_8 = [
    1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307,
    1873927791, 3310653893, 810573872, 16974337, 1739181671, 729634347,
    4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298,
    3376449993, 2106063485, 4195741690, 1508618841, 1204391495, 4027317232,
    2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228,
    1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518,
    911895606, 1061256767, 4144166391, 3427763148, 878471220, 2784252325,
    3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077,
    67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926,
    84871685, 2595565466, 118033927, 305538066, 2157648768, 3795705826,
    3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539,
    745822252, 439235610, 455947803, 1857215598, 1525593178, 2700827552,
    1391895634, 994932283, 3596728278, 3016654259, 695947817, 3812548067,
    795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784,
    4229948412, 2982705585, 1542305371, 1790891114, 3410398667, 3201918910,
    961245753, 1256100938, 1289001036, 1491644504, 3477767631, 3496721360,
    4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739,
    2241073541, 1171229253, 4178635257, 33948674, 2139225727, 1357946960,
    1011120188, 2679776671, 2833468328, 1374921297, 2751356323, 1086357568,
    2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668,
    3066132406, 3665145818, 560153121, 271589392, 4279952895, 4077846003,
    3530407890, 3444343245, 202643468, 322250259, 3962553324, 1608629855,
    2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534,
    1028094525, 1689045092, 1575467613, 422261273, 1939203699, 1621147744,
    2174228865, 1339137615, 3699352540, 577127458, 712922154, 2427141008,
    2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782,
    1591917662, 186455563, 3681988059, 3762019296, 844522546, 978220090,
    169743370, 1239126601, 101321734, 611076132, 1558493276, 3260915650,
    3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972,
    2039214713, 3878868455, 3359869896, 928607799, 1840765549, 2374762893,
    3580146133, 1322425422, 2850048425, 1823791212, 1459268694, 4094161908,
    3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946,
    2022240376, 628050469, 779246638, 472135708, 2800834470, 3032970164,
    3327236038, 3894660072, 3715932637, 1956440180, 522272287, 1272813131,
    3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261,
    1722469478, 1222152264, 50660867, 4127324150, 236067854, 1638122081,
    895445557, 1475980887, 3117443513, 2257655686, 3243809217, 489110045,
    2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777,
    3648039385, 2391345038, 2493985684, 2612407707, 505560094, 2274497927,
    3911240169, 3460925390, 1442818645, 678973480, 3749357023, 2358182796,
    2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242,
    1756942440, 1103331905, 2578459033, 762796589, 252780047, 2966125488,
    1425844308, 3151392187, 372911126,
  ];
  dword_9 = [
    1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062,
    1869591006, 3318043793, 808472672, 16843522, 1734846926, 724270422,
    4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983,
    3385409673, 2105378810, 4210693615, 1499065266, 1195886990, 4042263547,
    2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643,
    1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788,
    909531756, 1061110142, 4160160501, 3435941763, 875846760, 2779116625,
    3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962,
    67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071,
    84217610, 2593830191, 117901582, 303183396, 2155911963, 3806477791,
    3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989,
    741110872, 437923380, 454765878, 1852748508, 1515908788, 2694904667,
    1381168804, 993742198, 3604373943, 3014905469, 690584402, 3823320797,
    791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704,
    4244381667, 2981218425, 1532751286, 1785380564, 3419096717, 3200178535,
    960056178, 1246420628, 1280103576, 1482221744, 3486468741, 3503319995,
    4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214,
    2240123921, 1162203018, 4193849577, 33687044, 2139062782, 1347481760,
    1010582648, 2678045221, 2829640523, 1364325282, 2745433693, 1077985408,
    2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563,
    3065430391, 3671750063, 555836226, 269496352, 4294908645, 4092792573,
    3537006015, 3452783745, 202118168, 320025894, 3974901699, 1600119230,
    2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284,
    1027426170, 1684319432, 1566435258, 421079858, 1936954854, 1616945344,
    2172753945, 1330631070, 3705438115, 572679748, 707427924, 2425400123,
    2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087,
    1583276732, 185277718, 3688593069, 3772791771, 842159716, 976899700,
    168435220, 1229577106, 101059084, 606366792, 1549591736, 3267517855,
    3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747,
    2038008818, 3890688725, 3368567691, 926374254, 1835907034, 2374863873,
    3587531953, 1313788572, 2846482505, 1819063512, 1448540844, 4109633523,
    3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511,
    2021165296, 623210314, 774795868, 471606328, 2795958615, 3031746419,
    3334885783, 3907527627, 3722280097, 1953799400, 522133822, 1263263126,
    3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401,
    1718004428, 1212733584, 50529542, 4143317495, 235803164, 1633788866,
    892690282, 1465383342, 3115962473, 2256965911, 3250673817, 488449850,
    2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042,
    3654906025, 2391705863, 2492770099, 2610673197, 505291324, 2273808917,
    3924369609, 3469625735, 1431699370, 673740880, 3755965093, 2358021891,
    2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452,
    1751693520, 1094828930, 2576986153, 757954394, 252645662, 2964376443,
    1414855848, 3149649517, 370555436,
  ];
  LIST_6B0 = [
    4089235720, 1779033703, 2227873595, 3144134277, 4271175723, 1013904242,
    1595750129, 2773480762, 2917565137, 1359893119, 725511199, 2600822924,
    4215389547, 528734635, 327033209, 1541459225,
  ];
  ord_list = [
    77, 212, 194, 230, 184, 49, 98, 9, 14, 82, 179, 199, 166, 115, 59, 164, 28,
    178, 70, 43, 130, 154, 181, 138, 25, 107, 57, 219, 87, 23, 117, 36, 244,
    155, 175, 127, 8, 232, 214, 141, 38, 167, 46, 55, 193, 169, 90, 47, 31, 5,
    165, 24, 146, 174, 242, 148, 151, 50, 182, 42, 56, 170, 221, 88,
  ];
  rodata = [
    3609767458, 1116352408, 602891725, 1899447441, 3964484399, 3049323471,
    2173295548, 3921009573, 4081628472, 961987163, 3053834265, 1508970993,
    2937671579, 2453635748, 3664609560, 2870763221, 2734883394, 3624381080,
    1164996542, 310598401, 1323610764, 607225278, 3590304994, 1426881987,
    4068182383, 1925078388, 991336113, 2162078206, 633803317, 2614888103,
    3479774868, 3248222580, 2666613458, 3835390401, 944711139, 4022224774,
    2341262773, 264347078, 2007800933, 604807628, 1495990901, 770255983,
    1856431235, 1249150122, 3175218132, 1555081692, 2198950837, 1996064986,
    3999719339, 2554220882, 766784016, 2821834349, 2566594879, 2952996808,
    3203337956, 3210313671, 1034457026, 3336571891, 2466948901, 3584528711,
    3758326383, 113926993, 168717936, 338241895, 1188179964, 666307205,
    1546045734, 773529912, 1522805485, 1294757372, 2643833823, 1396182291,
    2343527390, 1695183700, 1014477480, 1986661051, 1206759142, 2177026350,
    344077627, 2456956037, 1290863460, 2730485921, 3158454273, 2820302411,
    3505952657, 3259730800, 106217008, 3345764771, 3606008344, 3516065817,
    1432725776, 3600352804, 1467031594, 4094571909, 851169720, 275423344,
    3100823752, 430227734, 1363258195, 506948616, 3750685593, 659060556,
    3785050280, 883997877, 3318307427, 958139571, 3812723403, 1322822218,
    2003034995, 1537002063, 3602036899, 1747873779, 1575990012, 1955562222,
    1125592928, 2024104815, 2716904306, 2227730452, 442776044, 2361852424,
    593698344, 2428436474, 3733110249, 2756734187, 2999351573, 3204031479,
    3815920427, 3329325298, 3928383900, 3391569614, 566280711, 3515267271,
    3454069534, 3940187606, 4000239992, 4118630271, 1914138554, 116418474,
    2731055270, 174292421, 3203993006, 289380356, 320620315, 460393269,
    587496836, 685471733, 1086792851, 852142971, 365543100, 1017036298,
    2618297676, 1126000580, 3409855158, 1288033470, 4234509866, 1501505948,
    987167468, 1607167915, 1246189591, 1816402316,
  ];
  list_9C8 = [];
  /**
     * def aes_decrypt(self, secretKey, encoded):
        initVector = encoded[0:16]
        data = encoded[16:]
        decryptor = AES.new(secretKey, AES.MODE_CBC, initVector)
        decoded = decryptor.decrypt(data)
        return decoded[:-decoded[-1]]
     */
  aes_decrypt(secretKey, encoded) {
    let initVector = encoded.slice(0, 16);
    const data = encoded.slice(16);
    const decryptor = AES.new(secretKey, AES.MODE_CBC, initVector);
    const decoded = decryptor.decrypt(data);
    return decoded.slice(0, -decoded.slice(-1));
  }
  /**def bytearray_decode(self, arrays):
        out = []
        for d in arrays:
            out.append(chr(d))
        return "".join(out)
         */
  bytearray_decode(arrays) {
    let out = [];
    for (let d of arrays) {
      out.push(String.fromCharCode(d));
    }
    return out.join("");
  }
  /**
     * def changeLongArrayTobytes(self, array):
        result = []
        for i in range(len(array)):
            if array[i] > 127:
                result.append(array[i] - 256)
            else:
                result.append(array[i])
        return result
     */
  changeLongArrayTobytes(array) {
    let result = [];
    for (let i in array) {
      if (array[i] > 127) {
        result.push(array[i] - 256);
      } else {
        result.push(array[i]);
      }
    }
    return result;
  }

  /**
     * def toHex(self, num):
        return format(int(num), "x")
     */

  toHex(num) {
    return num.toString(16);
  }
  /**
     * def parseLong(self, num, to_base=10, from_base=10):
        if isinstance(num, str):
            n = int(num, from_base)
        else:
            n = int(num)
        alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        if n < to_base:
            return alphabet[n]
        else:
            return self.parseLong(n // to_base, to_base) + alphabet[n % to_base]
     */
  parseLong(num, to_base = 10, from_base = 10) {
    if (num < to_base) {
      return from_base * num;
    } else {
      return (
        self.parseLong(num / to_base, to_base) + from_base * (num % to_base)
      );
    }
  }
  /**
     * def hex_list(self, content):
        result = []
        for value in content:
            tmp = self.toHex(value)
            while len(tmp) < 8:
                tmp = "0" + tmp
            for i in range(4):
                start = 2 * i
                end = 2 * i + 2
                ss = tmp[start:end]
                result.append(int(self.parseLong(ss, 10, 16)))
        return result
     */
  hex_list(content) {
    let result = [];
    for (let value of content) {
      let tmp = this.toHex(value);
      while (tmp.length < 8) {
        tmp = "0" + tmp;
      }
      for (let i = 0; i < 4; i++) {
        start = 2 * i;
        end = 2 * i + 2;
        ss = tmp.slice(start, end);
        result.push(parseInt(ss, 16));
      }
    }
    return result;
  }
  /**
     * def s2b(self, data):
        arr = []
        for i in range(len(data)):
            arr.append(data[i])
        return arr
     */
  s2b(data) {
    let arr = [];
    for (let i in data) {
      arr.push(data[i]);
    }
    return arr;
  }

  /**
     *     def chooice(self, start, end):
        return int(random.uniform(0, 1) * (end + 1 - start) + start)

     */
  chooice(start, end) {
    return Math.floor(Math.random() * (end + 1 - start) + start);
  }
  /**
     * def hex_9C8(self):
        result = []
        for i in range(32):
            result.append(self.chooice(0, 0x100))
        return result
     */
  hex_9C8() {
    let result = [];
    for (let i in range(32)) {
      result.push(this.chooice(0, 0x100));
    }
  }
  /**
     * def setData(self, data):
        self.__content_raw = data
        self.__content = data
        self.list_9C8 = self.hex_9C8()
     */
  setData(data) {
    this.__content_raw = data;
    this.__content = data;
    this.list_9C8 = this.hex_9C8();
  }
  /**
     * def toBinaryString(self, num):
        return "{0:b}".format(num)
     */
  toBinaryString(num) {
    return num.toString(2);
  }
  /**
     * def UFTX(self, num):
        tmp_string = self.toBinaryString(num)
        start = len(tmp_string) - 8
        return self.parseLong(tmp_string[start:], 10, 2)
     */
  UFTX(num) {
    let tmp_string = this.toBinaryString(num);
    let start = tmp_string.length - 8;
    return this.parseLong(tmp_string.slice(start), 10, 2);
  }

  /**
     * def UBFX(self, num, lsb, width):
        tmp_string = self.toBinaryString(num)
        while len(tmp_string) < 32:
            tmp_string = "0" + tmp_string
        lens = len(tmp_string)
        start = lens - lsb - width
        end = start - lsb
        a = int(self.parseLong(tmp_string[start:end - start], 10, 2))

        return int(self.parseLong(tmp_string[start:end - start], 10, 2))
     */
  UBFX(num, lsb, width) {
    let tmp_string = this.toBinaryString(num);
    while (tmp_string.length < 32) {
      tmp_string = "0" + tmp_string;
    }
    lens = len(tmp_string);
    start = lens - lsb - width;
    end = start - lsb;
    a = int(this.parseLong(tmp_string.slice(start, end - start), 10, 2));
    return a;
  }
  /**
     * def bin_type(self, num):
        result = ""
        num = self.check(num)
        lst = self.toBinaryString(num)
        for i in range(32):
            if i < len(lst):
                result += str(lst[i])
            else:
                result = "0" + result
        return result
     */
  bin_type(num) {
    let result = "";
    num = this.check(num);
    lst = this.toBinaryString(num);
    for (let i in lst) {
      if (i < 32) {
        result += self.str(lst[i]);
      } else {
        result = "0" + result;
      }
    }
    return result;
  }
  str(num) {
    return num.toString();
  }
  /**def check(self, tmp):
        ss = ""
        if tmp < 0:
            ss = self.toHex(4294967296 + int(tmp))
        else:
            ss = self.toHex(tmp)
        if len(ss) > 8:
            size = len(ss)
            start = size - 8
            ss = ss[start:]
            tmp = int(self.parseLong(ss, 10, 16))
        return tmp  # 3035769959     */
  check(tmp) {
    ss = "";
    if (tmp < 0) {
      ss = self.toHex(4294967296 + int(tmp));
    } else {
      ss = self.toHex(tmp);
    }
    if (ss.length > 8) {
      size = ss.length;
      start = size - 8;
      ss = ss.slice(start);
      tmp = int(self.parseLong(ss, 10, 16));
    }
    return tmp;
  }
  /**
     * def RRX(self, num):
        result = self.bin_type(num)
        lenght = len(result)
        s = str(self.CF) + result[:lenght - 1 - 0]
        return self.parseLong(s, 10, 2)
     */
  RRX(num) {
    let result = this.bin_type(num);
    let lenght = result.length;
    let s = this.CF + result.slice(0, lenght - 1 - 0);
    return this.parseLong(s, 10, 2);
  }
  /**
   * def ORRS(self, a, b):
        return self.check(a | b)
   */
  ORRS(a, b) {
    return this.check(a | b);
  }
  /**
   * def ANDRS(self, a, b):
        return self.check(a & b)
   */
  ANDRS(a, b) {
    return this.check(a & b);
  }
  /**
   * def LSRS(self, num, k):
        result = self.bin_type(num)
        self.CF = result[len(result) - k]
        return self.check(self.check(num) >> k)
   */
  LSRS(num, k) {
    let result = this.bin_type(num);
    self.CF = result[result.length - k];
    return this.check(this.check(num) >> k);
  }
  /**
   * def XORRS(self, a, b):
        return self.check(a ^ b)
   */
  XORRS(a, b) {
    return this.check(a ^ b);
  }
  /**
   * def NORRS(self, a, b):
        return self.check(a ^ b)
   */
  NORRS(a, b) {
    return this.check(a ^ b);
  }
  /**
   * def NORRS(self, a, b):
        return self.check(a ^ b)
   */
  /**
   * def LSLS(self, num, k):
        result = self.bin_type(num)
        self.CF = result[k - 1]
        return self.check(self.check(num) << k)
   */
  LSLS(num, k) {
    let result = this.bin_type(num);
    self.CF = result[k - 1];
    return this.check(this.check(num) << k);
  }
  /**
   * def ADCS(self, a, b):
        c = self.check(a) + self.check(b)
        d = self.check(c + self.CF)
        if len(self.toHex(c)) > 8:
            self.CF = 1
        else:
            self.CF = 0
        return d
   */
  ADCS(a, b) {
    let c = this.check(a) + this.check(b);
    let d = this.check(c + this.CF);
    if (this.toHex(c).length > 8) {
      this.CF = 1;
    } else {
      this.CF = 0;
    }
    return d;
  }
  /**
   * def ADC(self, a, b):

        c = self.check(a) + self.check(b)
        d = self.check(c + self.CF)
        return d
   */
  ADC(a, b) {
    let c = this.check(a) + this.check(b);
    let d = this.check(c + this.CF);
    return d;
  }
  /**
   * def EORS(self, a, b):
        return (self.check(a ^ b))
   */
  EORS(a, b) {
    return this.check(a ^ b);
  }
  /**
   * def EOR(self, a, b):
        return (self.check(a ^ b))
   */
  EOR(a, b) {
    return this.check(a ^ b);
  }
  /**
   * def ANDS(self, a, b):
        return self.check(a & b)
   */
  ANDS(a, b) {
    return this.check(a & b);
  }
  /**
 * def ADDS(self, a, b):
        c = self.check(a) + self.check(b)
        if len(self.toHex(c)) > 8:
            self.CF = 1
        else:
            self.CF = 0
        result = self.check(c)
        return result
 */
  ADDS(a, b) {
    let c = this.check(a) + this.check(b);
    if (this.toHex(c).length > 8) {
      this.CF = 1;
    } else {
      this.CF = 0;
    }
    result = this.check(c);
    return result;
  }
  /**
   * def hex_C52(self, list_6B0):
        list_8D8 = []
        for i in range(8):
            tmp = self.hex_list([list_6B0[2 * i + 1], list_6B0[2 * i]])
            list_8D8 = list_8D8 + tmp
        return list_8D8
   */
  hex_C52(list_6B0) {
    let list_8D8 = [];
    for (let i = 0; i < 8; i++) {
      tmp = this.hex_list([list_6B0[2 * i + 1], list_6B0[2 * i]]);
      list_8D8 = list_8D8 + tmp;
    }
    return list_8D8;
  }
  /**
   *     def hex_30A(self, param_list, list_3B8):
        v_3A0 = param_list[7]
        v_3A4 = param_list[6]
        v_374 = param_list[5]
        v_378 = param_list[4]
        LR = param_list[0]
        R12 = param_list[1]
        v_39C = param_list[2]
        v_398 = param_list[3]
        v_3AC = param_list[11]
        v_3A8 = param_list[10]
        R9 = param_list[12]
        R10 = param_list[13]
        R5 = param_list[9]
        R8 = param_list[8]
        R4 = param_list[15]
        R6 = param_list[14]
        for index in range(10):
            v_384 = R5
            R3 = self.rodata[0x10 * index]
            R1 = self.rodata[0x10 * index + 2]
            R2 = self.rodata[0x10 * index + 1]
            R3 = self.ADDS(R3, R6)

            R6 = self.check(R8) >> 14

            v_390 = R1
            R6 = R6 | self.check(R5) << 18

            R1 = self.rodata[0x10 * index + 3]
            R0 = self.rodata[0x10 * index + 4]
            v_36C = R0
            R0 = self.ADC(R2, R4)
            R2 = self.LSRS(R5, 0x12)
            R4 = self.LSRS(R5, 0xE)
            R2 = R2 | self.check(R8) << 14
            R4 = R4 | self.check(R8) << 18
            R2 = self.EORS(R2, R4)
            R4 = self.LSLS(R5, 0x17)
            R4 = R4 | self.check(R8) >> 9
            v_38C = R1
            R2 = self.EORS(R2, R4)
            R4 = self.check(R8) >> 18
            R4 = R4 | self.check(R5) << 14
            R6 = self.EORS(R6, R4)
            R4 = self.LSRS(R5, 9)
            R4 = R4 | self.check(R8) << 23
            v_354 = R8
            R6 = self.EORS(R6, R4)
            R3 = self.ADDS(R3, R6)
            R0 = self.ADCS(R0, R2)
            R2 = list_3B8[0x10 * index + 1]
            R2 = self.ADDS(R2, R3)
            R3 = list_3B8[0x10 * index + 3]
            R6 = list_3B8[0x10 * index]
            v_358 = R10
            R6 = self.ADCS(R6, R0)
            R0 = v_3AC
            v_360 = R3
            R0 = R0 ^ R10
            R3 = list_3B8[0x10 * index + 2]
            R0 = self.ANDS(R0, R5)
            R1 = list_3B8[0x10 * index + 5]
            R4 = R0 ^ R10
            R0 = v_3A8
            v_364 = R1
            R0 = R0 ^ R9
            R1 = v_374
            R0 = R0 & R8
            R8 = v_39C
            R0 = R0 ^ R9
            v_35C = R3
            R10 = self.ADDS(R2, R0)
            R0 = v_398
            R11 = self.ADC(R6, R4)
            R3 = v_378
            R2 = R0 | R12
            R6 = R0 & R12
            R2 = self.ANDS(R2, R1)
            R1 = R0
            R2 = self.ORRS(R2, R6)
            R6 = R8 | LR
            R6 = self.ANDS(R6, R3)
            R3 = R8 & LR
            R3 = self.ORRS(R3, R6)
            R6 = self.check(R12) << 30
            R0 = self.check(R12) >> 28
            R6 = R6 | self.check(LR) >> 2
            R0 = R0 | self.check(LR) << 4
            R4 = self.check(LR) >> 28
            R0 = self.EORS(R0, R6)
            R6 = self.check(R12) << 25
            R6 = R6 | self.check(LR) >> 7
            R4 = R4 | self.check(R12) << 4
            R0 = self.EORS(R0, R6)
            R6 = self.check(R12) >> 2
            R6 = R6 | self.check(LR) << 30
            R3 = self.ADDS(R3, R10)
            R6 = R6 ^ R4
            R4 = self.check(R12) >> 7
            R4 = R4 | self.check(LR) << 25
            R2 = self.ADC(R2, R11)
            R6 = self.EORS(R6, R4)
            v_37C = R12
            R5 = self.ADDS(R3, R6)
            R6 = self.ADC(R2, R0)
            R0 = R6 | R12
            R2 = R6 & R12
            R0 = self.ANDS(R0, R1)
            R3 = self.LSRS(R6, 0x1C)
            R0 = self.ORRS(R0, R2)
            R2 = self.LSLS(R6, 0x1E)
            R2 = R2 | self.check(R5) >> 2
            R3 = R3 | self.check(R5) << 4
            R2 = self.EORS(R2, R3)
            R3 = self.LSLS(R6, 0x19)
            R3 = R3 | self.check(R5) >> 7
            R4 = self.LSRS(R5, 0x1C)
            R3 = self.EORS(R3, R2)
            R2 = self.LSRS(R6, 2)
            R2 = R2 | self.check(R5) << 30
            R4 = R4 | self.check(R6) << 4
            R2 = self.EORS(R2, R4)
            R4 = self.LSRS(R6, 7)
            R4 = R4 | self.check(R5) << 25
            R12 = R6
            R2 = self.EORS(R2, R4)
            R4 = R5 | LR
            R4 = R4 & R8
            R6 = R5 & LR
            R4 = self.ORRS(R4, R6)
            v_388 = R5
            R5 = self.ADDS(R2, R4)
            R0 = self.ADCS(R0, R3)
            v_398 = R1
            R4 = R9
            v_350 = R0
            R0 = v_3A4
            R1 = v_3A0
            v_380 = LR
            LR = self.ADDS(R0, R10)
            R9 = self.ADC(R1, R11)
            R0 = v_3AC
            R6 = self.check(LR) >> 14
            R1 = v_384
            R3 = self.check(R9) >> 18
            R2 = self.check(R9) >> 14
            R3 = R3 | self.check(LR) << 14
            R2 = R2 | self.check(LR) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.check(R9) << 23
            R3 = R3 | self.check(LR) >> 9
            R6 = R6 | self.check(R9) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.check(LR) >> 18
            R3 = R3 | self.check(R9) << 14
            v_39C = R8
            R3 = self.EORS(R3, R6)
            R6 = self.check(R9) >> 9
            R6 = R6 | self.check(LR) << 23
            R8 = v_354
            R3 = self.EORS(R3, R6)
            R6 = R0 ^ R1
            R6 = R6 & R9
            v_370 = R12
            R6 = self.EORS(R6, R0)
            R0 = v_3A8
            R1 = R0 ^ R8
            R1 = R1 & LR
            R1 = self.EORS(R1, R0)
            R0 = v_358
            R1 = self.ADDS(R1, R4)
            R6 = self.ADCS(R6, R0)
            R0 = v_390
            R1 = self.ADDS(R1, R0)
            R0 = v_38C
            R6 = self.ADCS(R6, R0)
            R0 = v_360
            R1 = self.ADDS(R1, R0)
            R0 = v_35C
            R6 = self.ADCS(R6, R0)
            R1 = self.ADDS(R1, R3)
            R3 = self.ADC(R6, R2)
            R2 = v_350
            R0 = self.ADDS(R5, R1)
            R5 = v_37C
            R4 = self.ADC(R2, R3)
            v_390 = R4
            R2 = R4 | R12
            R6 = R4 & R12
            R2 = self.ANDS(R2, R5)
            R5 = self.LSRS(R4, 0x1C)
            R10 = R2 | R6
            R2 = self.LSLS(R4, 0x1E)
            R2 = R2 | self.check(R0) >> 2
            R5 = R5 | self.check(R0) << 4
            R2 = self.EORS(R2, R5)
            R5 = self.LSLS(R4, 0x19)
            R5 = R5 | self.check(R0) >> 7
            R6 = self.LSRS(R0, 0x1C)
            R12 = R2 ^ R5
            R2 = self.LSRS(R4, 2)
            R2 = R2 | self.check(R0) << 30
            R6 = R6 | self.check(R4) << 4
            R2 = self.EORS(R2, R6)
            R6 = self.LSRS(R4, 7)
            R4 = v_388
            R6 = R6 | self.check(R0) << 25
            R5 = v_380
            R2 = self.EORS(R2, R6)
            R6 = R0 | R4
            R4 = self.ANDS(R4, R0)
            R6 = self.ANDS(R6, R5)
            v_38C = R0
            R4 = self.ORRS(R4, R6)
            R6 = LR ^ R8
            R0 = self.ADDS(R2, R4)
            v_3A4 = R0
            R0 = self.ADC(R12, R10)
            v_3A0 = R0
            R0 = v_378
            R10 = self.ADDS(R1, R0)
            R0 = v_374
            R6 = R6 & R10
            R1 = self.ADC(R3, R0)
            R5 = self.check(R10) >> 14
            R0 = v_384
            R6 = R6 ^ R8
            R3 = self.LSRS(R1, 0x12)
            R4 = self.LSRS(R1, 0xE)
            R3 = R3 | self.check(R10) << 14
            R4 = R4 | self.check(R10) << 18
            R3 = self.EORS(R3, R4)
            R4 = self.LSLS(R1, 0x17)
            R4 = R4 | self.check(R10) >> 9
            R5 = R5 | self.check(R1) << 18
            R11 = R3 ^ R4
            R3 = self.check(R10) >> 18
            R3 = R3 | self.check(R1) << 14
            v_378 = R1
            R3 = self.EORS(R3, R5)
            R5 = self.LSRS(R1, 9)
            R5 = R5 | self.check(R10) << 23
            R3 = self.EORS(R3, R5)
            R5 = R9 ^ R0
            R5 = self.ANDS(R5, R1)
            R1 = v_3A8
            R5 = self.EORS(R5, R0)
            R0 = v_36C
            R4 = self.ADDS(R0, R1)
            R2 = self.rodata[0x10 * index + 5]
            R0 = v_3AC
            R2 = self.ADCS(R2, R0)
            R0 = v_364
            R4 = self.ADDS(R4, R0)
            R12 = list_3B8[0x10 * index + 4]
            R0 = v_3A4
            R2 = self.ADC(R2, R12)
            R6 = self.ADDS(R6, R4)
            R2 = self.ADCS(R2, R5)
            R3 = self.ADDS(R3, R6)
            R11 = self.ADC(R11, R2)
            R1 = self.ADDS(R0, R3)
            R0 = v_3A0
            R6 = v_390
            R4 = self.check(R1) >> 28
            R0 = self.ADC(R0, R11)
            R5 = v_370
            R2 = R0 | R6
            R6 = self.ANDS(R6, R0)
            R2 = self.ANDS(R2, R5)
            R5 = self.LSRS(R0, 0x1C)
            R12 = R2 | R6
            R6 = self.LSLS(R0, 0x1E)
            R6 = R6 | self.check(R1) >> 2
            R5 = R5 | self.check(R1) << 4
            R6 = self.EORS(R6, R5)
            R5 = self.LSLS(R0, 0x19)
            R5 = R5 | self.check(R1) >> 7
            R4 = R4 | self.check(R0) << 4
            R6 = self.EORS(R6, R5)
            R5 = self.LSRS(R0, 2)
            R5 = R5 | self.check(R1) << 30
            v_3AC = R0
            R5 = self.EORS(R5, R4)
            R4 = self.LSRS(R0, 7)
            R0 = v_38C
            R4 = R4 | self.check(R1) << 25
            R2 = v_388
            R5 = self.EORS(R5, R4)
            R4 = R1 | R0
            v_3A8 = R1
            R4 = self.ANDS(R4, R2)
            R2 = R1 & R0
            R2 = self.ORRS(R2, R4)
            R0 = self.ADDS(R5, R2)
            v_3A4 = R0
            R0 = self.ADC(R6, R12)
            v_3A0 = R0
            R0 = v_39C
            R2 = v_398
            R0 = self.ADDS(R0, R3)
            v_39C = R0
            R11 = self.ADC(R11, R2)
            R4 = self.LSRS(R0, 0xE)
            R3 = self.check(R11) >> 18
            R6 = self.check(R11) >> 14
            R3 = R3 | self.check(R0) << 14
            R6 = R6 | self.check(R0) << 18
            R3 = self.EORS(R3, R6)
            R6 = self.check(R11) << 23
            R6 = R6 | self.check(R0) >> 9
            R4 = R4 | self.check(R11) << 18
            R1 = self.EORS(R3, R6)
            R6 = self.LSRS(R0, 0x12)
            R6 = R6 | self.check(R11) << 14
            R3 = R10 ^ LR
            R6 = self.EORS(R6, R4)
            R4 = self.check(R11) >> 9
            R3 = self.ANDS(R3, R0)
            R4 = R4 | self.check(R0) << 23
            R5 = R6 ^ R4
            v_398 = R1
            R3 = R3 ^ LR
            R1 = v_378
            R6 = self.rodata[0x10 * index + 6]
            R12 = self.rodata[0x10 * index + 7]
            R4 = R1 ^ R9
            R0 = v_384
            R6 = self.ADDS(R6, R8)
            R4 = R4 & R11
            R12 = self.ADC(R12, R0)
            R4 = R4 ^ R9
            R8 = list_3B8[0x10 * index + 7]
            R2 = list_3B8[0x10 * index + 6]
            R6 = self.ADDS(R6, R8)
            R0 = v_398
            R2 = self.ADC(R2, R12)
            R3 = self.ADDS(R3, R6)
            R2 = self.ADCS(R2, R4)
            R6 = self.ADDS(R3, R5)
            R12 = self.ADC(R2, R0)
            R0 = v_3A4
            R4 = v_390
            R1 = self.ADDS(R0, R6)
            R0 = v_3A0
            v_384 = R1
            R5 = self.ADC(R0, R12)
            R0 = v_3AC
            R8 = self.check(R1) >> 28
            R2 = R5 | R0
            R3 = R8 | self.check(R5) << 4
            R2 = self.ANDS(R2, R4)
            R4 = R5 & R0
            R0 = R2 | R4
            R4 = self.LSLS(R5, 0x1E)
            R2 = self.LSRS(R5, 0x1C)
            R4 = R4 | self.check(R1) >> 2
            R2 = R2 | self.check(R1) << 4
            v_3A0 = R0
            R2 = self.EORS(R2, R4)
            R4 = self.LSLS(R5, 0x19)
            R4 = R4 | self.check(R1) >> 7
            R0 = v_3A8
            R2 = self.EORS(R2, R4)
            R4 = self.LSRS(R5, 2)
            R4 = R4 | self.check(R1) << 30
            R8 = R5
            R3 = self.EORS(R3, R4)
            R4 = self.LSRS(R5, 7)
            R4 = R4 | self.check(R1) << 25
            R5 = v_38C
            R3 = self.EORS(R3, R4)
            R4 = R1 | R0
            R4 = self.ANDS(R4, R5)
            R5 = R1 & R0
            R4 = self.ORRS(R4, R5)
            v_36C = R8
            R0 = self.ADDS(R3, R4)
            v_3A4 = R0
            R0 = v_3A0
            R0 = self.ADCS(R0, R2)
            v_3A0 = R0
            R0 = v_380
            R2 = v_37C
            R0 = self.ADDS(R0, R6)
            R5 = self.ADC(R12, R2)
            v_37C = R5
            R4 = self.LSRS(R0, 0xE)
            v_380 = R0
            R2 = self.LSRS(R5, 0x12)
            R3 = self.LSRS(R5, 0xE)
            R2 = R2 | self.check(R0) << 14
            R3 = R3 | self.check(R0) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.LSLS(R5, 0x17)
            R3 = R3 | self.check(R0) >> 9
            R4 = R4 | self.check(R5) << 18
            R1 = R2 ^ R3
            R3 = self.LSRS(R0, 0x12)
            R3 = R3 | self.check(R5) << 14
            v_398 = R1
            R3 = self.EORS(R3, R4)
            R4 = self.LSRS(R5, 9)
            R1 = v_378
            R4 = R4 | self.check(R0) << 23
            R12 = R3 ^ R4
            R3 = list_3B8[0x10 * index + 9]
            R4 = R11 ^ R1
            R4 = self.ANDS(R4, R5)
            R4 = self.EORS(R4, R1)
            R1 = v_39C
            R5 = R1 ^ R10
            R5 = self.ANDS(R5, R0)
            R5 = R5 ^ R10
            R2 = self.rodata[0x10 * index + 8]
            R0 = self.ADDS(R2, LR)
            R2 = self.rodata[0x10 * index + 9]
            R2 = self.ADC(R2, R9)
            R0 = self.ADDS(R0, R3)
            R3 = list_3B8[0x10 * index + 8]
            R2 = self.ADCS(R2, R3)
            R0 = self.ADDS(R0, R5)
            R2 = self.ADCS(R2, R4)
            R1 = self.ADDS(R0, R12)
            R0 = v_398
            R3 = v_3AC
            R4 = self.ADC(R2, R0)
            R0 = v_3A4
            R6 = self.ADDS(R0, R1)
            R0 = v_3A0
            v_3A4 = R6
            R0 = self.ADCS(R0, R4)
            v_3A0 = R0
            R2 = R0 | R8
            R2 = self.ANDS(R2, R3)
            R3 = R0 & R8
            LR = R2 | R3
            R8 = R6
            R3 = self.LSLS(R0, 0x1E)
            R5 = self.LSRS(R0, 0x1C)
            R3 = R3 | self.check(R8) >> 2
            R5 = R5 | self.check(R8) << 4
            R3 = self.EORS(R3, R5)
            R5 = self.LSLS(R0, 0x19)
            R5 = R5 | self.check(R8) >> 7
            R2 = self.check(R8) >> 28
            R12 = R3 ^ R5
            R5 = self.LSRS(R0, 2)
            R5 = R5 | self.check(R8) << 30
            R2 = R2 | self.check(R0) << 4
            R2 = self.EORS(R2, R5)
            R5 = self.LSRS(R0, 7)
            R3 = v_384
            R5 = R5 | self.check(R8) << 25
            R6 = v_3A8
            R2 = self.EORS(R2, R5)
            R5 = R8 | R3
            R5 = self.ANDS(R5, R6)
            R6 = R8 & R3
            R5 = self.ORRS(R5, R6)
            R0 = self.ADDS(R2, R5)
            v_398 = R0
            R2 = v_388
            R12 = self.ADC(R12, LR)
            R0 = v_370
            R3 = self.ADDS(R1, R2)
            R1 = v_380
            R8 = self.ADC(R4, R0)
            R0 = R3
            R2 = self.check(R8) >> 18
            R3 = self.check(R8) >> 14
            R2 = R2 | self.check(R0) << 14
            R3 = R3 | self.check(R0) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.check(R8) << 23
            R3 = R3 | self.check(R0) >> 9
            R4 = self.LSRS(R0, 0xE)
            LR = R2 ^ R3
            R3 = self.LSRS(R0, 0x12)
            R3 = R3 | self.check(R8) << 14
            R4 = R4 | self.check(R8) << 18
            R3 = self.EORS(R3, R4)
            R4 = self.check(R8) >> 9
            R4 = R4 | self.check(R0) << 23
            R2 = R0
            R0 = v_37C
            R3 = self.EORS(R3, R4)
            v_388 = R2
            R4 = R0 ^ R11
            R0 = v_39C
            R4 = R4 & R8
            R5 = R1 ^ R0
            R4 = R4 ^ R11
            R5 = self.ANDS(R5, R2)
            R5 = self.EORS(R5, R0)
            R6 = self.rodata[0x10 * index + 10]
            R1 = self.ADDS(R6, R10)
            R6 = self.rodata[0x10 * index + 11]
            R0 = v_378
            R6 = self.ADCS(R6, R0)
            R2 = list_3B8[0x10 * index + 11]
            R1 = self.ADDS(R1, R2)
            R2 = list_3B8[0x10 * index + 10]
            R0 = v_398
            R2 = self.ADCS(R2, R6)
            R1 = self.ADDS(R1, R5)
            R2 = self.ADCS(R2, R4)
            R1 = self.ADDS(R1, R3)
            R4 = self.ADC(R2, LR)
            R6 = v_3A0
            R0 = self.ADDS(R0, R1)
            R9 = self.ADC(R12, R4)
            R3 = v_36C
            R2 = R9 | R6
            R5 = self.check(R9) >> 28
            v_374 = R9
            R2 = self.ANDS(R2, R3)
            R3 = R9 & R6
            R10 = R2 | R3
            R3 = self.check(R9) << 30
            R3 = R3 | self.check(R0) >> 2
            R5 = R5 | self.check(R0) << 4
            R3 = self.EORS(R3, R5)
            R5 = self.check(R9) << 25
            R5 = R5 | self.check(R0) >> 7
            R6 = self.LSRS(R0, 0x1C)
            R12 = R3 ^ R5
            R5 = self.check(R9) >> 2
            R5 = R5 | self.check(R0) << 30
            R6 = R6 | self.check(R9) << 4
            R5 = self.EORS(R5, R6)
            R6 = self.check(R9) >> 7
            R3 = v_3A4
            R6 = R6 | self.check(R0) << 25
            R2 = v_384
            R5 = self.EORS(R5, R6)
            R6 = R0 | R3
            R6 = self.ANDS(R6, R2)
            R2 = R0 & R3
            R2 = R2 | R6
            R2 = self.ADDS(R2, R5)
            v_398 = R2
            R2 = self.ADC(R12, R10)
            v_378 = R2
            R2 = v_38C
            R12 = self.ADDS(R1, R2)
            R1 = v_390
            LR = self.ADC(R4, R1)
            R4 = self.check(R12) >> 14
            R1 = self.check(LR) >> 18
            R2 = self.check(LR) >> 14
            R1 = R1 | self.check(R12) << 14
            R2 = R2 | self.check(R12) << 18
            R1 = self.EORS(R1, R2)
            R2 = self.check(LR) << 23
            R2 = R2 | self.check(R12) >> 9
            R4 = R4 | self.check(LR) << 18
            R1 = self.EORS(R1, R2)
            R2 = self.check(R12) >> 18
            R2 = R2 | self.check(LR) << 14
            v_390 = R1
            R2 = self.EORS(R2, R4)
            R4 = self.check(LR) >> 9
            R1 = v_37C
            R4 = R4 | self.check(R12) << 23
            R10 = R2 ^ R4
            R2 = v_388
            R4 = R8 ^ R1
            R4 = R4 & LR
            R4 = self.EORS(R4, R1)
            R1 = v_380
            R5 = R2 ^ R1
            R2 = v_39C
            R5 = R5 & R12
            R5 = self.EORS(R5, R1)
            R6 = self.rodata[0x10 * index + 12]
            R3 = self.rodata[0x10 * index + 13]
            R6 = self.ADDS(R6, R2)
            R3 = self.ADC(R3, R11)
            R1 = list_3B8[0x10 * index + 13]
            R1 = self.ADDS(R1, R6)
            R6 = list_3B8[0x10 * index + 12]
            R3 = self.ADCS(R3, R6)
            R1 = self.ADDS(R1, R5)
            R3 = self.ADCS(R3, R4)
            R5 = self.ADDS(R1, R10)
            R1 = v_390
            R2 = self.ADC(R3, R1)
            R1 = v_398
            R3 = v_3A0
            R10 = self.ADDS(R1, R5)
            R1 = v_378
            v_378 = R0
            R11 = self.ADC(R1, R2)
            R6 = self.check(R10) >> 28
            R1 = R11 | R9
            v_398 = R11
            R1 = self.ANDS(R1, R3)
            R3 = R11 & R9
            R9 = R1 | R3
            R3 = self.check(R11) << 30
            R4 = self.check(R11) >> 28
            R3 = R3 | self.check(R10) >> 2
            R4 = R4 | self.check(R10) << 4
            R6 = R6 | self.check(R11) << 4
            R3 = self.EORS(R3, R4)
            R4 = self.check(R11) << 25
            R4 = R4 | self.check(R10) >> 7
            R1 = v_3A4
            R3 = self.EORS(R3, R4)
            R4 = self.check(R11) >> 2
            R4 = R4 | self.check(R10) << 30
            v_39C = R10
            R4 = self.EORS(R4, R6)
            R6 = self.check(R11) >> 7
            R6 = R6 | self.check(R10) << 25
            R4 = self.EORS(R4, R6)
            R6 = R10 | R0
            R6 = self.ANDS(R6, R1)
            R1 = R10 & R0
            R1 = self.ORRS(R1, R6)
            R10 = LR
            R0 = self.ADDS(R4, R1)
            v_390 = R0
            R0 = self.ADC(R3, R9)
            v_38C = R0
            R0 = v_3A8
            R9 = R12
            R4 = self.ADDS(R5, R0)
            R0 = v_3AC
            v_3A8 = R4
            R0 = self.ADCS(R0, R2)
            R3 = self.LSRS(R4, 0xE)
            v_3AC = R0
            R1 = self.LSRS(R0, 0x12)
            R2 = self.LSRS(R0, 0xE)
            R1 = R1 | self.check(R4) << 14
            R2 = R2 | self.check(R4) << 18
            R1 = self.EORS(R1, R2)
            R2 = self.LSLS(R0, 0x17)
            R2 = R2 | self.check(R4) >> 9
            R3 = R3 | self.check(R0) << 18
            R11 = R1 ^ R2
            R2 = self.LSRS(R4, 0x12)
            R2 = R2 | self.check(R0) << 14
            R2 = self.EORS(R2, R3)
            R3 = self.LSRS(R0, 9)
            R3 = R3 | self.check(R4) << 23
            R2 = self.EORS(R2, R3)
            R3 = LR ^ R8
            R3 = self.ANDS(R3, R0)
            R0 = v_388
            LR = R3 ^ R8
            R5 = R12 ^ R0
            R5 = self.ANDS(R5, R4)
            R3 = R0
            R5 = self.EORS(R5, R0)
            R4 = self.rodata[0x10 * index + 14]
            R6 = self.rodata[0x10 * index + 15]
            R0 = v_380
            R4 = self.ADDS(R4, R0)
            R0 = v_37C
            R6 = self.ADCS(R6, R0)
            R0 = list_3B8[0x10 * index + 14]
            R1 = list_3B8[0x10 * index + 15]
            R1 = self.ADDS(R1, R4)
            R0 = self.ADCS(R0, R6)
            R1 = self.ADDS(R1, R5)
            R0 = self.ADC(R0, LR)
            R1 = self.ADDS(R1, R2)
            R2 = v_390
            R0 = self.ADC(R0, R11)
            R4 = R8
            LR = self.ADDS(R2, R1)
            R2 = v_38C
            R6 = R3
            R12 = self.ADC(R2, R0)
            R2 = v_384
            R8 = self.ADDS(R1, R2)
            R2 = v_36C
            R5 = self.ADC(R0, R2)

        list_638 = [
            self.check(LR), self.check(R12), self.check(v_39C), self.check(v_398),
            self.check(v_378), self.check(v_374), self.check(v_3A4), self.check(v_3A0),
            self.check(R8), self.check(R5), self.check(v_3A8), self.check(v_3AC),
            self.check(R9), self.check(R10), self.check(R6), self.check(R4),
        ]

        for i in range(8):
            R0 = param_list[2 * i]
            R1 = param_list[2 * i + 1]
            R0 = self.ADDS(R0, list_638[2 * i])
            R1 = self.ADCS(R1, list_638[2 * i + 1])
            param_list[2 * i] = R0
            param_list[2 * i + 1] = R1
        return param_list

   */
  hex_30A(param_list,list_3B8) {
    let v_3A0 = param_list[7];
    let v_3A4 = param_list[8];

}
}


================================================
FILE: lib/TTEncrypt.py
================================================
import binascii
import gzip
import random

from Crypto.Cipher import AES


class TT:
    __content = []
    __content_raw = []
    CF = 0
    begining = [0x74, 0x63, 0x05, 0x10, 0, 0]
    dword_0 = [99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89,
               71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241,
               113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26,
               27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190,
               57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64,
               143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196,
               167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219,
               224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78,
               169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75,
               189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17,
               105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153,
               45, 15, 176, 84, 187, 22]
    dword_1 = [16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 452984832,
               905969664]
    dword_2 = [
        0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995,
        1817866830, 1649639237, 1215061108,
        1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327,
        3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058,
        3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186,
        2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995,
        899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501,
        1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147,
        2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074,
        3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265,
        1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711,
        1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829,
        135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334,
        2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171,
        4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034,
        2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987,
        126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184,
        2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485,
        4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453,
        3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780,
        1951317047, 1716890410, 1750902305,
        1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592,
        1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566,
        3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747,
        3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233,
        1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729,
        733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575,
        2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502,
        3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621,
        2203032232, 2370213795,
    ]
    dword_3 = [
        0, 185469197, 370938394, 487725847, 741876788, 657861945, 975451694, 824852259, 1483753576, 1400783205,
        1315723890, 1164071807, 1950903388,
        2135319889, 1649704518, 1767536459, 2967507152, 3152976349, 2801566410, 2918353863, 2631447780, 2547432937,
        2328143614, 2177544179, 3901806776, 3818836405, 4270639778, 4118987695, 3299409036, 3483825537, 3535072918,
        3652904859, 2077965243, 1893020342, 1841768865, 1724457132, 1474502543, 1559041666, 1107234197, 1257309336,
        598438867, 681933534, 901210569, 1052338372, 261314535, 77422314, 428819965, 310463728, 3409685355, 3224740454,
        3710368113, 3593056380, 3875770207, 3960309330, 4045380933, 4195456072, 2471224067, 2554718734, 2237133081,
        2388260884, 3212035895, 3028143674, 2842678573, 2724322336, 4138563181, 4255350624, 3769721975, 3955191162,
        3667219033, 3516619604, 3431546947, 3347532110, 2933734917, 2782082824, 3099667487, 3016697106, 2196052529,
        2313884476, 2499348523, 2683765030, 1179510461, 1296297904, 1347548327, 1533017514, 1786102409, 1635502980,
        2087309459, 2003294622, 507358933, 355706840, 136428751, 53458370, 839224033, 957055980, 605657339, 790073846,
        2373340630, 2256028891, 2607439820, 2422494913, 2706270690, 2856345839, 3075636216, 3160175349, 3573941694,
        3725069491, 3273267108, 3356761769, 4181598602, 4063242375, 4011996048, 3828103837, 1033297158, 915985419,
        730517276, 545572369, 296679730, 446754879, 129166120, 213705253, 1709610350, 1860738147, 1945798516,
        2029293177, 1239331162, 1120974935, 1606591296, 1422699085, 4148292826, 4233094615, 3781033664, 3931371469,
        3682191598, 3497509347, 3446004468, 3328955385, 2939266226, 2755636671, 3106780840, 2988687269, 2198438022,
        2282195339, 2501218972, 2652609425, 1201765386, 1286567175, 1371368976, 1521706781, 1805211710, 1620529459,
        2105887268, 1988838185, 533804130, 350174575, 164439672, 46346101, 870912086, 954669403, 636813900, 788204353,
        2358957921, 2274680428, 2592523643, 2441661558, 2695033685, 2880240216, 3065962831, 3182487618, 3572145929,
        3756299780, 3270937875, 3388507166, 4174560061, 4091327024, 4006521127, 3854606378, 1014646705, 930369212,
        711349675, 560487590, 272786309, 457992840, 106852767, 223377554, 1678381017, 1862534868, 1914052035,
        2031621326, 1211247597, 1128014560, 1580087799, 1428173050, 32283319, 182621114, 401639597, 486441376,
        768917123, 651868046, 1003007129, 818324884, 1503449823, 1385356242, 1333838021, 1150208456, 1973745387,
        2125135846, 1673061617, 1756818940, 2970356327, 3120694122, 2802849917, 2887651696, 2637442643, 2520393566,
        2334669897, 2149987652, 3917234703, 3799141122, 4284502037, 4100872472, 3309594171, 3460984630, 3545789473,
        3629546796, 2050466060, 1899603969, 1814803222, 1730525723, 1443857720, 1560382517, 1075025698, 1260232239,
        575138148, 692707433, 878443390, 1062597235, 243256656, 91341917, 409198410, 325965383, 3403100636, 3252238545,
        3704300486, 3620022987, 3874428392, 3990953189, 4042459122, 4227665663, 2460449204, 2578018489, 2226875310,
        2411029155, 3198115200, 3046200461, 2827177882, 2743944855,
    ]
    dword_4 = [
        0, 218828297, 437656594, 387781147, 875313188, 958871085, 775562294, 590424639, 1750626376, 1699970625,
        1917742170, 2135253587, 1551124588,
        1367295589, 1180849278, 1265195639, 3501252752, 3720081049, 3399941250, 3350065803, 3835484340, 3919042237,
        4270507174, 4085369519, 3102249176, 3051593425, 2734591178, 2952102595, 2361698556, 2177869557, 2530391278,
        2614737639, 3145456443, 3060847922, 2708326185, 2892417312, 2404901663, 2187128086, 2504130317, 2555048196,
        3542330227, 3727205754, 3375740769, 3292445032, 3876557655, 3926170974, 4246310725, 4027744588, 1808481195,
        1723872674, 1910319033, 2094410160, 1608975247, 1391201670, 1173430173, 1224348052, 59984867, 244860394,
        428169201, 344873464, 935293895, 984907214, 766078933, 547512796, 1844882806, 1627235199, 2011214180,
        2062270317, 1507497298, 1423022939, 1137477952, 1321699145, 95345982, 145085239, 532201772, 313773861,
        830661914, 1015671571, 731183368, 648017665, 3175501286, 2957853679, 2807058932, 2858115069, 2305455554,
        2220981195, 2474404304, 2658625497, 3575528878, 3625268135, 3473416636, 3254988725, 3778151818, 3963161475,
        4213447064, 4130281361, 3599595085, 3683022916, 3432737375, 3247465558, 3802222185, 4020912224, 4172763771,
        4122762354, 3201631749, 3017672716, 2764249623, 2848461854, 2331590177, 2280796200, 2431590963, 2648976442,
        104699613, 188127444, 472615631, 287343814, 840019705, 1058709744, 671593195, 621591778, 1852171925, 1668212892,
        1953757831, 2037970062, 1514790577, 1463996600, 1080017571, 1297403050, 3673637356, 3623636965, 3235995134,
        3454686199, 4007360968, 3822090177, 4107101658, 4190530515, 2997825956, 3215212461, 2830708150, 2779915199,
        2256734592, 2340947849, 2627016082, 2443058075, 172466556, 122466165, 273792366, 492483431, 1047239000,
        861968209, 612205898, 695634755, 1646252340, 1863638845, 2013908262, 1963115311, 1446242576, 1530455833,
        1277555970, 1093597963, 1636604631, 1820824798, 2073724613, 1989249228, 1436590835, 1487645946, 1337376481,
        1119727848, 164948639, 81781910, 331544205, 516552836, 1039717051, 821288114, 669961897, 719700128, 2973530695,
        3157750862, 2871682645, 2787207260, 2232435299, 2283490410, 2667994737, 2450346104, 3647212047, 3564045318,
        3279033885, 3464042516, 3980931627, 3762502690, 4150144569, 4199882800, 3070356634, 3121275539, 2904027272,
        2686254721, 2200818878, 2384911031, 2570832044, 2486224549, 3747192018, 3528626907, 3310321856, 3359936201,
        3950355702, 3867060991, 4049844452, 4234721005, 1739656202, 1790575107, 2108100632, 1890328081, 1402811438,
        1586903591, 1233856572, 1149249077, 266959938, 48394827, 369057872, 418672217, 1002783846, 919489135, 567498868,
        752375421, 209336225, 24197544, 376187827, 459744698, 945164165, 895287692, 574624663, 793451934, 1679968233,
        1764313568, 2117360635, 1933530610, 1343127501, 1560637892, 1243112415, 1192455638, 3704280881, 3519142200,
        3336358691, 3419915562, 3907448597, 3857572124, 4075877127, 4294704398, 3029510009, 3113855344, 2927934315,
        2744104290, 2159976285, 2377486676, 2594734927, 2544078150,
    ]
    dword_5 = [0, 151849742, 303699484, 454499602, 607398968, 758720310, 908999204, 1059270954, 1214797936, 1097159550,
               1517440620, 1400849762, 1817998408, 1699839814, 2118541908, 2001430874, 2429595872, 2581445614,
               2194319100, 2345119218, 3034881240, 3186202582, 2801699524, 2951971274, 3635996816, 3518358430,
               3399679628, 3283088770, 4237083816, 4118925222, 4002861748, 3885750714, 1002142683, 850817237, 698445255,
               548169417, 529487843, 377642221, 227885567, 77089521, 1943217067, 2061379749, 1640576439, 1757691577,
               1474760595, 1592394909, 1174215055, 1290801793, 2875968315, 2724642869, 3111247143, 2960971305,
               2405426947, 2253581325, 2638606623, 2487810577, 3808662347, 3926825029, 4044981591, 4162096729,
               3342319475, 3459953789, 3576539503, 3693126241, 1986918061, 2137062819, 1685577905, 1836772287,
               1381620373, 1532285339, 1078185097, 1229899655, 1040559837, 923313619, 740276417, 621982671, 439452389,
               322734571, 137073913, 19308535, 3871163981, 4021308739, 4104605777, 4255800159, 3263785589, 3414450555,
               3499326569, 3651041127, 2933202493, 2815956275, 3167684641, 3049390895, 2330014213, 2213296395,
               2566595609, 2448830231, 1305906550, 1155237496, 1607244650, 1455525988, 1776460110, 1626319424,
               2079897426, 1928707164, 96392454, 213114376, 396673818, 514443284, 562755902, 679998000, 865136418,
               983426092, 3708173718, 3557504664, 3474729866, 3323011204, 4180808110, 4030667424, 3945269170,
               3794078908, 2507040230, 2623762152, 2272556026, 2390325492, 2975484382, 3092726480, 2738905026,
               2857194700, 3973773121, 3856137295, 4274053469, 4157467219, 3371096953, 3252932727, 3673476453,
               3556361835, 2763173681, 2915017791, 3064510765, 3215307299, 2156299017, 2307622919, 2459735317,
               2610011675, 2081048481, 1963412655, 1846563261, 1729977011, 1480485785, 1362321559, 1243905413,
               1126790795, 878845905, 1030690015, 645401037, 796197571, 274084841, 425408743, 38544885, 188821243,
               3613494426, 3731654548, 3313212038, 3430322568, 4082475170, 4200115116, 3780097726, 3896688048,
               2668221674, 2516901860, 2366882550, 2216610296, 3141400786, 2989552604, 2837966542, 2687165888,
               1202797690, 1320957812, 1437280870, 1554391400, 1669664834, 1787304780, 1906247262, 2022837584,
               265905162, 114585348, 499347990, 349075736, 736970802, 585122620, 972512814, 821712160, 2595684844,
               2478443234, 2293045232, 2174754046, 3196267988, 3079546586, 2895723464, 2777952454, 3537852828,
               3687994002, 3234156416, 3385345166, 4142626212, 4293295786, 3841024952, 3992742070, 174567692, 57326082,
               410887952, 292596766, 777231668, 660510266, 1011452712, 893681702, 1108339068, 1258480242, 1343618912,
               1494807662, 1715193156, 1865862730, 1948373848, 2100090966, 2701949495, 2818666809, 3004591147,
               3122358053, 2235061775, 2352307457, 2535604243, 2653899549, 3915653703, 3764988233, 4219352155,
               4067639125, 3444575871, 3294430577, 3746175075, 3594982253, 836553431, 953270745, 600235211, 718002117,
               367585007, 484830689, 133361907, 251657213, 2041877159, 1891211689, 1806599355, 1654886325, 1568718495,
               1418573201, 1335535747, 1184342925]
    dword_6 = [3328402341, 4168907908, 4000806809, 4135287693, 4294111757, 3597364157, 3731845041, 2445657428,
               1613770832, 33620227, 3462883241, 1445669757, 3892248089, 3050821474, 1303096294, 3967186586, 2412431941,
               528646813, 2311702848, 4202528135, 4026202645, 2992200171, 2387036105, 4226871307, 1101901292,
               3017069671, 1604494077, 1169141738, 597466303, 1403299063, 3832705686, 2613100635, 1974974402,
               3791519004, 1033081774, 1277568618, 1815492186, 2118074177, 4126668546, 2211236943, 1748251740,
               1369810420, 3521504564, 4193382664, 3799085459, 2883115123, 1647391059, 706024767, 134480908, 2512897874,
               1176707941, 2646852446, 806885416, 932615841, 168101135, 798661301, 235341577, 605164086, 461406363,
               3756188221, 3454790438, 1311188841, 2142417613, 3933566367, 302582043, 495158174, 1479289972, 874125870,
               907746093, 3698224818, 3025820398, 1537253627, 2756858614, 1983593293, 3084310113, 2108928974,
               1378429307, 3722699582, 1580150641, 327451799, 2790478837, 3117535592, 0, 3253595436, 1075847264,
               3825007647, 2041688520, 3059440621, 3563743934, 2378943302, 1740553945, 1916352843, 2487896798,
               2555137236, 2958579944, 2244988746, 3151024235, 3320835882, 1336584933, 3992714006, 2252555205,
               2588757463, 1714631509, 293963156, 2319795663, 3925473552, 67240454, 4269768577, 2689618160, 2017213508,
               631218106, 1269344483, 2723238387, 1571005438, 2151694528, 93294474, 1066570413, 563977660, 1882732616,
               4059428100, 1673313503, 2008463041, 2950355573, 1109467491, 537923632, 3858759450, 4260623118,
               3218264685, 2177748300, 403442708, 638784309, 3287084079, 3193921505, 899127202, 2286175436, 773265209,
               2479146071, 1437050866, 4236148354, 2050833735, 3362022572, 3126681063, 840505643, 3866325909,
               3227541664, 427917720, 2655997905, 2749160575, 1143087718, 1412049534, 999329963, 193497219, 2353415882,
               3354324521, 1807268051, 672404540, 2816401017, 3160301282, 369822493, 2916866934, 3688947771, 1681011286,
               1949973070, 336202270, 2454276571, 201721354, 1210328172, 3093060836, 2680341085, 3184776046, 1135389935,
               3294782118, 965841320, 831886756, 3554993207, 4068047243, 3588745010, 2345191491, 1849112409, 3664604599,
               26054028, 2983581028, 2622377682, 1235855840, 3630984372, 2891339514, 4092916743, 3488279077, 3395642799,
               4101667470, 1202630377, 268961816, 1874508501, 4034427016, 1243948399, 1546530418, 941366308, 1470539505,
               1941222599, 2546386513, 3421038627, 2715671932, 3899946140, 1042226977, 2521517021, 1639824860,
               227249030, 260737669, 3765465232, 2084453954, 1907733956, 3429263018, 2420656344, 100860677, 4160157185,
               470683154, 3261161891, 1781871967, 2924959737, 1773779408, 394692241, 2579611992, 974986535, 664706745,
               3655459128, 3958962195, 731420851, 571543859, 3530123707, 2849626480, 126783113, 865375399, 765172662,
               1008606754, 361203602, 3387549984, 2278477385, 2857719295, 1344809080, 2782912378, 59542671, 1503764984,
               160008576, 437062935, 1707065306, 3622233649, 2218934982, 3496503480, 2185314755, 697932208, 1512910199,
               504303377, 2075177163, 2824099068, 1841019862, 739644986]
    dword_7 = [
        2781242211, 2230877308, 2582542199, 2381740923, 234877682, 3184946027, 2984144751, 1418839493, 1348481072,
        50462977, 2848876391, 2102799147, 434634494, 1656084439, 3863849899, 2599188086, 1167051466, 2636087938,
        1082771913, 2281340285, 368048890, 3954334041, 3381544775, 201060592, 3963727277, 1739838676, 4250903202,
        3930435503, 3206782108, 4149453988, 2531553906, 1536934080, 3262494647, 484572669, 2923271059, 1783375398,
        1517041206, 1098792767, 49674231, 1334037708, 1550332980, 4098991525, 886171109, 150598129, 2481090929,
        1940642008, 1398944049, 1059722517, 201851908, 1385547719, 1699095331, 1587397571, 674240536, 2704774806,
        252314885, 3039795866, 151914247, 908333586, 2602270848, 1038082786, 651029483, 1766729511, 3447698098,
        2682942837, 454166793, 2652734339, 1951935532, 775166490, 758520603, 3000790638, 4004797018, 4217086112,
        4137964114, 1299594043, 1639438038, 3464344499, 2068982057, 1054729187, 1901997871, 2534638724, 4121318227,
        1757008337, 0, 750906861, 1614815264, 535035132, 3363418545, 3988151131, 3201591914, 1183697867, 3647454910,
        1265776953, 3734260298, 3566750796, 3903871064, 1250283471, 1807470800, 717615087, 3847203498, 384695291,
        3313910595, 3617213773, 1432761139, 2484176261, 3481945413, 283769337, 100925954, 2180939647, 4037038160,
        1148730428, 3123027871, 3813386408, 4087501137, 4267549603, 3229630528, 2315620239, 2906624658, 3156319645,
        1215313976, 82966005, 3747855548, 3245848246, 1974459098, 1665278241, 807407632, 451280895, 251524083,
        1841287890, 1283575245, 337120268, 891687699, 801369324, 3787349855, 2721421207, 3431482436, 959321879,
        1469301956, 4065699751, 2197585534, 1199193405, 2898814052, 3887750493, 724703513, 2514908019, 2696962144,
        2551808385, 3516813135, 2141445340, 1715741218, 2119445034, 2872807568, 2198571144, 3398190662, 700968686,
        3547052216, 1009259540, 2041044702, 3803995742, 487983883, 1991105499, 1004265696, 1449407026, 1316239930,
        504629770, 3683797321, 168560134, 1816667172, 3837287516, 1570751170, 1857934291, 4014189740, 2797888098,
        2822345105, 2754712981, 936633572, 2347923833, 852879335, 1133234376, 1500395319, 3084545389, 2348912013,
        1689376213, 3533459022, 3762923945, 3034082412, 4205598294, 133428468, 634383082, 2949277029, 2398386810,
        3913789102, 403703816, 3580869306, 2297460856, 1867130149, 1918643758, 607656988, 4049053350, 3346248884,
        1368901318, 600565992, 2090982877, 2632479860, 557719327, 3717614411, 3697393085, 2249034635, 2232388234,
        2430627952, 1115438654, 3295786421, 2865522278, 3633334344, 84280067, 33027830, 303828494, 2747425121,
        1600795957, 4188952407, 3496589753, 2434238086, 1486471617, 658119965, 3106381470, 953803233, 334231800,
        3005978776, 857870609, 3151128937, 1890179545, 2298973838, 2805175444, 3056442267, 574365214, 2450884487,
        550103529, 1233637070, 4289353045, 2018519080, 2057691103, 2399374476, 4166623649, 2148108681, 387583245,
        3664101311, 836232934, 3330556482, 3100665960, 3280093505, 2955516313, 2002398509, 287182607, 3413881008,
        4238890068, 3597515707, 975967766,
    ]
    dword_8 = [
        1671808611, 2089089148, 2006576759, 2072901243, 4061003762, 1807603307, 1873927791, 3310653893, 810573872,
        16974337, 1739181671, 729634347,
        4263110654, 3613570519, 2883997099, 1989864566, 3393556426, 2191335298, 3376449993, 2106063485, 4195741690,
        1508618841, 1204391495, 4027317232, 2917941677, 3563566036, 2734514082, 2951366063, 2629772188, 2767672228,
        1922491506, 3227229120, 3082974647, 4246528509, 2477669779, 644500518, 911895606, 1061256767, 4144166391,
        3427763148, 878471220, 2784252325, 3845444069, 4043897329, 1905517169, 3631459288, 827548209, 356461077,
        67897348, 3344078279, 593839651, 3277757891, 405286936, 2527147926, 84871685, 2595565466, 118033927, 305538066,
        2157648768, 3795705826, 3945188843, 661212711, 2999812018, 1973414517, 152769033, 2208177539, 745822252,
        439235610, 455947803, 1857215598, 1525593178, 2700827552, 1391895634, 994932283, 3596728278, 3016654259,
        695947817, 3812548067, 795958831, 2224493444, 1408607827, 3513301457, 0, 3979133421, 543178784, 4229948412,
        2982705585, 1542305371, 1790891114, 3410398667, 3201918910, 961245753, 1256100938, 1289001036, 1491644504,
        3477767631, 3496721360, 4012557807, 2867154858, 4212583931, 1137018435, 1305975373, 861234739, 2241073541,
        1171229253, 4178635257, 33948674, 2139225727, 1357946960, 1011120188, 2679776671, 2833468328, 1374921297,
        2751356323, 1086357568, 2408187279, 2460827538, 2646352285, 944271416, 4110742005, 3168756668, 3066132406,
        3665145818, 560153121, 271589392, 4279952895, 4077846003, 3530407890, 3444343245, 202643468, 322250259,
        3962553324, 1608629855, 2543990167, 1154254916, 389623319, 3294073796, 2817676711, 2122513534, 1028094525,
        1689045092, 1575467613, 422261273, 1939203699, 1621147744, 2174228865, 1339137615, 3699352540, 577127458,
        712922154, 2427141008, 2290289544, 1187679302, 3995715566, 3100863416, 339486740, 3732514782, 1591917662,
        186455563, 3681988059, 3762019296, 844522546, 978220090, 169743370, 1239126601, 101321734, 611076132,
        1558493276, 3260915650, 3547250131, 2901361580, 1655096418, 2443721105, 2510565781, 3828863972, 2039214713,
        3878868455, 3359869896, 928607799, 1840765549, 2374762893, 3580146133, 1322425422, 2850048425, 1823791212,
        1459268694, 4094161908, 3928346602, 1706019429, 2056189050, 2934523822, 135794696, 3134549946, 2022240376,
        628050469, 779246638, 472135708, 2800834470, 3032970164, 3327236038, 3894660072, 3715932637, 1956440180,
        522272287, 1272813131, 3185336765, 2340818315, 2323976074, 1888542832, 1044544574, 3049550261, 1722469478,
        1222152264, 50660867, 4127324150, 236067854, 1638122081, 895445557, 1475980887, 3117443513, 2257655686,
        3243809217, 489110045, 2662934430, 3778599393, 4162055160, 2561878936, 288563729, 1773916777, 3648039385,
        2391345038, 2493985684, 2612407707, 505560094, 2274497927, 3911240169, 3460925390, 1442818645, 678973480,
        3749357023, 2358182796, 2717407649, 2306869641, 219617805, 3218761151, 3862026214, 1120306242, 1756942440,
        1103331905, 2578459033, 762796589, 252780047, 2966125488, 1425844308, 3151392187, 372911126,
    ]
    dword_9 = [
        1667474886, 2088535288, 2004326894, 2071694838, 4075949567, 1802223062, 1869591006, 3318043793, 808472672,
        16843522, 1734846926, 724270422,
        4278065639, 3621216949, 2880169549, 1987484396, 3402253711, 2189597983, 3385409673, 2105378810, 4210693615,
        1499065266, 1195886990, 4042263547, 2913856577, 3570689971, 2728590687, 2947541573, 2627518243, 2762274643,
        1920112356, 3233831835, 3082273397, 4261223649, 2475929149, 640051788, 909531756, 1061110142, 4160160501,
        3435941763, 875846760, 2779116625, 3857003729, 4059105529, 1903268834, 3638064043, 825316194, 353713962,
        67374088, 3351728789, 589522246, 3284360861, 404236336, 2526454071, 84217610, 2593830191, 117901582, 303183396,
        2155911963, 3806477791, 3958056653, 656894286, 2998062463, 1970642922, 151591698, 2206440989, 741110872,
        437923380, 454765878, 1852748508, 1515908788, 2694904667, 1381168804, 993742198, 3604373943, 3014905469,
        690584402, 3823320797, 791638366, 2223281939, 1398011302, 3520161977, 0, 3991743681, 538992704, 4244381667,
        2981218425, 1532751286, 1785380564, 3419096717, 3200178535, 960056178, 1246420628, 1280103576, 1482221744,
        3486468741, 3503319995, 4025428677, 2863326543, 4227536621, 1128514950, 1296947098, 859002214, 2240123921,
        1162203018, 4193849577, 33687044, 2139062782, 1347481760, 1010582648, 2678045221, 2829640523, 1364325282,
        2745433693, 1077985408, 2408548869, 2459086143, 2644360225, 943212656, 4126475505, 3166494563, 3065430391,
        3671750063, 555836226, 269496352, 4294908645, 4092792573, 3537006015, 3452783745, 202118168, 320025894,
        3974901699, 1600119230, 2543297077, 1145359496, 387397934, 3301201811, 2812801621, 2122220284, 1027426170,
        1684319432, 1566435258, 421079858, 1936954854, 1616945344, 2172753945, 1330631070, 3705438115, 572679748,
        707427924, 2425400123, 2290647819, 1179044492, 4008585671, 3099120491, 336870440, 3739122087, 1583276732,
        185277718, 3688593069, 3772791771, 842159716, 976899700, 168435220, 1229577106, 101059084, 606366792,
        1549591736, 3267517855, 3553849021, 2897014595, 1650632388, 2442242105, 2509612081, 3840161747, 2038008818,
        3890688725, 3368567691, 926374254, 1835907034, 2374863873, 3587531953, 1313788572, 2846482505, 1819063512,
        1448540844, 4109633523, 3941213647, 1701162954, 2054852340, 2930698567, 134748176, 3132806511, 2021165296,
        623210314, 774795868, 471606328, 2795958615, 3031746419, 3334885783, 3907527627, 3722280097, 1953799400,
        522133822, 1263263126, 3183336545, 2341176845, 2324333839, 1886425312, 1044267644, 3048588401, 1718004428,
        1212733584, 50529542, 4143317495, 235803164, 1633788866, 892690282, 1465383342, 3115962473, 2256965911,
        3250673817, 488449850, 2661202215, 3789633753, 4177007595, 2560144171, 286339874, 1768537042, 3654906025,
        2391705863, 2492770099, 2610673197, 505291324, 2273808917, 3924369609, 3469625735, 1431699370, 673740880,
        3755965093, 2358021891, 2711746649, 2307489801, 218961690, 3217021541, 3873845719, 1111672452, 1751693520,
        1094828930, 2576986153, 757954394, 252645662, 2964376443, 1414855848, 3149649517, 370555436,
    ]
    LIST_6B0 = [4089235720, 1779033703, 2227873595, 3144134277, 4271175723, 1013904242, 1595750129, 2773480762,
                2917565137, 1359893119, 725511199, 2600822924, 4215389547, 528734635, 327033209, 1541459225]
    ord_list = [
        77, 212, 194, 230, 184, 49, 98, 9, 14, 82, 179, 199, 166, 115, 59, 164, 28, 178, 70, 43, 130, 154, 181, 138, 25,
        107, 57, 219, 87, 23, 117,
        36, 244, 155, 175, 127, 8, 232, 214, 141, 38, 167, 46, 55, 193, 169, 90, 47, 31, 5, 165, 24, 146, 174, 242, 148,
        151, 50, 182, 42, 56, 170, 221, 88,
    ]
    rodata = [3609767458, 1116352408, 602891725, 1899447441, 3964484399, 3049323471, 2173295548, 3921009573, 4081628472,
              961987163, 3053834265, 1508970993, 2937671579, 2453635748, 3664609560, 2870763221, 2734883394, 3624381080,
              1164996542, 310598401, 1323610764, 607225278, 3590304994, 1426881987, 4068182383, 1925078388, 991336113,
              2162078206, 633803317, 2614888103, 3479774868, 3248222580, 2666613458, 3835390401, 944711139, 4022224774,
              2341262773, 264347078, 2007800933, 604807628, 1495990901, 770255983, 1856431235, 1249150122, 3175218132,
              1555081692, 2198950837, 1996064986, 3999719339, 2554220882, 766784016, 2821834349, 2566594879, 2952996808,
              3203337956, 3210313671, 1034457026, 3336571891, 2466948901, 3584528711, 3758326383, 113926993, 168717936,
              338241895, 1188179964, 666307205, 1546045734, 773529912, 1522805485, 1294757372, 2643833823, 1396182291,
              2343527390, 1695183700, 1014477480, 1986661051, 1206759142, 2177026350, 344077627, 2456956037, 1290863460,
              2730485921, 3158454273, 2820302411, 3505952657, 3259730800, 106217008, 3345764771, 3606008344, 3516065817,
              1432725776, 3600352804, 1467031594, 4094571909, 851169720, 275423344, 3100823752, 430227734, 1363258195,
              506948616, 3750685593, 659060556, 3785050280, 883997877, 3318307427, 958139571, 3812723403, 1322822218,
              2003034995, 1537002063, 3602036899, 1747873779, 1575990012, 1955562222, 1125592928, 2024104815,
              2716904306, 2227730452, 442776044, 2361852424, 593698344, 2428436474, 3733110249, 2756734187, 2999351573,
              3204031479, 3815920427, 3329325298, 3928383900, 3391569614, 566280711, 3515267271, 3454069534, 3940187606,
              4000239992, 4118630271, 1914138554, 116418474, 2731055270, 174292421, 3203993006, 289380356, 320620315,
              460393269, 587496836, 685471733, 1086792851, 852142971, 365543100, 1017036298, 2618297676, 1126000580,
              3409855158, 1288033470, 4234509866, 1501505948, 987167468, 1607167915, 1246189591, 1816402316]
    list_9C8 = []

    def encrypt(self, data):
        headers = [31, 139, 8, 0, 0, 0, 0, 0, 0, 0]
        data = gzip.compress(data.encode(), compresslevel=9, mtime=0)
        data = list(data)
        self.setData(data)
        for i in range(len(headers)):
            self.__content[i] = headers[i]
        list_0B0 = self.calculate(self.list_9C8) + self.ord_list

        list_5D8 = self.calculate(list_0B0)
        list_378 = []
        list_740 = []
        for i in range(0x10):
            list_378.append(list_5D8[i])
        list_378Array = self.dump_list(list_378)
        for i in range(0x10, 0x20):
            list_740.append(list_5D8[i])

        list_8D8 = self.calculate(self.__content)
        list_AB0 = list_8D8 + self.__content
        list_AB0List = self.convertLongList(list_AB0)
        differ = 0x10 - len(list_AB0) % 0x10

        for i in range(differ):
            list_AB0List.append(differ)

        list_AB0 = list_AB0List

        list_55C = self.hex_CF8(list_378Array)
        final_list = self.hex_0A2(list_AB0, list_740, list_55C)
        final_list = (self.begining + self.list_9C8) + final_list
        final_list = self.changeLongArrayTobytes(final_list)

        return bytes(i % 256 for i in final_list)

    def decrypt(self, data):
        #data = bytearray.fromhex(data)
        data = list(data)
        self.setData(data)
        self.__content = self.__content_raw[38:]
        self.list_9C8 = self.__content_raw[6:38]
        self.__content = self.changeByteArrayToLong(self.__content)
        list_0B0 = self.calculate(self.list_9C8) + self.ord_list
        list_5D8 = self.calculate(list_0B0)

        list_378 = []
        list_740 = []
        for i in range(0x10):
            list_378.append(list_5D8[i])
        list_378Array = self.dump_list(list_378)
        for i in range(0x10, 0x20):
            list_740.append(list_5D8[i])

        key_longs = self.hex_list(list_378Array)
        decrypted = self.aes_decrypt(bytes(key_longs), bytes(self.__content))

        decryptedByteArray = ([0] * 16) + list(decrypted)
        toDecompress = decryptedByteArray[64:]
        result = gzip.decompress(bytes(toDecompress))
        res= bytes(result).decode()
        return res

    def aes_decrypt(self, secretKey, encoded):
        initVector = encoded[0:16]
        data = encoded[16:]
        decryptor = AES.new(secretKey, AES.MODE_CBC, initVector)
        decoded = decryptor.decrypt(data)
        return decoded[:-decoded[-1]]

    def bytearray_decode(self, arrays):
        out = []
        for d in arrays:
            out.append(chr(d))
        return "".join(out)

    def changeLongArrayTobytes(self, array):
        result = []
        for i in range(len(array)):
            if array[i] > 127:
                result.append(array[i] - 256)
            else:
                result.append(array[i])
        return result

    def hex_0A2(self, content, list_740, list_55C):
        result = []
        l55cl = len(list_55C)
        lens = len(content)
        end = lens // 16
        for i in range(end):
            for j in range(16):
                list_740[j] = list_740[j] ^ content[16 * i + j]

            tmp_list = self.dump_list(list_740)
            R6 = tmp_list[3]
            LR = tmp_list[0]
            R8 = tmp_list[1]
            R12 = tmp_list[2]
            R5 = list_55C[0]
            R4 = list_55C[1]
            R1 = list_55C[2]
            R2 = list_55C[3]
            R11 = 0
            v_334 = 0
            R2 = R2 ^ R6
            v_33C = R2
            R1 = R1 ^ R12
            v_338 = R1
            R4 = R4 ^ R8
            R12 = R5 ^ LR
            for j in range(5):
                R3 = v_33C
                R9 = R4
                R0 = int(self.UBFX(R12, 0x10, 8))
                R1 = R3 >> 0x18
                R1 = self.dword_6[R1]
                R0 = self.dword_7[R0]
                R0 = R0 ^ R1
                R1 = int(self.UBFX(R4, 8, 8))
                R8 = v_338
                R1 = self.dword_8[R1]
                LR = list_55C[8 * j + 6]
                R0 = R0 ^ R1
                R1 = int(self.UTFX(R8))
                R1 = self.dword_9[R1]
                R0 = R0 ^ R1
                R1 = list_55C[8 * j + 4]
                v_334 = R1
                R1 = list_55C[8 * j + 5]
                v_330 = R1
                R1 = list_55C[8 * j + 7]
                R11 = R0 ^ R1
                R1 = int(self.UBFX(R3, 0x10, 8))
                R0 = R8 >> 24
                R0 = self.dword_6[R0]
                R1 = self.dword_7[R1]
                R0 = R0 ^ R1
                R1 = int(self.UBFX(R12, 8, 8))
                R1 = self.dword_8[R1]
                R0 = R0 ^ R1
                R1 = int(self.UTFX(R9))
                R1 = self.dword_9[R1]
                R0 = R0 ^ R1
                R1 = int(self.UBFX(R8, 0x10, 8))
                R6 = R0 ^ LR
                R0 = R9 >> 24
                R0 = self.dword_6[R0]
                R1 = self.dword_7[R1]
                R0 = R0 ^ R1
                R1 = int(self.UBFX(R3, 8, 8))
                R1 = self.dword_8[R1]
                R0 = R0 ^ R1
                R1 = int(self.UTFX(R12))
                R1 = self.dword_9[R1]
                R0 = R0 ^ R1
                R1 = v_330
                LR = R0 ^ R1
                R0 = int(self.UTFX(R3))
                R0 = self.dword_9[R0]
                R4 = R12 >> 24

                R1 = int(self.UBFX(R8, 8, 8))
                R4 = self.dword_6[R4]
                R5 = int(self.UBFX(R9, 16, 8))
                R1 = self.dword_8[R1]
                R5 = self.dword_7[R5]
                R5 = R5 ^ R4
                R1 = R1 ^ R5
                R0 = R0 ^ R1
                R1 = v_334
                R1 = R1 ^ R0
                R0 = R1 >> 0x18
                v_334 = R0
                if j == 4:
                    break
                else:
                    R4 = int(self.UBFX(R1, 16, 8))
                    R5 = R11 >> 24
                    R10 = R6
                    R5 = self.dword_6[R5]
                    R4 = self.dword_7[R4]
                    R5 = R5 ^ R4
                    R4 = int(self.UBFX(LR, 8, 8))
                    R4 = self.dword_8[R4]
                    R5 = R5 ^ R4
                    R4 = int(self.UTFX(R10))
                    R4 = self.dword_9[R4]
                    R5 = R5 ^ R4
                    R4 = list_55C[8 * j + 11]
                    R0 = R5 ^ R4
                    v_33C = R0
                    R4 = int(self.UBFX(R11, 16, 8))
                    R5 = R10 >> 24
                    R5 = self.dword_6[R5]
                    R4 = self.dword_7[R4]
                    R5 = R5 ^ R4
                    R4 = int(self.UBFX(R1, 8, 8))
                    R0 = list_55C[8 * j + 9]
                    R9 = list_55C[8 * j + 8]
                    R1 = int(self.UTFX(R1))
                    R4 = self.dword_8[R4]
                    R1 = self.dword_9[R1]
                    R5 = R5 ^ R4
                    R4 = int(self.UTFX(LR))
                    R4 = self.dword_9[R4]
                    R5 = R5 ^ R4
                    R4 = list_55C[8 * j + 10]
                    R4 = R4 ^ R5
                    v_338 = R4
                    R5 = int(self.UBFX(R10, 16, 8))
                    R4 = LR >> 24
                    R4 = self.dword_6[R4]
                    R5 = self.dword_7[R5]
                    R4 = R4 ^ R5
                    R5 = int(self.UBFX(R11, 8, 8))
                    R5 = self.dword_8[R5]
                    R4 = R4 ^ R5
                    R1 = R1 ^ R4
                    R4 = R1 ^ R0
                    R0 = v_334
                    R1 = int(self.UBFX(LR, 16, 8))
                    R5 = int(self.UBFX(R10, 8, 8))
                    R0 = self.dword_6[R0]
                    R1 = self.dword_7[R1]
                    R5 = self.dword_8[R5]
                    R0 = R0 ^ R1
                    R1 = int(self.UTFX(R11))
                    R1 = self.dword_9[R1]
                    R0 = R0 ^ R5
                    R0 = R0 ^ R1
                    R12 = R0 ^ R9
            R2 = R11 >> 24
            R3 = int(self.UBFX(R1, 16, 8))
            R10 = R6
            R0 = R10 >> 24
            R2 = self.dword_0[R2]

            R2 = int(self.parseLong(self.toHex(R2) + "000000", 10, 16))
            R9 = R10
            R3 = self.dword_0[R3]
            R3 = int(self.parseLong(self.toHex(R3) + "0000", 10, 16))
            R0 = self.dword_0[R0]
            R0 = int(self.parseLong(self.toHex(R0) + "000000", 10, 16))
            R2 = R2 ^ R3
            v_350 = R2
            R2 = int(self.UBFX(R11, 0x10, 8))
            R2 = self.dword_0[R2]
            R2 = int(self.parseLong(self.toHex(R2) + "0000", 10, 16))
            R0 = R0 ^ R2
            R2 = int(self.UBFX(R1, 8, 8))
            R1 = int(self.UTFX(R1))
            R2 = self.dword_0[R2]
            R2 = int(self.parseLong(self.toHex(R2) + "00", 10, 16))
            R1 = self.dword_0[R1]
            R0 = R0 ^ R2
            R2 = int(self.UTFX(LR))
            R2 = self.dword_0[R2]
            R12 = R0 ^ R2
            R0 = list_55C[l55cl - 2]
            R10 = list_55C[l55cl - 3]
            R12 = R12 ^ R0
            R2 = list_55C[l55cl - 1]
            R0 = LR >> 24
            v_34C = R2
            R2 = int(self.UBFX(R9, 0x10, 8))
            R0 = self.dword_0[R0]
            R0 = int(self.parseLong(self.toHex(R0) + "000000", 10, 16))
            R2 = self.dword_0[R2]
            R2 = int(self.parseLong(self.toHex(R2) + "0000", 10, 16))
            R0 = R0 ^ R2
            R2 = int(self.UBFX(R11, 8, 8))
            R2 = self.dword_0[R2]
            R2 = int(self.parseLong(self.toHex(R2) + "00", 10, 16))
            R0 = R0 ^ R2
            R0 = R0 ^ R1
            R1 = R0 ^ R10
            R0 = v_334
            R2 = int(self.UBFX(LR, 0x10, 8))
            R0 = self.dword_0[R0]
            R0 = int(self.parseLong(self.toHex(R0) + "000000", 10, 16))
            R2 = self.dword_0[R2]
            R2 = int(self.parseLong(self.toHex(R2) + "0000", 10, 16))
            R0 = R0 ^ R2
            R2 = int(self.UBFX(R9, 8, 8))
            R2 = self.dword_0[R2]
            R2 = int(self.parseLong(self.toHex(R2) + "00", 10, 16))
            R0 = R0 ^ R2
            R2 = int(self.UTFX(R11))
            R2 = self.dword_0[R2]
            R0 = R0 ^ R2
            R2 = int(self.UTFX(R9))
            R2 = self.dword_0[R2]
            R3 = int(self.UBFX(LR, 8, 8))
            R3 = self.dword_0[R3]
            R3 = int(self.parseLong(self.toHex(R3) + "00", 10, 16))
            R5 = v_350
            R6 = list_55C[l55cl - 4]
            R3 = R3 ^ R5
            R2 = R2 ^ R3
            R3 = v_34C
            R0 = R0 ^ R6
            R2 = R2 ^ R3
            list_740 = self.hex_list([R0, R1, R12, R2])
            result = result + list_740

        return result  # WORKED

    def calculate(self, content):
        hex_6A8 = 0
        tmp_list = []
        length = len(content)
        list_6B0 = self.LIST_6B0.copy()

        for item in content:
            tmp_list.append(item)

        divisible = length % 0x80
        tmp = 0x80 - divisible

        if tmp > 0x11:
            tmp_list.append(0x80)
            for i in range(tmp - 0x11):
                tmp_list.append(0)

            for j in range(16):
                tmp_list.append(0)
        else:
            tmp_list.append(128)

            for i in range(128 - 16 + tmp + 1):
                tmp_list.append(0)

            for j in range(16):
                tmp_list.append(0)

        tmp_list_size = len(tmp_list)
        d = tmp_list_size // 0x80
        for i in range(tmp_list_size // 0x80):
            if (tmp_list_size // 128 - 1) == i:
                ending = self.handle_ending(hex_6A8, divisible)
                for j in range(8):
                    index = tmp_list_size - j - 1
                    tmp_list[index] = ending[7 - j]

            param_list = []
            for j in range(32):
                tmpss = ""
                for k in range(4):
                    tmp_string = self.toHex(tmp_list[0x80 * i + 4 * j + k])
                    if len(tmp_string) < 2:
                        tmp_string = "0" + tmp_string

                    tmpss = tmpss + tmp_string

                param_list.append(int(self.parseLong(tmpss, 10, 16)))

            list_3B8 = self.hex_27E(param_list)

            list_6B0 = self.hex_30A(list_6B0, list_3B8)

            hex_6A8 += 0x400

        list_8D8 = self.hex_C52(list_6B0)
        return list_8D8

    def convertLongList(self, content):
        if len(content) == 0:
            return []
        result = []
        for i in content:
            result.append(i)
        return result

    def dump_list(self, content):
        size = len(content)
        ssize = size // 4
        result = []
        for index in range(ssize):
            tmp_string = ""
            for j in range(4):
                tmp = self.toHex(content[4 * index + j])
                if len(tmp) < 2:
                    tmp = "0" + tmp

                tmp_string = tmp_string + tmp
            i = int(self.parseLong(tmp_string, 10, 16))
            result.append(int(i))
        return result

    def hex_CF8(self, param_list):
        list_388 = []
        list_378 = param_list
        for i in range(0xA):
            R3 = list_378[0]
            R8 = list_378[1]
            R9 = list_378[2]
            R5 = list_378[3]
            R6 = int(self.UBFX(R5, 8, 8))
            R6 = self.dword_0[R6]
            R6 = int(self.parseLong(self.toHex(R6) + "0000", 10, 16))
            R4 = int(self.UBFX(R5, 0x10, 8))
            R11 = self.dword_1[i]
            R4 = self.dword_0[R4]
            R4 = int(self.parseLong(self.toHex(R4) + "000000", 10, 16))
            R3 = R3 ^ R4
            R4 = int(self.UTFX(R5))
            R3 = R3 ^ R6
            R4 = self.dword_0[R4]
            R4 = int(self.parseLong(self.toHex(R4) + "00", 10, 16))
            R3 = R3 ^ R4
            R4 = R5 >> 24
            R4 = self.dword_0[R4]
            R3 = R3 ^ R4
            R3 = R3 ^ R11
            R2 = R8 ^ R3
            R4 = R9 ^ R2
            R5 = R5 ^ R4
            list_378 = [R3, R2, R4, R5]
            list_388 = list_388 + list_378
        l388l = len(list_388)
        list_478 = []
        for i in range(0x9):
            R5 = list_388[l388l - 8 - 4 * i]
            R4 = int(self.UBFX(R5, 0x10, 8))
            R6 = R5 >> 0x18
            R6 = self.dword_2[R6]
            R4 = self.dword_3[R4]
            R6 = R6 ^ R4
            R4 = int(self.UBFX(R5, 8, 8))
            R5 = int(self.UTFX(R5))
            R4 = self.dword_4[R4]
            R5 = self.dword_5[R5]
            R6 = R6 ^ R4
            R6 = R6 ^ R5
            list_478.append(R6)
            R6 = list_388[l388l - 7 - 4 * i]
            R1 = int(self.UBFX(R6, 0x10, 8))
            R4 = R6 >> 0x18
            R4 = self.dword_2[R4]
            R1 = self.dword_3[R1]
            R1 = R1 ^ R4
            R4 = int(self.UBFX(R6, 8, 8))
            R4 = self.dword_4[R4]
            R1 = R1 ^ R4
            R4 = int(self.UTFX(R6))
            R4 = self.dword_5[R4]
            R1 = R1 ^ R4
            list_478.append(R1)
            R1 = list_388[l388l - 6 - 4 * i]
            R6 = int(self.UBFX(R1, 0x10, 8))
            R4 = R1 >> 0x18
            R4 = self.dword_2[R4]
            R6 = self.dword_3[R6]
            R4 = R4 ^ R6
            R6 = int(self.UBFX(R1, 8, 8))
            R1 = int(self.UTFX(R1))
            R6 = self.dword_4[R6]
            R1 = self.dword_5[R1]
            R4 = R4 ^ R6
            R1 = R1 ^ R4
            list_478.append(R1)
            R0 = list_388[l388l - 5 - 4 * i]
            R1 = int(self.UTFX(R0))
            R4 = int(self.UBFX(R0, 8, 8))
            R6 = R0 >> 0x18
            R0 = int(self.UBFX(R0, 0x10, 8))
            R6 = self.dword_2[R6]
            R0 = self.dword_3[R0]
            R4 = self.dword_4[R4]
            R1 = self.dword_5[R1]
            R0 = R0 ^ R6
            R0 = R0 ^ R4
            R0 = R0 ^ R1
            list_478.append(R0)
        list_468 = param_list + list_388
        return list_468

    def handle_ending(self, num, r0):
        s = self.toHex(num)
        r1 = None
        r2 = None
        if len(s) <= 8:
            r1 = num
            r2 = 0
        else:
            num_str = self.toHex(num)
            length = len(num)
            r1 = self.parseLong(num_str[:length - 8], 10, 16)
            r2 = self.parseLong(num_str[2:length - 8], 10, 16)

        r1 = self.ADDS(r1, r0 << 3)
        r2 = self.ADC(r2, r0 >> 29)
        a = self.hex_list([r2, r1])
        return self.hex_list([r2, r1])

    def UTFX(self, num):
        tmp_string = self.toBinaryString(num)
        start = len(tmp_string) - 8
        return self.parseLong(tmp_string[start:], 10, 2)

    def hex_27E(self, param_list):
        r6 = param_list[0]
        r8 = param_list[1]
        for i in range(0x40):
            r0 = param_list[2 * i + 0x1c]
            r5 = param_list[2 * i + 0x1d]
            r4 = self.LSRS(r0, 0x13)
            r3 = self.LSRS(r0, 0x1d)
            lr = r4 | self.check(r5) << 13
            r4 = self.LSLS(r0, 3)
            r4 = r4 | self.check(r5) >> 29
            r3 = r3 | self.check(r5) << 3
            r4 = r4 ^ self.check(r0) >> 6
            lr = lr ^ r4
            r4 = self.LSRS(r5, 6)
            r4 = r4 | self.check(r0) << 26
            r9 = r3 ^ r4
            r4 = self.LSRS(r5, 0x13)
            r0 = r4 | self.check(r0) << 13
            r10 = param_list[2 * i + 0x12]
            r3 = param_list[2 * i + 0x13]
            r5 = param_list[2 * i + 0x2]
            r4 = param_list[2 * i + 0x3]
            r0 = r0 ^ r9
            r3 = self.ADDS(r3, r8)
            r6 = self.ADC(r6, r10)
            r8 = self.ADDS(r3, r0)
            lr = self.ADC(lr, r6)
            r6 = self.LSRS(r4, 7)
            r3 = self.LSRS(r4, 8)
            r6 = r6 | self.check(r5) << 25
            r3 = r3 | self.check(r5) << 24
            r3 = int(self.EORS(r3, r6))
            r6 = self.LSRS(r5, 1)
            r0 = int(self.RRX(r4))
            r0 = int(self.EORS(r0, r3))
            r3 = r6 | self.check(r4) << 31
            r6 = self.LSRS(r5, 8)
            r0 = int(self.ADDS(r0, r8))
            r6 = r6 | self.check(r4) << 24
            r8 = r4
            r6 = r6 ^ self.check(r5) >> 7
            r3 = r3 ^ r6
            r6 = r5

            r3 = self.ADC(r3, lr)
            param_list = param_list + [r3, r0]

        return param_list  # WORKED

    def hex_30A(self, param_list, list_3B8):
        v_3A0 = param_list[7]
        v_3A4 = param_list[6]
        v_374 = param_list[5]
        v_378 = param_list[4]
        LR = param_list[0]
        R12 = param_list[1]
        v_39C = param_list[2]
        v_398 = param_list[3]
        v_3AC = param_list[11]
        v_3A8 = param_list[10]
        R9 = param_list[12]
        R10 = param_list[13]
        R5 = param_list[9]
        R8 = param_list[8]
        R4 = param_list[15]
        R6 = param_list[14]
        for index in range(10):
            v_384 = R5
            R3 = self.rodata[0x10 * index]
            R1 = self.rodata[0x10 * index + 2]
            R2 = self.rodata[0x10 * index + 1]
            R3 = self.ADDS(R3, R6)

            R6 = self.check(R8) >> 14

            v_390 = R1
            R6 = R6 | self.check(R5) << 18

            R1 = self.rodata[0x10 * index + 3]
            R0 = self.rodata[0x10 * index + 4]
            v_36C = R0
            R0 = self.ADC(R2, R4)
            R2 = self.LSRS(R5, 0x12)
            R4 = self.LSRS(R5, 0xE)
            R2 = R2 | self.check(R8) << 14
            R4 = R4 | self.check(R8) << 18
            R2 = self.EORS(R2, R4)
            R4 = self.LSLS(R5, 0x17)
            R4 = R4 | self.check(R8) >> 9
            v_38C = R1
            R2 = self.EORS(R2, R4)
            R4 = self.check(R8) >> 18
            R4 = R4 | self.check(R5) << 14
            R6 = self.EORS(R6, R4)
            R4 = self.LSRS(R5, 9)
            R4 = R4 | self.check(R8) << 23
            v_354 = R8
            R6 = self.EORS(R6, R4)
            R3 = self.ADDS(R3, R6)
            R0 = self.ADCS(R0, R2)
            R2 = list_3B8[0x10 * index + 1]
            R2 = self.ADDS(R2, R3)
            R3 = list_3B8[0x10 * index + 3]
            R6 = list_3B8[0x10 * index]
            v_358 = R10
            R6 = self.ADCS(R6, R0)
            R0 = v_3AC
            v_360 = R3
            R0 = R0 ^ R10
            R3 = list_3B8[0x10 * index + 2]
            R0 = self.ANDS(R0, R5)
            R1 = list_3B8[0x10 * index + 5]
            R4 = R0 ^ R10
            R0 = v_3A8
            v_364 = R1
            R0 = R0 ^ R9
            R1 = v_374
            R0 = R0 & R8
            R8 = v_39C
            R0 = R0 ^ R9
            v_35C = R3
            R10 = self.ADDS(R2, R0)
            R0 = v_398
            R11 = self.ADC(R6, R4)
            R3 = v_378
            R2 = R0 | R12
            R6 = R0 & R12
            R2 = self.ANDS(R2, R1)
            R1 = R0
            R2 = self.ORRS(R2, R6)
            R6 = R8 | LR
            R6 = self.ANDS(R6, R3)
            R3 = R8 & LR
            R3 = self.ORRS(R3, R6)
            R6 = self.check(R12) << 30
            R0 = self.check(R12) >> 28
            R6 = R6 | self.check(LR) >> 2
            R0 = R0 | self.check(LR) << 4
            R4 = self.check(LR) >> 28
            R0 = self.EORS(R0, R6)
            R6 = self.check(R12) << 25
            R6 = R6 | self.check(LR) >> 7
            R4 = R4 | self.check(R12) << 4
            R0 = self.EORS(R0, R6)
            R6 = self.check(R12) >> 2
            R6 = R6 | self.check(LR) << 30
            R3 = self.ADDS(R3, R10)
            R6 = R6 ^ R4
            R4 = self.check(R12) >> 7
            R4 = R4 | self.check(LR) << 25
            R2 = self.ADC(R2, R11)
            R6 = self.EORS(R6, R4)
            v_37C = R12
            R5 = self.ADDS(R3, R6)
            R6 = self.ADC(R2, R0)
            R0 = R6 | R12
            R2 = R6 & R12
            R0 = self.ANDS(R0, R1)
            R3 = self.LSRS(R6, 0x1C)
            R0 = self.ORRS(R0, R2)
            R2 = self.LSLS(R6, 0x1E)
            R2 = R2 | self.check(R5) >> 2
            R3 = R3 | self.check(R5) << 4
            R2 = self.EORS(R2, R3)
            R3 = self.LSLS(R6, 0x19)
            R3 = R3 | self.check(R5) >> 7
            R4 = self.LSRS(R5, 0x1C)
            R3 = self.EORS(R3, R2)
            R2 = self.LSRS(R6, 2)
            R2 = R2 | self.check(R5) << 30
            R4 = R4 | self.check(R6) << 4
            R2 = self.EORS(R2, R4)
            R4 = self.LSRS(R6, 7)
            R4 = R4 | self.check(R5) << 25
            R12 = R6
            R2 = self.EORS(R2, R4)
            R4 = R5 | LR
            R4 = R4 & R8
            R6 = R5 & LR
            R4 = self.ORRS(R4, R6)
            v_388 = R5
            R5 = self.ADDS(R2, R4)
            R0 = self.ADCS(R0, R3)
            v_398 = R1
            R4 = R9
            v_350 = R0
            R0 = v_3A4
            R1 = v_3A0
            v_380 = LR
            LR = self.ADDS(R0, R10)
            R9 = self.ADC(R1, R11)
            R0 = v_3AC
            R6 = self.check(LR) >> 14
            R1 = v_384
            R3 = self.check(R9) >> 18
            R2 = self.check(R9) >> 14
            R3 = R3 | self.check(LR) << 14
            R2 = R2 | self.check(LR) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.check(R9) << 23
            R3 = R3 | self.check(LR) >> 9
            R6 = R6 | self.check(R9) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.check(LR) >> 18
            R3 = R3 | self.check(R9) << 14
            v_39C = R8
            R3 = self.EORS(R3, R6)
            R6 = self.check(R9) >> 9
            R6 = R6 | self.check(LR) << 23
            R8 = v_354
            R3 = self.EORS(R3, R6)
            R6 = R0 ^ R1
            R6 = R6 & R9
            v_370 = R12
            R6 = self.EORS(R6, R0)
            R0 = v_3A8
            R1 = R0 ^ R8
            R1 = R1 & LR
            R1 = self.EORS(R1, R0)
            R0 = v_358
            R1 = self.ADDS(R1, R4)
            R6 = self.ADCS(R6, R0)
            R0 = v_390
            R1 = self.ADDS(R1, R0)
            R0 = v_38C
            R6 = self.ADCS(R6, R0)
            R0 = v_360
            R1 = self.ADDS(R1, R0)
            R0 = v_35C
            R6 = self.ADCS(R6, R0)
            R1 = self.ADDS(R1, R3)
            R3 = self.ADC(R6, R2)
            R2 = v_350
            R0 = self.ADDS(R5, R1)
            R5 = v_37C
            R4 = self.ADC(R2, R3)
            v_390 = R4
            R2 = R4 | R12
            R6 = R4 & R12
            R2 = self.ANDS(R2, R5)
            R5 = self.LSRS(R4, 0x1C)
            R10 = R2 | R6
            R2 = self.LSLS(R4, 0x1E)
            R2 = R2 | self.check(R0) >> 2
            R5 = R5 | self.check(R0) << 4
            R2 = self.EORS(R2, R5)
            R5 = self.LSLS(R4, 0x19)
            R5 = R5 | self.check(R0) >> 7
            R6 = self.LSRS(R0, 0x1C)
            R12 = R2 ^ R5
            R2 = self.LSRS(R4, 2)
            R2 = R2 | self.check(R0) << 30
            R6 = R6 | self.check(R4) << 4
            R2 = self.EORS(R2, R6)
            R6 = self.LSRS(R4, 7)
            R4 = v_388
            R6 = R6 | self.check(R0) << 25
            R5 = v_380
            R2 = self.EORS(R2, R6)
            R6 = R0 | R4
            R4 = self.ANDS(R4, R0)
            R6 = self.ANDS(R6, R5)
            v_38C = R0
            R4 = self.ORRS(R4, R6)
            R6 = LR ^ R8
            R0 = self.ADDS(R2, R4)
            v_3A4 = R0
            R0 = self.ADC(R12, R10)
            v_3A0 = R0
            R0 = v_378
            R10 = self.ADDS(R1, R0)
            R0 = v_374
            R6 = R6 & R10
            R1 = self.ADC(R3, R0)
            R5 = self.check(R10) >> 14
            R0 = v_384
            R6 = R6 ^ R8
            R3 = self.LSRS(R1, 0x12)
            R4 = self.LSRS(R1, 0xE)
            R3 = R3 | self.check(R10) << 14
            R4 = R4 | self.check(R10) << 18
            R3 = self.EORS(R3, R4)
            R4 = self.LSLS(R1, 0x17)
            R4 = R4 | self.check(R10) >> 9
            R5 = R5 | self.check(R1) << 18
            R11 = R3 ^ R4
            R3 = self.check(R10) >> 18
            R3 = R3 | self.check(R1) << 14
            v_378 = R1
            R3 = self.EORS(R3, R5)
            R5 = self.LSRS(R1, 9)
            R5 = R5 | self.check(R10) << 23
            R3 = self.EORS(R3, R5)
            R5 = R9 ^ R0
            R5 = self.ANDS(R5, R1)
            R1 = v_3A8
            R5 = self.EORS(R5, R0)
            R0 = v_36C
            R4 = self.ADDS(R0, R1)
            R2 = self.rodata[0x10 * index + 5]
            R0 = v_3AC
            R2 = self.ADCS(R2, R0)
            R0 = v_364
            R4 = self.ADDS(R4, R0)
            R12 = list_3B8[0x10 * index + 4]
            R0 = v_3A4
            R2 = self.ADC(R2, R12)
            R6 = self.ADDS(R6, R4)
            R2 = self.ADCS(R2, R5)
            R3 = self.ADDS(R3, R6)
            R11 = self.ADC(R11, R2)
            R1 = self.ADDS(R0, R3)
            R0 = v_3A0
            R6 = v_390
            R4 = self.check(R1) >> 28
            R0 = self.ADC(R0, R11)
            R5 = v_370
            R2 = R0 | R6
            R6 = self.ANDS(R6, R0)
            R2 = self.ANDS(R2, R5)
            R5 = self.LSRS(R0, 0x1C)
            R12 = R2 | R6
            R6 = self.LSLS(R0, 0x1E)
            R6 = R6 | self.check(R1) >> 2
            R5 = R5 | self.check(R1) << 4
            R6 = self.EORS(R6, R5)
            R5 = self.LSLS(R0, 0x19)
            R5 = R5 | self.check(R1) >> 7
            R4 = R4 | self.check(R0) << 4
            R6 = self.EORS(R6, R5)
            R5 = self.LSRS(R0, 2)
            R5 = R5 | self.check(R1) << 30
            v_3AC = R0
            R5 = self.EORS(R5, R4)
            R4 = self.LSRS(R0, 7)
            R0 = v_38C
            R4 = R4 | self.check(R1) << 25
            R2 = v_388
            R5 = self.EORS(R5, R4)
            R4 = R1 | R0
            v_3A8 = R1
            R4 = self.ANDS(R4, R2)
            R2 = R1 & R0
            R2 = self.ORRS(R2, R4)
            R0 = self.ADDS(R5, R2)
            v_3A4 = R0
            R0 = self.ADC(R6, R12)
            v_3A0 = R0
            R0 = v_39C
            R2 = v_398
            R0 = self.ADDS(R0, R3)
            v_39C = R0
            R11 = self.ADC(R11, R2)
            R4 = self.LSRS(R0, 0xE)
            R3 = self.check(R11) >> 18
            R6 = self.check(R11) >> 14
            R3 = R3 | self.check(R0) << 14
            R6 = R6 | self.check(R0) << 18
            R3 = self.EORS(R3, R6)
            R6 = self.check(R11) << 23
            R6 = R6 | self.check(R0) >> 9
            R4 = R4 | self.check(R11) << 18
            R1 = self.EORS(R3, R6)
            R6 = self.LSRS(R0, 0x12)
            R6 = R6 | self.check(R11) << 14
            R3 = R10 ^ LR
            R6 = self.EORS(R6, R4)
            R4 = self.check(R11) >> 9
            R3 = self.ANDS(R3, R0)
            R4 = R4 | self.check(R0) << 23
            R5 = R6 ^ R4
            v_398 = R1
            R3 = R3 ^ LR
            R1 = v_378
            R6 = self.rodata[0x10 * index + 6]
            R12 = self.rodata[0x10 * index + 7]
            R4 = R1 ^ R9
            R0 = v_384
            R6 = self.ADDS(R6, R8)
            R4 = R4 & R11
            R12 = self.ADC(R12, R0)
            R4 = R4 ^ R9
            R8 = list_3B8[0x10 * index + 7]
            R2 = list_3B8[0x10 * index + 6]
            R6 = self.ADDS(R6, R8)
            R0 = v_398
            R2 = self.ADC(R2, R12)
            R3 = self.ADDS(R3, R6)
            R2 = self.ADCS(R2, R4)
            R6 = self.ADDS(R3, R5)
            R12 = self.ADC(R2, R0)
            R0 = v_3A4
            R4 = v_390
            R1 = self.ADDS(R0, R6)
            R0 = v_3A0
            v_384 = R1
            R5 = self.ADC(R0, R12)
            R0 = v_3AC
            R8 = self.check(R1) >> 28
            R2 = R5 | R0
            R3 = R8 | self.check(R5) << 4
            R2 = self.ANDS(R2, R4)
            R4 = R5 & R0
            R0 = R2 | R4
            R4 = self.LSLS(R5, 0x1E)
            R2 = self.LSRS(R5, 0x1C)
            R4 = R4 | self.check(R1) >> 2
            R2 = R2 | self.check(R1) << 4
            v_3A0 = R0
            R2 = self.EORS(R2, R4)
            R4 = self.LSLS(R5, 0x19)
            R4 = R4 | self.check(R1) >> 7
            R0 = v_3A8
            R2 = self.EORS(R2, R4)
            R4 = self.LSRS(R5, 2)
            R4 = R4 | self.check(R1) << 30
            R8 = R5
            R3 = self.EORS(R3, R4)
            R4 = self.LSRS(R5, 7)
            R4 = R4 | self.check(R1) << 25
            R5 = v_38C
            R3 = self.EORS(R3, R4)
            R4 = R1 | R0
            R4 = self.ANDS(R4, R5)
            R5 = R1 & R0
            R4 = self.ORRS(R4, R5)
            v_36C = R8
            R0 = self.ADDS(R3, R4)
            v_3A4 = R0
            R0 = v_3A0
            R0 = self.ADCS(R0, R2)
            v_3A0 = R0
            R0 = v_380
            R2 = v_37C
            R0 = self.ADDS(R0, R6)
            R5 = self.ADC(R12, R2)
            v_37C = R5
            R4 = self.LSRS(R0, 0xE)
            v_380 = R0
            R2 = self.LSRS(R5, 0x12)
            R3 = self.LSRS(R5, 0xE)
            R2 = R2 | self.check(R0) << 14
            R3 = R3 | self.check(R0) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.LSLS(R5, 0x17)
            R3 = R3 | self.check(R0) >> 9
            R4 = R4 | self.check(R5) << 18
            R1 = R2 ^ R3
            R3 = self.LSRS(R0, 0x12)
            R3 = R3 | self.check(R5) << 14
            v_398 = R1
            R3 = self.EORS(R3, R4)
            R4 = self.LSRS(R5, 9)
            R1 = v_378
            R4 = R4 | self.check(R0) << 23
            R12 = R3 ^ R4
            R3 = list_3B8[0x10 * index + 9]
            R4 = R11 ^ R1
            R4 = self.ANDS(R4, R5)
            R4 = self.EORS(R4, R1)
            R1 = v_39C
            R5 = R1 ^ R10
            R5 = self.ANDS(R5, R0)
            R5 = R5 ^ R10
            R2 = self.rodata[0x10 * index + 8]
            R0 = self.ADDS(R2, LR)
            R2 = self.rodata[0x10 * index + 9]
            R2 = self.ADC(R2, R9)
            R0 = self.ADDS(R0, R3)
            R3 = list_3B8[0x10 * index + 8]
            R2 = self.ADCS(R2, R3)
            R0 = self.ADDS(R0, R5)
            R2 = self.ADCS(R2, R4)
            R1 = self.ADDS(R0, R12)
            R0 = v_398
            R3 = v_3AC
            R4 = self.ADC(R2, R0)
            R0 = v_3A4
            R6 = self.ADDS(R0, R1)
            R0 = v_3A0
            v_3A4 = R6
            R0 = self.ADCS(R0, R4)
            v_3A0 = R0
            R2 = R0 | R8
            R2 = self.ANDS(R2, R3)
            R3 = R0 & R8
            LR = R2 | R3
            R8 = R6
            R3 = self.LSLS(R0, 0x1E)
            R5 = self.LSRS(R0, 0x1C)
            R3 = R3 | self.check(R8) >> 2
            R5 = R5 | self.check(R8) << 4
            R3 = self.EORS(R3, R5)
            R5 = self.LSLS(R0, 0x19)
            R5 = R5 | self.check(R8) >> 7
            R2 = self.check(R8) >> 28
            R12 = R3 ^ R5
            R5 = self.LSRS(R0, 2)
            R5 = R5 | self.check(R8) << 30
            R2 = R2 | self.check(R0) << 4
            R2 = self.EORS(R2, R5)
            R5 = self.LSRS(R0, 7)
            R3 = v_384
            R5 = R5 | self.check(R8) << 25
            R6 = v_3A8
            R2 = self.EORS(R2, R5)
            R5 = R8 | R3
            R5 = self.ANDS(R5, R6)
            R6 = R8 & R3
            R5 = self.ORRS(R5, R6)
            R0 = self.ADDS(R2, R5)
            v_398 = R0
            R2 = v_388
            R12 = self.ADC(R12, LR)
            R0 = v_370
            R3 = self.ADDS(R1, R2)
            R1 = v_380
            R8 = self.ADC(R4, R0)
            R0 = R3
            R2 = self.check(R8) >> 18
            R3 = self.check(R8) >> 14
            R2 = R2 | self.check(R0) << 14
            R3 = R3 | self.check(R0) << 18
            R2 = self.EORS(R2, R3)
            R3 = self.check(R8) << 23
            R3 = R3 | self.check(R0) >> 9
            R4 = self.LSRS(R0, 0xE)
            LR = R2 ^ R3
            R3 = self.LSRS(R0, 0x12)
            R3 = R3 | self.check(R8) << 14
            R4 = R4 | self.check(R8) << 18
            R3 = self.EORS(R3, R4)
            R4 = self.check(R8) >> 9
            R4 = R4 | self.check(R0) << 23
            R2 = R0
            R0 = v_37C
            R3 = self.EORS(R3, R4)
            v_388 = R2
            R4 = R0 ^ R11
            R0 = v_39C
            R4 = R4 & R8
            R5 = R1 ^ R0
            R4 = R4 ^ R11
            R5 = self.ANDS(R5, R2)
            R5 = self.EORS(R5, R0)
            R6 = self.rodata[0x10 * index + 10]
            R1 = self.ADDS(R6, R10)
            R6 = self.rodata[0x10 * index + 11]
            R0 = v_378
            R6 = self.ADCS(R6, R0)
            R2 = list_3B8[0x10 * index + 11]
            R1 = self.ADDS(R1, R2)
            R2 = list_3B8[0x10 * index + 10]
            R0 = v_398
            R2 = self.ADCS(R2, R6)
            R1 = self.ADDS(R1, R5)
            R2 = self.ADCS(R2, R4)
            R1 = self.ADDS(R1, R3)
            R4 = self.ADC(R2, LR)
            R6 = v_3A0
            R0 = self.ADDS(R0, R1)
            R9 = self.ADC(R12, R4)
            R3 = v_36C
            R2 = R9 | R6
            R5 = self.check(R9) >> 28
            v_374 = R9
            R2 = self.ANDS(R2, R3)
            R3 = R9 & R6
            R10 = R2 | R3
            R3 = self.check(R9) << 30
            R3 = R3 | self.check(R0) >> 2
            R5 = R5 | self.check(R0) << 4
            R3 = self.EORS(R3, R5)
            R5 = self.check(R9) << 25
            R5 = R5 | self.check(R0) >> 7
            R6 = self.LSRS(R0, 0x1C)
            R12 = R3 ^ R5
            R5 = self.check(R9) >> 2
            R5 = R5 | self.check(R0) << 30
            R6 = R6 | self.check(R9) << 4
            R5 = self.EORS(R5, R6)
            R6 = self.check(R9) >> 7
            R3 = v_3A4
            R6 = R6 | self.check(R0) << 25
            R2 = v_384
            R5 = self.EORS(R5, R6)
            R6 = R0 | R3
            R6 = self.ANDS(R6, R2)
            R2 = R0 & R3
            R2 = R2 | R6
            R2 = self.ADDS(R2, R5)
            v_398 = R2
            R2 = self.ADC(R12, R10)
            v_378 = R2
            R2 = v_38C
            R12 = self.ADDS(R1, R2)
            R1 = v_390
            LR = self.ADC(R4, R1)
            R4 = self.check(R12) >> 14
            R1 = self.check(LR) >> 18
            R2 = self.check(LR) >> 14
            R1 = R1 | self.check(R12) << 14
            R2 = R2 | self.check(R12) << 18
            R1 = self.EORS(R1, R2)
            R2 = self.check(LR) << 23
            R2 = R2 | self.check(R12) >> 9
            R4 = R4 | self.check(LR) << 18
            R1 = self.EORS(R1, R2)
            R2 = self.check(R12) >> 18
            R2 = R2 | self.check(LR) << 14
            v_390 = R1
            R2 = self.EORS(R2, R4)
            R4 = self.check(LR) >> 9
            R1 = v_37C
            R4 = R4 | self.check(R12) << 23
            R10 = R2 ^ R4
            R2 = v_388
            R4 = R8 ^ R1
            R4 = R4 & LR
            R4 = self.EORS(R4, R1)
            R1 = v_380
            R5 = R2 ^ R1
            R2 = v_39C
            R5 = R5 & R12
            R5 = self.EORS(R5, R1)
            R6 = self.rodata[0x10 * index + 12]
            R3 = self.rodata[0x10 * index + 13]
            R6 = self.ADDS(R6, R2)
            R3 = self.ADC(R3, R11)
            R1 = list_3B8[0x10 * index + 13]
            R1 = self.ADDS(R1, R6)
            R6 = list_3B8[0x10 * index + 12]
            R3 = self.ADCS(R3, R6)
            R1 = self.ADDS(R1, R5)
            R3 = self.ADCS(R3, R4)
            R5 = self.ADDS(R1, R10)
            R1 = v_390
            R2 = self.ADC(R3, R1)
            R1 = v_398
            R3 = v_3A0
            R10 = self.ADDS(R1, R5)
            R1 = v_378
            v_378 = R0
            R11 = self.ADC(R1, R2)
            R6 = self.check(R10) >> 28
            R1 = R11 | R9
            v_398 = R11
            R1 = self.ANDS(R1, R3)
            R3 = R11 & R9
            R9 = R1 | R3
            R3 = self.check(R11) << 30
            R4 = self.check(R11) >> 28
            R3 = R3 | self.check(R10) >> 2
            R4 = R4 | self.check(R10) << 4
            R6 = R6 | self.check(R11) << 4
            R3 = self.EORS(R3, R4)
            R4 = self.check(R11) << 25
            R4 = R4 | self.check(R10) >> 7
            R1 = v_3A4
            R3 = self.EORS(R3, R4)
            R4 = self.check(R11) >> 2
            R4 = R4 | self.check(R10) << 30
            v_39C = R10
            R4 = self.EORS(R4, R6)
            R6 = self.check(R11) >> 7
            R6 = R6 | self.check(R10) << 25
            R4 = self.EORS(R4, R6)
            R6 = R10 | R0
            R6 = self.ANDS(R6, R1)
            R1 = R10 & R0
            R1 = self.ORRS(R1, R6)
            R10 = LR
            R0 = self.ADDS(R4, R1)
            v_390 = R0
            R0 = self.ADC(R3, R9)
            v_38C = R0
            R0 = v_3A8
            R9 = R12
            R4 = self.ADDS(R5, R0)
            R0 = v_3AC
            v_3A8 = R4
            R0 = self.ADCS(R0, R2)
            R3 = self.LSRS(R4, 0xE)
            v_3AC = R0
            R1 = self.LSRS(R0, 0x12)
            R2 = self.LSRS(R0, 0xE)
            R1 = R1 | self.check(R4) << 14
            R2 = R2 | self.check(R4) << 18
            R1 = self.EORS(R1, R2)
            R2 = self.LSLS(R0, 0x17)
            R2 = R2 | self.check(R4) >> 9
            R3 = R3 | self.check(R0) << 18
            R11 = R1 ^ R2
            R2 = self.LSRS(R4, 0x12)
            R2 = R2 | self.check(R0) << 14
            R2 = self.EORS(R2, R3)
            R3 = self.LSRS(R0, 9)
            R3 = R3 | self.check(R4) << 23
            R2 = self.EORS(R2, R3)
            R3 = LR ^ R8
            R3 = self.ANDS(R3, R0)
            R0 = v_388
            LR = R3 ^ R8
            R5 = R12 ^ R0
            R5 = self.ANDS(R5, R4)
            R3 = R0
            R5 = self.EORS(R5, R0)
            R4 = self.rodata[0x10 * index + 14]
            R6 = self.rodata[0x10 * index + 15]
            R0 = v_380
            R4 = self.ADDS(R4, R0)
            R0 = v_37C
            R6 = self.ADCS(R6, R0)
            R0 = list_3B8[0x10 * index + 14]
            R1 = list_3B8[0x10 * index + 15]
            R1 = self.ADDS(R1, R4)
            R0 = self.ADCS(R0, R6)
            R1 = self.ADDS(R1, R5)
            R0 = self.ADC(R0, LR)
            R1 = self.ADDS(R1, R2)
            R2 = v_390
            R0 = self.ADC(R0, R11)
            R4 = R8
            LR = self.ADDS(R2, R1)
            R2 = v_38C
            R6 = R3
            R12 = self.ADC(R2, R0)
            R2 = v_384
            R8 = self.ADDS(R1, R2)
            R2 = v_36C
            R5 = self.ADC(R0, R2)

        list_638 = [
            self.check(LR), self.check(R12), self.check(v_39C), self.check(v_398),
            self.check(v_378), self.check(v_374), self.check(v_3A4), self.check(v_3A0),
            self.check(R8), self.check(R5), self.check(v_3A8), self.check(v_3AC),
            self.check(R9), self.check(R10), self.check(R6), self.check(R4),
        ]

        for i in range(8):
            R0 = param_list[2 * i]
            R1 = param_list[2 * i + 1]
            R0 = self.ADDS(R0, list_638[2 * i])
            R1 = self.ADCS(R1, list_638[2 * i + 1])
            param_list[2 * i] = R0
            param_list[2 * i + 1] = R1
        return param_list

    def hex_C52(self, list_6B0):
        list_8D8 = []
        for i in range(8):
            tmp = self.hex_list([list_6B0[2 * i + 1], list_6B0[2 * i]])
            list_8D8 = list_8D8 + tmp
        return list_8D8

    def toHex(self, num):
        return format(int(num), "x")

    def check(self, tmp):
        ss = ""
        if tmp < 0:
            ss = self.toHex(4294967296 + int(tmp))
        else:
            ss = self.toHex(tmp)
        if len(ss) > 8:
            size = len(ss)
            start = size - 8
            ss = ss[start:]
            tmp = int(self.parseLong(ss, 10, 16))
        return tmp  # 3035769959

    def ADDS(self, a, b):
        c = self.check(a) + self.check(b)
        if len(self.toHex(c)) > 8:
            self.CF = 1
        else:
            self.CF = 0
        result = self.check(c)
        return result

    def ANDS(self, a, b):
        return self.check(a & b)

    def EORS(self, a, b):
        return (self.check(a ^ b))

    def ADC(self, a, b):

        c = self.check(a) + self.check(b)
        d = self.check(c + self.CF)
        return d

    def ADCS(self, a, b):
        c = self.check(a) + self.check(b)
        d = self.check(c + self.CF)
        if len(self.toHex(c)) > 8:
            self.CF = 1
        else:
            self.CF = 0
        return d

    def LSLS(self, num, k):
        result = self.bin_type(num)
        self.CF = result[k - 1]
        return self.check(self.check(num) << k)

    def LSRS(self, num, k):
        result = self.bin_type(num)
        self.CF = result[len(result) - k]
        return self.check(self.check(num) >> k)

    def ORRS(self, a, b):
        return self.check(a | b)

    def RRX(self, num):
        result = self.bin_type(num)
        lenght = len(result)
        s = str(self.CF) + result[:lenght - 1 - 0]
        return self.parseLong(s, 10, 2)

    def bin_type(self, num):
        result = ""
        num = self.check(num)
        lst = self.toBinaryString(num)
        for i in range(32):
            if i < len(lst):
                result += str(lst[i])
            else:
                result = "0" + result
        return result

    def UBFX(self, num, lsb, width):
        tmp_string = self.toBinaryString(num)
        while len(tmp_string) < 32:
            tmp_string = "0" + tmp_string
        lens = len(tmp_string)
        start = lens - lsb - width
        end = start - lsb
        a = int(self.parseLong(tmp_string[start:end - start], 10, 2))

        return int(self.parseLong(tmp_string[start:end - start], 10, 2))

    def UFTX(self, num):
        tmp_string = self.toBinaryString(num)
        start = len(tmp_string) - 8
        return self.parseLong(tmp_string[start:], 10, 2)

    def toBinaryString(self, num):
        return "{0:b}".format(num)

    def setData(self, data):
        self.__content_raw = data
        self.__content = data
        self.list_9C8 = self.hex_9C8()

    def hex_9C8(self):
        result = []
        for i in range(32):
            result.append(self.chooice(0, 0x100))
        return result

    def chooice(self, start, end):
        return int(random.uniform(0, 1) * (end + 1 - start) + start)

    def s2b(self, data):
        arr = []
        for i in range(len(data)):
            arr.append(data[i])
        return arr

    def hex_list(self, content):
        result = []
        for value in content:
            tmp = self.toHex(value)
            while len(tmp) < 8:
                tmp = "0" + tmp
            for i in range(4):
                start = 2 * i
                end = 2 * i + 2
                ss = tmp[start:end]
                result.append(int(self.parseLong(ss, 10, 16)))
        return result

    def parseLong(self, num, to_base=10, from_base=10):
        if isinstance(num, str):
            n = int(num, from_base)
        else:
            n = int(num)
        alphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        if n < to_base:
            return alphabet[n]
        else:
            return self.parseLong(n // to_base, to_base) + alphabet[n % to_base]

    def byteArray2str(self, b):
        return (binascii.hexlify(bytes(b)).decode())

    def changeByteArrayToLong(self, bytes):
        result = []
        for byte in bytes:
            if byte < 0:
                result.append(byte + 256)
            else:
                result.append(byte)
        return result


================================================
FILE: lib/XArgus.py
================================================
from base64 import b64encode
from hashlib import md5
import hashlib
from random import randint, random
from struct import unpack
from time import time
from urllib.parse import parse_qs

from Crypto.Cipher.AES import MODE_CBC, block_size, new
from Crypto.Util.Padding import pad

from .protobuf import ProtoBuf
from .Simon import simon_enc
from .Sm3 import SM3


class Argus:
    def encrypt_enc_pb(data, l):
        data = list(data)
        xor_array = data[:8]

        for i in range(8, l):
            data[i] ^= xor_array[i % 8]

        return bytes(data[::-1])

    @staticmethod
    def calculate_constant(code):
        parts = [int(digit) for digit in code.replace(".", "").zfill(6)]
        return sum(
            part * weight
            for part, weight in zip(
                parts, [20480, 2048, 20971520, 2097152, 1342177280, 134217728]
            )
        )

    @staticmethod
    def get_bodyhash(stub: str | None = None) -> bytes:
        return (
            SM3().sm3_hash(bytes(16))[0:6]
            if stub == None or len(stub) == 0
            else SM3().sm3_hash(bytes.fromhex(stub))[0:6]
        )

    @staticmethod
    def get_queryhash(query: str) -> bytes:
        if not isinstance(query, str):
            raise ValueError("query must be a string")
        return (
            SM3().sm3_hash(bytes(16))[0:6]
            if query == None or len(query) == 0
            else SM3().sm3_hash(query.encode())[0:6]
        )

    @staticmethod
    def encrypt(xargus_bean: dict):
        protobuf = pad(bytes.fromhex(ProtoBuf(xargus_bean).toBuf().hex()), block_size)
        new_len = len(protobuf)
        sign_key = b"\xac\x1a\xda\xae\x95\xa7\xaf\x94\xa5\x11J\xb3\xb3\xa9}\xd8\x00P\xaa\n91L@R\x8c\xae\xc9RV\xc2\x8c"
        sm3_output = b"\xfcx\xe0\xa9ez\x0ct\x8c\xe5\x15Y\x90<\xcf\x03Q\x0eQ\xd3\xcf\xf22\xd7\x13C\xe8\x8a2\x1cS\x04"  # sm3_hash(sign_key + b'\xf2\x81ao' + sign_key)

        key = sm3_output[:32]
        key_list = []
        enc_pb = bytearray(new_len)

        for _ in range(2):
            key_list = key_list + list(unpack("<QQ", key[_ * 16 : _ * 16 + 16]))

        for _ in range(int(new_len / 16)):
            pt = list(unpack("<QQ", protobuf[_ * 16 : _ * 16 + 16]))
            ct = simon_enc(pt, key_list)
            enc_pb[_ * 16 : _ * 16 + 8] = ct[0].to_bytes(8, byteorder="little")
            enc_pb[_ * 16 + 8 : _ * 16 + 16] = ct[1].to_bytes(8, byteorder="little")

        b_buffer = Argus.encrypt_enc_pb(
            (b"\xf2\xf7\xfc\xff\xf2\xf7\xfc\xff" + enc_pb), new_len + 8
        )
        b_buffer = b"\xa6n\xad\x9fw\x01\xd0\x0c\x18" + b_buffer + b"ao"

        cipher = new(md5(sign_key[:16]).digest(), MODE_CBC, md5(sign_key[16:]).digest())

        return b64encode(
            b"\xf2\x81" + cipher.encrypt(pad(b_buffer, block_size))
        ).decode("utf-8")

    @staticmethod
    def get_sign(
        params: None | str = None,
        stub: None | str = None,
        timestamp: int = int(time()),
        aid: int = 1233,
        license_id: int = 1611921764,
        platform: int = 0,
        channel="googleplay",
        sec_device_id: str = None,
        sdk_version: str = "v04.04.05-ov-android",
        sdk_version_int: int = 134744640,
        lanusk=None,
        lanusk_version=None,
        seed_token=None,
        seed_version=None,
    ):
        params_dict = parse_qs(params)
        argus_bean = {
            1: 0x20200929 << 1,  # magic
            2: 2,  # version
            3: randint(0, 0x7FFFFFFF),  # rand
            4: str(aid),  # msAppID
            5: params_dict.get("device_id",[None])[0],  # deviceID
            6: str(license_id),  # licenseID
            7: params_dict.get("version_name",[None])[0],  # appVersion
            8: sdk_version,  # sdkVersionStr
            9: sdk_version_int,  # sdkVersion
            10: bytes(8),  # envcode -> jailbreak Detection
            11: platform,  # platform (ios = 1)
            12: timestamp << 1,  # createTime
            13: Argus.get_bodyhash(stub),  # bodyHash
            14: Argus.get_queryhash(params),  # queryHash
            # 15: {
            #     1: random.randint(10, 100),
            #     2: random.randint(10, 100),
            #     3: random.randint(10, 100),
            #     5: random.randint(10, 100),
            #     6: random.randint(10, 100) * 2,
            #     7: (timestamp - 240) << 1,
            # },
        }
        if sec_device_id:
            argus_bean[16] = sec_device_id
        # argus_bean[17] = timestamp << 1
        if lanusk and lanusk_version:
            argus_bean[18] = bytes.fromhex(
                hashlib.md5(lanusk.encode("utf-8")).hexdigest()
            )
            argus_bean[19] = SM3().sm3_hash(
                bytes.fromhex(
                    params.encode("utf-8").hex()
                    + stub
                    + lanusk_version.encode("utf-8").hex()
                )
            )
            argus_bean[20] = lanusk_version
        else:
            argus_bean[20] = "none"
        argus_bean[20] = 738
        argus_bean[23] = {
            1: str(params_dict.get("device_type", [""])[0]),
            2: params_dict.get("os_version", [""])[0],
            3: channel,
            4: Argus.calculate_constant(params_dict.get("os_version", [""])[0]),
        }
        if seed_token and seed_version:
            argus_bean[24] = str(seed_token)
            argus_bean[25] = random.choice([2, 6, 8, 10])
            argus_bean[26] = {1: int(seed_version) << 1, 2: seed_version}
        return Argus.encrypt(argus_bean)


if __name__ == "__main__":

    print(
        Argus.get_sign(
            params="user_id=6928026132446266374&sec_user_id=MS4wLjABAAAAR9MfYTvIWfBW_EvwHGL7lkY_ff8BsPIujg3UPwPGacX5Q2UMVPiNGjYpDv1ux68Z&manifest_version_code=2023009040&app_language=en&app_type=normal&iid=7410429761295550214&channel=googleplay&device_type=SM-A127F&language=en&cpu_support64=true&host_abi=armeabi-v7a&locale=en&resolution=1467x720&openudid=94f7525e8469e214&update_version_code=2023009040&ac2=wifi&cdid=b1814d42-f71b-4ee3-8019-1b5c0099c912&sys_region=US&os_api=29&uoo=0&timezone_name=America%2FLos_Angeles&dpi=300&ac=wifi&device_id=7410428789866563078&os_version=10&timezone_offset=-25200&version_code=300904&app_name=musical_ly&ab_version=30.9.4&version_name=30.9.4&device_brand=samsung&op_region=US&ssmix=a&device_platform=android&build_number=30.9.4&region=US&aid=1233&ts=1726722185&_rticket=1726722185321",
            stub=None,
            timestamp=1726722185,
            platform=0,
            aid=1233,
            license_id=1611921764,
            sec_device_id="",
            sdk_version="v04.04.05-ov-android",
            sdk_version_int=134744640,
        )
    )


================================================
FILE: lib/XGorgon.py
================================================

import hashlib
from copy import deepcopy
import time

class XGorgon:
    def __encryption(self):
        tmp = ''
        hex_zu = []
        for i in range(0, 256):
            hex_zu.append(i)
        for i in range(0, 256):
            if i == 0:
                A = 0
            elif tmp:
                A = tmp
            else:
                A = hex_zu[i - 1]
            B = self.hex_str[i % 8]
            if A == 85:
                if i != 1:
                    if tmp != 85:
                        A = 0
            C = A + i + B
            while C >= 256:
                C = C - 256
            if C < i:
                tmp = C
            else:
                tmp = ''
            D = hex_zu[C]
            hex_zu[i] = D
        return hex_zu

    def __initialize(self, input, hex_zu):
        tmp_add = []
        tmp_hex = deepcopy(hex_zu)
        for i in range(self.length):
            A = input[i]
            if not tmp_add:
                B = 0
            else:
                B = tmp_add[-1]
            C = hex_zu[i + 1] + B
            while C >= 256:
                C = C - 256
            tmp_add.append(C)
            D = tmp_hex[C]
            tmp_hex[i + 1] = D
            E = D + D
            while E >= 256:
                E = E - 256
            F = tmp_hex[E]
            G = A ^ F
            input[i] = G
        return input

    def __handle(self, input):
        for i in range(self.length):
            A = input[i]
            B = self.__reverse(A)
            C = input[(i + 1) % self.length]
            D = B ^ C
            E = self.__RBIT(D)
            F = E ^ self.length
            G = ~F
            while G < 0:
                G += 4294967296
            H = int(hex(G)[-2:], 16)
            input[i] = H
        return input

    def __main(self,gorgon):
        result = ''
        for item in self.__handle(self.__initialize(gorgon, self.__encryption())):
            result = result + self.__hex2string(item)
        return '0404{hash1}{hash2}{hash3}{hash4}{hash5}'.format(
            hash1=self.__hex2string(self.hex_str[7]),
            hash2=self.__hex2string(self.hex_str[3]),
            hash3=self.__hex2string(self.hex_str[1]),
            hash4=self.__hex2string(self.hex_str[6]),
            hash5=result)

    def __init__(self):
        self.length = 20
        #self.hex_str = [30, 0, 224,  228,  147,  69,  1,  208]
        self.hex_str=[30, 64, 224, 217, 147, 69, 0, 180]

    def __reverse(self, num):
        tmp_string = hex(num)[2:]
        if len(tmp_string) < 2:
            tmp_string = '0' + tmp_string
        return int(tmp_string[1:] + tmp_string[:1], 16)

    def __RBIT(self, num):
        result = ''
        tmp_string = bin(num)[2:]
        while len(tmp_string) < 8:
            tmp_string = '0' + tmp_string
        for i in range(0, 8):
            result = result + tmp_string[7 - i]
        return int(result, 2)

    def __hex2string(self, num):
        tmp_string = hex(num)[2:]
        if len(tmp_string) < 2:
            tmp_string = '0' + tmp_string
        return tmp_string

    def calculate(self, params:str, headers={}):
        gorgon = []
        headers2 = {}
        Khronos = hex(int(time.time()))[2:]
        url_md5 = hashlib.md5(params.encode("UTF-8")).hexdigest()
        for i in range(0, 4):
            gorgon.append(int(url_md5[2 * i: 2 * i + 2], 16))

        for k, v in headers.items():
            headers2[k.lower()] = v

        if "x-ss-stub" in headers2:
            data_md5 = headers2['x-ss-stub']
            for i in range(0, 4):
                gorgon.append(int(data_md5[2 * i: 2 * i + 2], 16))
        else:
            for i in range(0, 4):
                gorgon.append(0)
        if "cookie" in headers2:
            cookie_md5 = hashlib.md5(
                headers2['cookie'].encode("UTF-8")).hexdigest()
            for i in range(0, 4):
                gorgon.append(int(cookie_md5[2 * i: 2 * i + 2], 16))
        else:
            for i in range(0, 4):
                gorgon.append(0)

        for i in range(0, 4):
            gorgon.append(0)
        for i in range(0, 4):
            gorgon.append(int(Khronos[2 * i: 2 * i + 2], 16))
        return {'X-Gorgon': self.__main(gorgon), 'X-Khronos': str(int(Khronos, 16))}


================================================
FILE: lib/XLadon.py
================================================
import base64
import ctypes
import hashlib
from os import urandom

from .pkcs7_padding import padding_size, pkcs7_padding_pad_buffer


def md5bytes(data: bytes) -> str:
    m = hashlib.md5()
    m.update(data)
    return m.hexdigest()


def get_type_data(ptr, index, data_type):
    if data_type == "uint64_t":
        return int.from_bytes(ptr[index * 8 : (index + 1) * 8], "little")
    else:
        raise ValueError("Invalid data type")


def set_type_data(ptr, index, data, data_type):
    if data_type == "uint64_t":
        ptr[index * 8 : (index + 1) * 8] = data.to_bytes(8, "little")
    else:
        raise ValueError("Invalid data type")


def validate(num):
    return num & 0xFFFFFFFFFFFFFFFF


def __ROR__(value: ctypes.c_ulonglong, count: int) -> ctypes.c_ulonglong:
    nbits = ctypes.sizeof(value) * 8
    count %= nbits
    low = ctypes.c_ulonglong(value.value << (nbits - count)).value
    value = ctypes.c_ulonglong(value.value >> count).value
    value = value | low
    return value


def encrypt_ladon_input(hash_table, input_data):
    data0 = int.from_bytes(input_data[:8], byteorder="little")
    data1 = int.from_bytes(input_data[8:], byteorder="little")

    for i in range(0x22):
        hash = int.from_bytes(hash_table[i * 8 : (i + 1) * 8], byteorder="little")
        data1 = validate(hash ^ (data0 + ((data1 >> 8) | (data1 << (64 - 8)))))
        data0 = validate(data1 ^ ((data0 >> 0x3D) | (data0 << (64 - 0x3D))))

    output_data = bytearray(26)
    output_data[:8] = data0.to_bytes(8, byteorder="little")
    output_data[8:] = data1.to_bytes(8, byteorder="little")

    return bytes(output_data)


def encrypt_ladon(md5hex: bytes, data: bytes, size: int):
    hash_table = bytearray(272 + 16)
    hash_table[:32] = md5hex

    temp = []
    for i in range(4):
        temp.append(int.from_bytes(hash_table[i * 8 : (i + 1) * 8], byteorder="little"))

    buffer_b0 = temp[0]
    buffer_b8 = temp[1]
    temp.pop(0)
    temp.pop(0)

    for i in range(0, 0x22):
        x9 = buffer_b0
        x8 = buffer_b8
        x8 = validate(__ROR__(ctypes.c_ulonglong(x8), 8))
        x8 = validate(x8 + x9)
        x8 = validate(x8 ^ i)
        temp.append(x8)
        x8 = validate(x8 ^ __ROR__(ctypes.c_ulonglong(x9), 61))
        set_type_data(hash_table, i + 1, x8, "uint64_t")
        buffer_b0 = x8
        buffer_b8 = temp[0]
        temp.pop(0)

    new_size = padding_size(size)

    input = bytearray(new_size)
    input[:size] = data
    pkcs7_padding_pad_buffer(input, size, new_size, 16)

    output = bytearray(new_size)
    for i in range(new_size // 16):
        output[i * 16 : (i + 1) * 16] = encrypt_ladon_input(
            hash_table, input[i * 16 : (i + 1) * 16]
        )

    return output


def ladon_encrypt(
    timestamp      : int,
    license_id        : int   = 1611921764,
    aid          : int   = 1233,
    random_bytes : bytes = urandom(4)) -> str:
    
    data       = f"{timestamp}-{license_id}-{aid}"

    keygen     = random_bytes + str(aid).encode()
    md5hex     = md5bytes(keygen)

    size       = len(data)
    new_size   = padding_size(size)

    output     = bytearray(new_size + 4)
    output[:4] = random_bytes

    output[4:] = encrypt_ladon(md5hex.encode(), data.encode(), size)

    return base64.b64encode(bytes(output)).decode()


class Ladon:
    @staticmethod
    def encrypt(timestamp: int, license_id: str =1611921764, aid: int =1233) -> str:
        return ladon_encrypt(timestamp, license_id, aid)


if __name__ == "__main__":
    print(ladon_encrypt(timestamp=1674223203,license_id= 1611921764,aid= 1233))

================================================
FILE: lib/Xlog.py
================================================
import binascii
import codecs
import ctypes


class XLOG:
    def encrypt(self, inputStart):
        inputStart = list(inputStart.encode())
        sourceLen = len(inputStart)

        fillCount = 4 - sourceLen % 4

        fillNum = 8 - sourceLen % 8

        if fillNum == 8:
            fillNum = 0

        _bytes = []
        for i in range(sourceLen + fillNum + 8):
            _bytes.append(0)
        eorByte = [0x78, 0x46, 0x8e, 0xc4, 0x74, 0x4c, 0x00, 0x00]
        _bytes[0] = 0x80 | fillNum - 256
        _bytes[1] = 0x30
        _bytes[2] = 0x22
        _bytes[3] = 0x24

        result = "02"

        for i in range(len(inputStart)):
            _bytes[fillCount + i] = inputStart[i]

        for i in range(len(_bytes) // 8):

            sb = ""
            for j in range(8):

                r1 = _bytes[j + 8 * i]

                r2 = eorByte[j]

                if r2 < 0:
                    r2 = r2 + 256
                if r1 < 0:
                    r1 = r1 + 256

                tmp = r1 ^ r2

                if tmp == 0:
                    sb += "00"

                else:
                    sb += self.hex2string(tmp)

            times = self.getHandleCount("78468ec4")
            s = self.calculateRev(sb, times)

            for z in range(8):
                substring = s[2 * z: 2 * z + 2]
                eorByte[z] = int(substring, 16)

            result += s

        result += "78468ec4"

        return binascii.unhexlify(result)

    def decrypt(self, decode):
        decode = decode.hex()
        s = decode[2:]
        strList = []
        for i in range(int(len(s) / 16)):
            input = s[i * 16: i * 16 + 16]
            strList.append(input)
        last = s[(int(len(s) / 16) * 16):]
        strList.append(last)
        times = self.getHandleCount(last)
        _str = ""
        for i in range(len(strList) - 1):
            calculate = self.calculate(strList[i], times)

            if i == 0:
                tmp = last + "744c0000"
                for j in range(8):
                    xor = self.xor(
                        calculate[j * 2:j * 2 + 2], tmp[j * 2: j * 2 + 2])
                    if len(xor) < 2:
                        xor = "0" + xor
                    _str += xor
            if i >= 1:
                tmp = strList[i - 1]
                for j in range(8):
                    xor = self.xor(
                        calculate[j * 2:j * 2 + 2], tmp[j * 2: j * 2 + 2])
                    if len(xor) < 2:
                        xor = "0" + xor
                    _str += xor
        _bytes = codecs.decode(_str, 'hex_codec')

        count = int(_bytes[0]) & 7

        resultLen = (len(decode) // 2) - 13 - count
        count = count % 4
        if count == 0:
            count = 4
        result = bytearray(resultLen)
        for i in range(resultLen):
            result[i] = _bytes[count + i]

        res= bytes(result).decode()
        return res

    def calculate(self, input, times):
        if len(input) != 16:
            return ""
        s108 = ctypes.c_int(0xBFFFE920 << 0).value
        s136 = ctypes.c_int((0x9e3779b9 * times) << 0).value
        s140 = int(input[0:8], 16) << 0 & 0xFFFFFFFF
        s144 = int(input[8:16], 16) << 0 & 0xFFFFFFFF

        for i in range(times):
            r0 = s140
            r2 = s140
            r4 = s140
            r6 = s136
            r5 = s108
            s = format(self.rshift(r6 >> 0xb, 0) >> 0, 'b')
            if len(s) < 3:
                s = "0"
            else:
                s = s[len(s) - 2:]

            r6 = int(s, 2)
            r0 = ctypes.c_int(((self.rshift(r2, 5) ^ r0 << 4) + r4) << 0).value
            r5 = ctypes.c_int(self.getShifting(r5 + (r6 << 2))).value
            r6 = 0x61c88647 << 0 & 0xFFFFFFFF
            r2 = (s136 + r5) << 0 & 0xFFFFFFFF

            r5 = s136
            r0 = r0 ^ r2
            r2 = s108

            r6 = (r6 + r5) << 0 & 0xFFFFFFFF
            r4 = (s144 - r0) << 0 & 0xFFFFFFFF

            r5 = r6 & 3
            r0 = r4 << 4
            r2 = self.getShifting(r2 + (r5 << 2) & 0xFFFFFFFF)
            r0 = ((r0 ^ (self.rshift(r4, 5))) + r4) << 0
            r2 = (r2 + r6) << 0 & 0xFFFFFFFF
            r0 = r0 ^ r2
            s140 = (s140 - r0) << 0 & 0xFFFFFFFF
            s136 = r6 & 0xFFFFFFFF
            s144 = r4 & 0xFFFFFFFF
        str140 = format(self.rshift(s140, 0), 'x')

        str144 = format(self.rshift(s144, 0), 'x')

        if len(str140) < 8:
            count = 8 - len(str140)

            for i in range(count):
                str140 = "0" + str140

        if len(str144) < 8:
            count = 8 - len(str144)
            for i in range(count):
                str144 = "0" + str144

        return str140 + str144

    def xor(self, strHex_X, strHex_Y):
        anotherBinary = format(int(strHex_X, 16), 'b')
        thisBinary = format(int(strHex_Y, 16), 'b')
        result = ""
        if len(anotherBinary) != 8:
            for i in range(len(anotherBinary), 8):
                anotherBinary = "0" + anotherBinary

        if len(thisBinary) != 8:
            for i in range(len(thisBinary), 8):
                thisBinary = "0" + thisBinary
        for i in range(len(anotherBinary)):
            if thisBinary[i] == anotherBinary[i]:
                result += "0"
            else:
                result += "1"

        return format((int(result, 2)), 'x')

    def getHandleCount(self, hex):
        reverse = self.reverse(hex)
        r0 = 0xCCCCCCCD
        r1 = int(reverse, 16)
        r2 = self.getUmullHigh(r1, r0)
        r2 = ctypes.c_int(r2 >> 2).value
        r2 = r2 + ctypes.c_int((r2 << 2)).value
        r1 = r1 - r2
        r2 = 0x20
        r1 = r2 + ctypes.c_int(r1 << 3).value
        return r1

    def getShifting(self, point):
        p = ctypes.c_int(point << 0).value

        if p == ctypes.c_int(0xbfffe920 << 0).value:
            return ctypes.c_int(0x477001de << 0).value
        if p == ctypes.c_int(0xbfffe924 << 0).value:
            return ctypes.c_int(0xfacedead << 0).value
        if p == ctypes.c_int(0xbfffe928 << 0).value:
            return ctypes.c_int(0x30303030 << 0).value
        if p == ctypes.c_int(0xbfffe92c << 0).value:
            return ctypes.c_int(0x39353237 << 0).value
        return 0x00000000

    def calculateRev(self, input, times):
        s108 = 0xbfffe920 << 0 & 0xFFFFFFFF
        s136 = 0x0
        s140 = int(input[0:8], 16) << 0 & 0xFFFFFFFF
        s144 = int(input[8:16], 16) << 0 & 0xFFFFFFFF

        for i in range(times):
            r2 = s108
            r6 = s136
            r4 = s144
            r5 = r6 & 3 & 0xFFFFFFFF
            r0 = r4 << 4 & 0xFFFFFFFF
            r2 = self.getShifting(r2 + (r5 << 2) & 0xFFFFFFFF)
            r0 = ((r0 ^ (self.rshift(r4, 5))) + r4) << 0
            r2 = ctypes.c_int((r2 + r6) << 0 ^ 0).value
            r0 = r0 ^ r2
            s140 = ctypes.c_int((s140 + r0) << 0 ^ 0).value
            s136 = ctypes.c_int((s136 - 0x61c88647) << 0 ^ 0).value

            r5 = s108
            r4 = s140
            r2 = s140
            r0 = s140
            r6 = s136
            s = format(self.rshift((r6 >> 0xb), 0), 'b')
            if len(s) < 3:
                s = "0"
            else:
                s = s[len(s) - 2:]

            r6 = int(s, 2)
            r0 = ctypes.c_int(((self.rshift(r2, 5) ^ r0 << 4) + r4) << 0).value
            r5 = self.getShifting(r5 + (r6 << 2))
            r2 = ctypes.c_int((s136 + r5) << 0 ^ 0).value
            r0 = r0 ^ r2
            s144 = ctypes.c_int((s144 + r0) << 0 ^ 0).value

        str140 = format(self.rshift(s140, 0), 'x')

        str144 = format(self.rshift(s144, 0), 'x')

        if len(str140) < 8:
            count = 8 - len(str140)
            for i in range(count):
                str140 = "0" + str140

        if len(str144) < 8:
            count = 8 - len(str144)
            for i in range(count):
                str144 = "0" + str144

        return str140 + str144

    def reverse(self, hex: str):
        return hex[6:8] + hex[4:6] + hex[2:4] + hex[0:2]

    def rshift(self, val, n):
        return (val % 0x100000000) >> n

    def getUmullHigh(self, r0, r2):
        n1 = r0
        n2 = r2
        result = n1 * n2
        s = format(result, 'x')
        s = s[0: len(s) - 8]
        return int(s, 16)

    def hex2string(self, num: int):
        s = format(num, 'x')
        if len(s) < 2:
            return '0' + s
        return s

    def fch(self, xlog):
        xlog = xlog[0:len(xlog) - 20] # we don't have blank space before closing brack after json.dumps
        fch_str = binascii.crc32(xlog.encode("utf-8"))
        fch_str = str(fch_str)
        for i in range(len(fch_str), 10):
            fch_str = '0' + fch_str
        return xlog + ',"fch":"{fch_str}" }'


================================================
FILE: lib/aweme_v2_pb2.py
================================================
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: aweme-v2.proto

from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()




DESCRIPTOR = _descriptor.FileDescriptor(
  name='aweme-v2.proto',
  package='',
  syntax='proto3',
  serialized_options=None,
  create_key=_descriptor._internal_create_key,
  serialized_pb=b'\n\x0e\x61weme-v2.proto\"\x8e\x01\n\x0bUrlStructV2\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x03(\t\x12\r\n\x05width\x18\x03 \x01(\x05\x12\x0e\n\x06height\x18\x04 \x01(\x05\x12\x0f\n\x07url_key\x18\x05 \x01(\t\x12\x11\n\tdata_size\x18\x06 \x01(\x03\x12\x11\n\tfile_hash\x18\x07 \x01(\t\x12\x0f\n\x07\x66ile_cs\x18\x08 \x01(\t\"\xb1\x03\n\rShareStructV2\x12\x11\n\tshare_url\x18\x01 \x01(\t\x12\x12\n\nshare_desc\x18\x03 \x01(\t\x12\x13\n\x0bshare_title\x18\x04 \x01(\t\x12&\n\x10share_qrcode_url\x18\x05 \x01(\x0b\x32\x0c.UrlStructV2\x12\x18\n\x10manage_goods_url\x18\x06 \x01(\t\x12%\n\x0fshare_image_url\x18\x07 \x01(\x0b\x32\x0c.UrlStructV2\x12\x14\n\x0c\x62ool_persist\x18\x08 \x01(\x05\x12\x15\n\rgoods_rec_url\x18\t \x01(\t\x12\x1a\n\x12share_title_myself\x18\n \x01(\t\x12\x19\n\x11share_title_other\x18\x0b \x01(\t\x12\x17\n\x0fshare_link_desc\x18\x0c \x01(\t\x12\x1b\n\x13share_signature_url\x18\r \x01(\t\x12\x1c\n\x14share_signature_desc\x18\x0e \x01(\t\x12\x13\n\x0bshare_quote\x18\x0f \x01(\t\x12\x15\n\rwhatsapp_desc\x18\x10 \x01(\t\x12\x17\n\x0fshare_desc_info\x18\x11 \x01(\t\"\xac\x01\n\x18OriginalMusicianStructV2\x12\x13\n\x0bmusic_count\x18\x01 \x01(\x05\x12\x18\n\x10music_used_count\x18\x02 \x01(\x05\x12&\n\x10music_qrcode_url\x18\x03 \x01(\x0b\x32\x0c.UrlStructV2\x12%\n\x0fmusic_cover_url\x18\x04 \x01(\x0b\x32\x0c.UrlStructV2\x12\x12\n\ndigg_count\x18\x05 \x01(\x05\"\xa5\x01\n\x11\x46ollowersDetailV2\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0c\n\x04icon\x18\x02 \x01(\t\x12\x12\n\nfans_count\x18\x03 \x01(\x05\x12\x10\n\x08open_url\x18\x04 \x01(\t\x12\x10\n\x08\x61pple_id\x18\x05 \x01(\t\x12\x14\n\x0c\x64ownload_url\x18\x06 \x01(\t\x12\x14\n\x0cpackage_name\x18\x07 \x01(\t\x12\x10\n\x08\x61pp_name\x18\x08 \x01(\t\"Z\n\x1aPlatformSyncStatusStructV2\x12\x15\n\rplatform_name\x18\x01 \x01(\t\x12\x10\n\x08nickname\x18\x02 \x01(\t\x12\x13\n\x0b\x66ull_synced\x18\x03 \x01(\x08\"V\n\x18\x41vatarDecorationStructV2\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0c\n\x04name\x18\x02 \x01(\t\x12 \n\nsource_url\x18\x03 \x01(\x0b\x32\x0c.UrlStructV2\"\x7f\n\x15RecommendItemStructV2\x12\x10\n\x08\x61weme_id\x18\x01 \x01(\t\x12\x1b\n\x05\x63over\x18\x02 \x01(\x0b\x32\x0c.UrlStructV2\x12#\n\rdynamic_cover\x18\x03 \x01(\x0b\x32\x0c.UrlStructV2\x12\x12\n\nmedia_type\x18\x04 \x01(\x03\"%\n\x14\x45\x66\x66\x65\x63tArtistStructV2\x12\r\n\x05total\x18\x01 \x01(\x05\"Y\n\x1a\x43ommercePermissionStructV2\x12\x10\n\x08top_item\x18\x01 \x01(\x05\x12\x0f\n\x07\x61\x64_link\x18\x02 \x01(\x05\x12\x18\n\x10star_atlas_order\x18\x03 \x01(\x05\"G\n\x10RFansGroupInfoV2\x12\x0e\n\x06schema\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\x12\x14\n\x0c\x64ownload_url\x18\x03 \x01(\t\"D\n\rHitTaskInfoV2\x12\x1b\n\x13\x63ompeleted_task_cnt\x18\x01 \x01(\x05\x12\x16\n\x0etotal_task_cnt\x18\x02 \x01(\x05\"\x94\x02\n\x12SimpleUserStructV2\x12\x0b\n\x03uid\x18\x01 \x01(\t\x12\x10\n\x08nickname\x18\x02 \x01(\t\x12\x11\n\tsignature\x18\x03 \x01(\t\x12\"\n\x0c\x61vatar_thumb\x18\x04 \x01(\x0b\x32\x0c.UrlStructV2\x12\x15\n\rfollow_status\x18\x05 \x01(\x05\x12\x0e\n\x06status\x18\x06 \x01(\x05\x12\x11\n\tuser_rate\x18\x07 \x01(\x05\x12#\n\ravatar_larger\x18\x08 \x01(\x0b\x32\x0c.UrlStructV2\x12%\n\rhit_task_info\x18\t \x01(\x0b\x32\x0e.HitTaskInfoV2\x12\x11\n\tunique_id\x18\n \x01(\t\x12\x0f\n\x07sec_uid\x18\x0b \x01(\t\"Q\n\x17HotsearchSprintStructV2\x12\x0e\n\x06sprint\x18\x01 \x01(\x05\x12&\n\tfollowers\x18\x02 \x03(\x0b\x32\x13.SimpleUserStructV2\"U\n\x13VideoUnreadStructV2\x12\x14\n\x0cunread_count\x18\x01 \x01(\x05\x12(\n latest_unread_video_created_time\x18\x02 \x01(\x03\"N\n\x13OfflineInfoStructV2\x12\x19\n\x11offline_info_type\x18\x01 \x01(\x05\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\t\"Y\n\x1aSmartPhoneSettingsStructV2\x12\x14\n\x0cphone_number\x18\x01 \x01(\t\x12\x10\n\x08phone_id\x18\x02 \x01(\t\x12\x13\n\x0b\x65ncrypt_key\x18\x03 \x01(\t\"4\n\x12\x44isclaimerStructV2\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontent\x18\x02 \x01(\t\"3\n\x14\x41nnouncementStructV2\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0c\n\x04\x62ody\x18\x02 \x01(\t\"N\n\x12IconButtonStructV2\x12\x0c\n\x04text\x18\x01 \x01(\t\x12\x1a\n\x04icon\x18\x02 \x01(\x0b\x32\x0c.UrlStructV2\x12\x0e\n\x06\x61\x63tion\x18\x03 \x01(\t\"\x92\x06\n\x11\x43hallengeStructV2\x12\x0b\n\x03\x63id\x18\x01 \x01(\t\x12\x10\n\x08\x63ha_name\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x65sc\x18\x03 \x01(\t\x12\x0e\n\x06schema\x18\x04 \x01(\t\x12\x1d\n\x06\x61uthor\x18\x05 \x01(\x0b\x32\r.UserStructV2\x12\x12\n\nuser_count\x18\x06 \x01(\x05\x12\"\n\nshare_info\x18\x07 \x01(\x0b\x32\x0e.ShareStructV2\x12%\n\rconnect_music\x18\x08 \x03(\x0b\x32\x0e.MusicStructV2\x12\x0c\n\x04type\x18\t \x01(\x05\x12\x10\n\x08sub_type\x18\x0b \x01(\x05\x12*\n\x14\x62\x61\x63kground_image_url\x18\x0c \x01(\x0b\x32\x0c.UrlStructV2\x12\x12\n\nsticker_id\x18\r \x01(\t\x12\x11\n\tlink_text\x18\x0e \x01(\t\x12\x13\n\x0blink_action\x18\x0f \x01(\t\x12\x12\n\nis_pgcshow\x18\x10 \x01(\x08\x12\x14\n\x0c\x63ollect_stat\x18\x11 \x01(\x05\x12 \n\ncover_item\x18\x12 \x01(\x0b\x32\x0c.UrlStructV2\x12\x14\n\x0cis_challenge\x18\x13 \x01(\x05\x12\x12\n\nview_count\x18\x14 \x01(\x03\x12\'\n\ndisclaimer\x18\x15 \x01(\x0b\x32\x13.DisclaimerStructV2\x12\x1a\n\x12\x61llow_upload_cover\x18\x16 \x01(\x08\x12\x13\n\x0bis_commerce\x18\x17 \x01(\x08\x12\x17\n\x0fhashtag_profile\x18\x19 \x01(\t\x12\x13\n\x0b\x63over_photo\x18\x1a \x01(\t\x12\x15\n\ris_hot_search\x18\x1b \x01(\x05\x12\x11\n\tlink_type\x18\x1c \x01(\x05\x12\x30\n\x11\x61nnouncement_info\x18\x1d \x01(\x0b\x32\x15.AnnouncementStructV2\x12\x13\n\x0bmodule_type\x18\x1f \x01(\x05\x12\x13\n\x0bprofile_tag\x18  \x01(\t\x12\x11\n\tcha_attrs\x18! \x03(\t\x12#\n\x06\x62utton\x18\" \x01(\x0b\x32\x13.IconButtonStructV2\"\x83\x02\n\x14\x43ommerceInfoStructV2\x12$\n\x0ehead_image_url\x18\x01 \x01(\x0b\x32\x0c.UrlStructV2\x12*\n\x0coffline_info\x18\x02 \x03(\x0b\x32\x14.OfflineInfoStructV2\x12%\n\tchallenge\x18\x03 \x03(\x0b\x32\x12.ChallengeStructV2\x12\x30\n\x0bsmart_phone\x18\x04 \x01(\x0b\x32\x1b.SmartPhoneSettingsStructV2\x12\x16\n\x0equick_shop_url\x18\x05 \x01(\t\x12\x17\n\x0fquick_shop_name\x18\x06 \x01(\t\x12\x0f\n\x07site_id\x18\x07 \x01(\t\".\n\x10PositionStructV2\x12\r\n\x05\x62\x65gin\x18\x01 \x01(\x05\x12\x0b\n\x03\x65nd\x18\x02 \x01(\x05\"k\n\x15\x43\x61tegoryCoverStructV2\x12\x10\n\x08\x61weme_id\x18\x01 \x01(\t\x12\x1b\n\x05\x63over\x18\x02 \x01(\x0b\x32\x0c.UrlStructV2\x12#\n\rdynamic_cover\x18\x03 \x01(\x0b\x32\x0c.UrlStructV2\"p\n\x14\x45xternalSongStructV2\x12\x0e\n\x06h5_url\x18\x01 \x01(\t\x12\x14\n\x0cpartner_name\x18\x02 \x01(\t\x12\x17\n\x0fpartner_song_id\x18\x03 \x01(\t\x12\x19\n\x11\x65xternal_song_key\x18\x04 \x01(\t\"o\n\x17MatchedPGCSoundStructV2\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0e\n\x06\x61uthor\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x13\n\x0bmixed_title\x18\x04 \x01(\t\x12\x14\n\x0cmixed_author\x18\x05 \x01(\t\"\x89\t\n\rMusicStructV2\x12\n\n\x02id\x18\x01 \x01(\x03\x12\x0e\n\x06id_str\x18\x02 \x01(\t\x12\r\n\x05title\x18\x03 \x01(\t\x12\x0e\n\x06\x61uthor\x18\x04 \x01(\t\x12\r\n\x05\x61lbum\x18\x05 \x01(\t\x12!\n\x0b\x63over_large\x18\x07 \x01(\x0b\x32\x0c.UrlStructV2\x12\"\n\x0c\x63over_medium\x18\x08 \x01(\x0b\x32\x0c.UrlStructV2\x12!\n\x0b\x63over_thumb\x18\t \x01(\x0b\x32\x0c.UrlStructV2\x12\x1e\n\x08play_url\x18\n \x01(\x0b\x32\x0c.UrlStructV2\x12\x10\n\x08\x64uration\x18\x0f \x01(\x05\x12\r\n\x05\x65xtra\x18\x10 \x01(\t\x12\x12\n\nuser_count\x18\x11 \x01(\x05\x12#\n\x08position\x18\x12 \x03(\x0b\x32\x11.PositionStructV2\x12\"\n\nshare_info\x18\x13 \x01(\x0b\x32\x0e.ShareStructV2\x12\x14\n\x0c\x63ollect_stat\x18\x14 \x01(\x05\x12\x0e\n\x06status\x18\x15 \x01(\x05\x12\x14\n\x0coffline_desc\x18\x16 \x01(\t\x12\"\n\x0c\x65\x66\x66\x65\x63ts_data\x18\x17 \x01(\x0b\x32\x0c.UrlStructV2\x12\x10\n\x08owner_id\x18\x18 \x01(\t\x12\x16\n\x0eowner_nickname\x18\x19 \x01(\t\x12\x13\n\x0bis_original\x18\x1e \x01(\x08\x12%\n\tchallenge\x18\x1f \x01(\x0b\x32\x12.ChallengeStructV2\x12\x16\n\x0e\x62illboard_rank\x18  \x01(\x05\x12\x1b\n\x13\x62inded_challenge_id\x18# \x01(\x03\x12\x16\n\x0e\x61uthor_deleted\x18& \x01(\x08\x12\x14\n\x0cowner_handle\x18) \x01(\t\x12*\n\x0f\x61uthor_position\x18* \x03(\x0b\x32\x11.PositionStructV2\x12\x18\n\x10prevent_download\x18+ \x01(\x08\x12\x33\n\x13\x63\x61tegory_cover_info\x18. \x01(\x0b\x32\x16.CategoryCoverStructV2\x12%\n\x0fstrong_beat_url\x18\x31 \x01(\x0b\x32\x0c.UrlStructV2\x12\x31\n\x12\x65xternal_song_info\x18\x34 \x03(\x0b\x32\x15.ExternalSongStructV2\x12\x0f\n\x07sec_uid\x18\x35 \x01(\t\x12\x12\n\nlyric_type\x18\x36 \x01(\x05\x12\x11\n\tlyric_url\x18\x37 \x01(\t\x12\"\n\x0c\x61vatar_thumb\x18\x38 \x01(\x0b\x32\x0c.UrlStructV2\x12#\n\ravatar_medium\x18\x39 \x01(\x0b\x32\x0c.UrlStructV2\x12\x1a\n\x12preview_start_time\x18; \x01(\x01\x12\x18\n\x10preview_end_time\x18< \x01(\x01\x12\x12\n\nmute_share\x18> \x01(\x08\x12\x18\n\x10is_author_artist\x18? \x01(\x08\x12\x0e\n\x06is_pgc\x18@ \x01(\x08\x12\x33\n\x11matched_pgc_sound\x18\x41 \x01(\x0b\x32\x18.MatchedPGCSoundStructV2\"b\n\x15PlayTokenAuthStructV2\x12\x0b\n\x03vid\x18\x01 \x01(\t\x12\r\n\x05token\x18\x02 \x01(\t\x12\x0c\n\x04\x61uth\x18\x03 \x01(\t\x12\x10\n\x08tv_token\x18\x04 \x01(\t\x12\r\n\x05hosts\x18\x05 \x03(\t\"\xaa\x01\n\x0f\x42itRateStructV2\x12\x11\n\tgear_name\x18\x01 \x01(\t\x12\x14\n\x0cquality_type\x18\x02 \x01(\x05\x12\x10\n\x08\x62it_rate\x18\x03 \x01(\x05\x12\x1f\n\tplay_addr\x18\x04 \x01(\x0b\x32\x0c.UrlStructV2\x12\x12\n\nis_bytevc1\x18\x05 \x01(\x05\x12\'\n\x11play_addr_bytevc1\x18\x06 \x01(\x0b\x32\x0c.UrlStructV2\"\xb4\x06\n\rVideoStructV2\x12\x1f\n\tplay_addr\x18\x01 \x01(\x0b\x32\x0c.UrlStructV2\x12\x1b\n\x05\x63over\x18\x02 \x01(\x0b\x32\x0c.UrlStructV2\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\r\n\x05width\x18\x04 \x01(\x05\x12#\n\rdynamic_cover\x18\x05 \x01(\x0b\x32\x0c.UrlStructV2\x12\"\n\x0corigin_cover\x18\x06 \x01(\x0b\x32\x0c.UrlStructV2\x12\r\n\x05ratio\x18\x07 \x01(\t\x12#\n\rdownload_addr\x18\x08 \x01(\x0b\x32\x0c.UrlStructV2\x12\x15\n\rhas_watermark\x18\t \x01(\x08\x12%\n\x0fplay_addr_lowbr\x18\n \x01(\x0b\x32\x0c.UrlStructV2\x12\"\n\x08\x62it_rate\x18\x0b \x03(\x0b\x32\x10.BitRateStructV2\x12\'\n\x11new_download_addr\x18\x0c \x01(\x0b\x32\x0c.UrlStructV2\x12\x10\n\x08\x64uration\x18\r \x01(\x05\x12/\n\x19\x64ownload_suffix_logo_addr\x18\x0e \x01(\x0b\x32\x0c.UrlStructV2\x12%\n\x1dhas_download_suffix_logo_addr\x18\x0f \x01(\x08\x12\'\n\x11play_addr_bytevc1\x18\x10 \x01(\x0b\x32\x0c.UrlStructV2\x12\x12\n\nis_bytevc1\x18\x11 \x01(\x05\x12$\n\x0eplay_addr_h264\x18\x12 \x01(\x0b\x32\x0c.UrlStructV2\x12,\n\x16ui_alike_download_addr\x18\x13 \x01(\x0b\x32\x0c.UrlStructV2\x12\x1d\n\x15\x63\x61ption_download_addr\x18\x14 \x01(\x03\x12\x17\n\x0f\x63\x64n_url_expired\x18\x15 \x01(\x03\x12\x15\n\ris_long_video\x18\x16 \x01(\x05\x12\x13\n\x0bvideo_model\x18\x17 \x01(\t\x12\x16\n\x0eneed_set_token\x18\x18 \x01(\x08\x12\x1b\n\x13misc_download_addrs\x18\x19 \x01(\t\x12*\n\ntoken_auth\x18\x1a \x01(\x0b\x32\x16.PlayTokenAuthStructV2\"\xfc\x01\n\x17\x41wemeStatisticsStructV2\x12\x10\n\x08\x61weme_id\x18\x01 \x01(\t\x12\x15\n\rcomment_count\x18\x02 \x01(\x03\x12\x12\n\ndigg_count\x18\x03 \x01(\x03\x12\x16\n\x0e\x64ownload_count\x18\x04 \x01(\x03\x12\x12\n\nplay_count\x18\x05 \x01(\x03\x12\x13\n\x0bshare_count\x18\x06 \x01(\x03\x12\x15\n\rforward_count\x18\x07 \x01(\x03\x12\x12\n\nlose_count\x18\x08 \x01(\x05\x12\x1a\n\x12lose_comment_count\x18\t \x01(\x05\x12\x1c\n\x14whatsapp_share_count\x18\n \x01(\x03\"\x9e\x02\n\x13\x41wemeStatusStructV2\x12\x10\n\x08\x61weme_id\x18\x01 \x01(\t\x12\x11\n\tis_delete\x18\x02 \x01(\x08\x12\x13\n\x0b\x61llow_share\x18\x03 \x01(\x08\x12\x15\n\rallow_comment\x18\x04 \x01(\x08\x12\x16\n\x0eprivate_status\x18\x07 \x01(\x05\x12\x14\n\x0cin_reviewing\x18\t \x01(\x08\x12\x10\n\x08reviewed\x18\n \x01(\x05\x12\x10\n\x08self_see\x18\x0b \x01(\x08\x12\x15\n\ris_prohibited\x18\x0c \x01(\x08\x12\x17\n\x0f\x64ownload_status\x18\r \x01(\x05\x12\x19\n\x11\x64ont_share_status\x18\x0e \x01(\x05\x12\x19\n\x11video_hide_search\x18\x0f \x01(\x05\"N\n\x16LifeStoryBlockStructV2\x12\x18\n\x10life_story_block\x18\x01 \x01(\x08\x12\x1a\n\x12life_story_blocked\x18\x02 \x01(\x08\"0\n\x0e\x41\x64\x43overTitleV2\x12\r\n\x05title\x18\x01 \x01(\t\x12\x0f\n\x07web_url\x18\x02 \x01(\t\"=\n\x11LiveHonorStructV2\x12\x13\n\x0bhonor_level\x18\x01 \x01(\x05\x12\x13\n\x0bhonor_score\x18\x02 \x01(\x03\"\xcb\x01\n\x16\x42lueVBrandInfoStructV2\x12\x13\n\x0b\x63\x61tegory_id\x18\x01 \x01(\x05\x12\x15\n\rcategory_name\x18\x02 \x01(\t\x12\x10\n\x08\x62rand_id\x18\x03 \x01(\x05\x12\x12\n\nbrand_name\x18\x04 \x01(\t\x12\x1e\n\x08logo_url\x18\x05 \x01(\x0b\x32\x0c.UrlStructV2\x12\x0c\n\x04heat\x18\x06 \x01(\x05\x12\x0c\n\x04rank\x18\x07 \x01(\x05\x12\x11\n\trank_diff\x18\x08 \x01(\x05\x12\x10\n\x08tag_name\x18\t \x01(\t\">\n\x14LinkUserInfoStructV2\x12\x13\n\x0b\x61uth_status\x18\x01 \x01(\x05\x12\x11\n\tauth_type\x18\x02 \x01(\x05\"\xb1\x01\n\x14\x43ommerceUserStructV2\x12\x12\n\nstar_atlas\x18\x01 \x01(\x05\x12#\n\x1bshow_star_atlas_cooperation\x18\x02 \x01(\x08\x12\x15\n\rhas_ads_entry\x18\x03 \x01(\x08\x12-\n\x0elink_user_info\x18\x04 \x01(\x0b\x32\x15.LinkUserInfoStructV2\x12\x1a\n\x12\x61\x64_influencer_type\x18\x05 \x01(\x05\"Y\n\x16QuickShopSecondFloorV2\x12\x14\n\x0cprocess_text\x18\x01 \x01(\t\x12\x12\n\nenter_text\x18\x02 \x01(\t\x12\x15\n\rtrans_bg_text\x18\x03 \x01(\t\"\x91\x01\n\x11QuickShopStructV2\x12\x16\n\x0equick_shop_url\x18\x01 \x01(\t\x12\x17\n\x0fquick_shop_name\x18\x02 \x01(\t\x12\x17\n\x0fwith_text_entry\x18\x03 \x01(\x08\x12\x32\n\x11second_floor_info\x18\x04 \x01(\x0b\x32\x17.QuickShopSecondFloorV2\"j\n\x12PermissionStructV2\x12\x14\n\x0c\x66ollow_toast\x18\x01 \x01(\x05\x12\x15\n\roriginal_list\x18\x02 \x01(\x05\x12\x12\n\nshop_toast\x18\x03 \x01(\x05\x12\x13\n\x0bshare_toast\x18\x04 \x01(\x05\"\x8d$\n\x0cUserStructV2\x12\x0b\n\x03uid\x18\x01 \x01(\t\x12\x10\n\x08short_id\x18\x02 \x01(\t\x12\x10\n\x08nickname\x18\x03 \x01(\t\x12\x11\n\tsignature\x18\x05 \x01(\t\x12#\n\ravatar_larger\x18\x06 \x01(\x0b\x32\x0c.UrlStructV2\x12\"\n\x0c\x61vatar_thumb\x18\x07 \x01(\x0b\x32\x0c.UrlStructV2\x12#\n\ravatar_medium\x18\x08 \x01(\x0b\x32\x0c.UrlStructV2\x12\x15\n\rfollow_status\x18\x0c \x01(\x05\x12\x13\n\x0b\x61weme_count\x18\r \x01(\x05\x12\x17\n\x0f\x66ollowing_count\x18\x0e \x01(\x05\x12\x16\n\x0e\x66ollower_count\x18\x0f \x01(\x05\x12\x18\n\x10\x66\x61voriting_count\x18\x10 \x01(\x05\x12\x17\n\x0ftotal_favorited\x18\x11 \x01(\x05\x12\x10\n\x08is_block\x18\x12 \x01(\x08\x12\x13\n\x0bhide_search\x18\x14 \x01(\x08\x12\x15\n\rcustom_verify\x18\x19 \x01(\t\x12\x11\n\tunique_id\x18\x1a \x01(\t\x12\x12\n\nbind_phone\x18\x1b \x01(\t\x12\x14\n\x0cspecial_lock\x18\x1c \x01(\x
Download .txt
gitextract_k22q0caq/

├── .github/
│   └── FUNDING.yml
├── .gitignore
├── Aptfile
├── LICENSE
├── Procfile
├── README.md
├── example/
│   ├── comment.py
│   ├── gorgon.py
│   └── like_video.py
├── lib/
│   ├── ByteBuf.py
│   ├── Captcha.py
│   ├── Simon.py
│   ├── Sm3.py
│   ├── TTEncrypt.js
│   ├── TTEncrypt.py
│   ├── XArgus.py
│   ├── XGorgon.py
│   ├── XLadon.py
│   ├── Xlog.py
│   ├── aweme_v2_pb2.py
│   ├── colorit.py
│   ├── pkcs7_padding.py
│   ├── protobuf.py
│   ├── sign.py
│   └── utils.py
├── main.py
├── requirements.txt
├── run.sh
└── runtime.txt
Download .txt
SYMBOL INDEX (215 symbols across 16 files)

FILE: lib/ByteBuf.py
  class ByteBuf (line 4) | class ByteBuf:
    method __init__ (line 5) | def __init__(self, data, size=None):
    method data (line 18) | def data(self):
    method size (line 21) | def size(self):
    method remove_padding (line 24) | def remove_padding(self):

FILE: lib/Captcha.py
  class PuzzleSolver (line 7) | class PuzzleSolver:
    method __init__ (line 8) | def __init__(self, base64puzzle, base64piece):
    method get_position (line 12) | def get_position(self):
    method __background_preprocessing (line 19) | def __background_preprocessing(self):
    method __piece_preprocessing (line 24) | def __piece_preprocessing(self):
    method __sobel_operator (line 29) | def __sobel_operator(self, img):
    method __img_to_grayscale (line 44) | def __img_to_grayscale(self, img):
    method __string_to_image (line 47) | def __string_to_image(self, base64_string):

FILE: lib/Simon.py
  function get_bit (line 3) | def get_bit(val, pos):
  function rotate_left (line 6) | def rotate_left(v, n):
  function rotate_right (line 10) | def rotate_right(v, n):
  function key_expansion (line 14) | def key_expansion(key):
  function simon_dec (line 23) | def simon_dec(ct, k, c=0):
  function simon_enc (line 47) | def simon_enc(pt, k, c=0):

FILE: lib/Sm3.py
  class SM3 (line 1) | class SM3:
    method __init__ (line 2) | def __init__(self) -> None:
    method __rotate_left (line 6) | def __rotate_left(self, a: int, k: int) -> int:
    method __FFJ (line 11) | def __FFJ(self, X: int, Y: int, Z: int, j: int) -> int:
    method __GGJ (line 20) | def __GGJ(self, X: int, Y: int, Z: int, j: int) -> int:
    method __P_0 (line 29) | def __P_0(self, X: int) -> int:
    method __P_1 (line 32) | def __P_1(self, X: int) -> int:
    method __CF (line 37) | def __CF(self, V_i: list, B_i: bytearray) -> list:
    method sm3_hash (line 94) | def sm3_hash(self, msg: bytes) -> bytes:

FILE: lib/TTEncrypt.js
  class TT (line 1) | class TT {
    method aes_decrypt (line 436) | aes_decrypt(secretKey, encoded) {
    method bytearray_decode (line 449) | bytearray_decode(arrays) {
    method changeLongArrayTobytes (line 466) | changeLongArrayTobytes(array) {
    method toHex (line 483) | toHex(num) {
    method parseLong (line 498) | parseLong(num, to_base = 10, from_base = 10) {
    method hex_list (line 521) | hex_list(content) {
    method s2b (line 544) | s2b(data) {
    method chooice (line 557) | chooice(start, end) {
    method hex_9C8 (line 567) | hex_9C8() {
    method setData (line 579) | setData(data) {
    method toBinaryString (line 588) | toBinaryString(num) {
    method UFTX (line 597) | UFTX(num) {
    method UBFX (line 615) | UBFX(num, lsb, width) {
    method bin_type (line 638) | bin_type(num) {
    method str (line 651) | str(num) {
    method check (line 666) | check(tmp) {
    method RRX (line 688) | RRX(num) {
    method ORRS (line 698) | ORRS(a, b) {
    method ANDRS (line 705) | ANDRS(a, b) {
    method LSRS (line 714) | LSRS(num, k) {
    method XORRS (line 723) | XORRS(a, b) {
    method NORRS (line 730) | NORRS(a, b) {
    method LSLS (line 743) | LSLS(num, k) {
    method ADCS (line 758) | ADCS(a, b) {
    method ADC (line 775) | ADC(a, b) {
    method EORS (line 784) | EORS(a, b) {
    method EOR (line 791) | EOR(a, b) {
    method ANDS (line 798) | ANDS(a, b) {
    method ADDS (line 811) | ADDS(a, b) {
    method hex_C52 (line 829) | hex_C52(list_6B0) {
    method hex_30A (line 1538) | hex_30A(param_list,list_3B8) {

FILE: lib/TTEncrypt.py
  class TT (line 8) | class TT:
    method encrypt (line 303) | def encrypt(self, data):
    method decrypt (line 338) | def decrypt(self, data):
    method aes_decrypt (line 365) | def aes_decrypt(self, secretKey, encoded):
    method bytearray_decode (line 372) | def bytearray_decode(self, arrays):
    method changeLongArrayTobytes (line 378) | def changeLongArrayTobytes(self, array):
    method hex_0A2 (line 387) | def hex_0A2(self, content, list_740, list_55C):
    method calculate (line 610) | def calculate(self, content):
    method convertLongList (line 668) | def convertLongList(self, content):
    method dump_list (line 676) | def dump_list(self, content):
    method hex_CF8 (line 692) | def hex_CF8(self, param_list):
    method handle_ending (line 780) | def handle_ending(self, num, r0):
    method UTFX (line 798) | def UTFX(self, num):
    method hex_27E (line 803) | def hex_27E(self, param_list):
    method hex_30A (line 853) | def hex_30A(self, param_list, list_3B8):
    method hex_C52 (line 1552) | def hex_C52(self, list_6B0):
    method toHex (line 1559) | def toHex(self, num):
    method check (line 1562) | def check(self, tmp):
    method ADDS (line 1575) | def ADDS(self, a, b):
    method ANDS (line 1584) | def ANDS(self, a, b):
    method EORS (line 1587) | def EORS(self, a, b):
    method ADC (line 1590) | def ADC(self, a, b):
    method ADCS (line 1596) | def ADCS(self, a, b):
    method LSLS (line 1605) | def LSLS(self, num, k):
    method LSRS (line 1610) | def LSRS(self, num, k):
    method ORRS (line 1615) | def ORRS(self, a, b):
    method RRX (line 1618) | def RRX(self, num):
    method bin_type (line 1624) | def bin_type(self, num):
    method UBFX (line 1635) | def UBFX(self, num, lsb, width):
    method UFTX (line 1646) | def UFTX(self, num):
    method toBinaryString (line 1651) | def toBinaryString(self, num):
    method setData (line 1654) | def setData(self, data):
    method hex_9C8 (line 1659) | def hex_9C8(self):
    method chooice (line 1665) | def chooice(self, start, end):
    method s2b (line 1668) | def s2b(self, data):
    method hex_list (line 1674) | def hex_list(self, content):
    method parseLong (line 1687) | def parseLong(self, num, to_base=10, from_base=10):
    method byteArray2str (line 1698) | def byteArray2str(self, b):
    method changeByteArrayToLong (line 1701) | def changeByteArrayToLong(self, bytes):

FILE: lib/XArgus.py
  class Argus (line 17) | class Argus:
    method encrypt_enc_pb (line 18) | def encrypt_enc_pb(data, l):
    method calculate_constant (line 28) | def calculate_constant(code):
    method get_bodyhash (line 38) | def get_bodyhash(stub: str | None = None) -> bytes:
    method get_queryhash (line 46) | def get_queryhash(query: str) -> bytes:
    method encrypt (line 56) | def encrypt(xargus_bean: dict):
    method get_sign (line 87) | def get_sign(

FILE: lib/XGorgon.py
  class XGorgon (line 6) | class XGorgon:
    method __encryption (line 7) | def __encryption(self):
    method __initialize (line 35) | def __initialize(self, input, hex_zu):
    method __handle (line 58) | def __handle(self, input):
    method __main (line 73) | def __main(self,gorgon):
    method __init__ (line 84) | def __init__(self):
    method __reverse (line 89) | def __reverse(self, num):
    method __RBIT (line 95) | def __RBIT(self, num):
    method __hex2string (line 104) | def __hex2string(self, num):
    method calculate (line 110) | def calculate(self, params:str, headers={}):

FILE: lib/XLadon.py
  function md5bytes (line 9) | def md5bytes(data: bytes) -> str:
  function get_type_data (line 15) | def get_type_data(ptr, index, data_type):
  function set_type_data (line 22) | def set_type_data(ptr, index, data, data_type):
  function validate (line 29) | def validate(num):
  function __ROR__ (line 33) | def __ROR__(value: ctypes.c_ulonglong, count: int) -> ctypes.c_ulonglong:
  function encrypt_ladon_input (line 42) | def encrypt_ladon_input(hash_table, input_data):
  function encrypt_ladon (line 58) | def encrypt_ladon(md5hex: bytes, data: bytes, size: int):
  function ladon_encrypt (line 99) | def ladon_encrypt(
  class Ladon (line 121) | class Ladon:
    method encrypt (line 123) | def encrypt(timestamp: int, license_id: str =1611921764, aid: int =123...

FILE: lib/Xlog.py
  class XLOG (line 6) | class XLOG:
    method encrypt (line 7) | def encrypt(self, inputStart):
    method decrypt (line 67) | def decrypt(self, decode):
    method calculate (line 112) | def calculate(self, input, times):
    method xor (line 171) | def xor(self, strHex_X, strHex_Y):
    method getHandleCount (line 190) | def getHandleCount(self, hex):
    method getShifting (line 202) | def getShifting(self, point):
    method calculateRev (line 215) | def calculateRev(self, input, times):
    method reverse (line 268) | def reverse(self, hex: str):
    method rshift (line 271) | def rshift(self, val, n):
    method getUmullHigh (line 274) | def getUmullHigh(self, r0, r2):
    method hex2string (line 282) | def hex2string(self, num: int):
    method fch (line 288) | def fch(self, xlog):

FILE: lib/colorit.py
  class Colors (line 5) | class Colors:
  class ColorsFG (line 15) | class ColorsFG:
  class ColorsBG (line 34) | class ColorsBG:
  function init_colorit (line 53) | def init_colorit():
  function color (line 60) | def color(text, rgb):
  function color_ansi (line 66) | def color_ansi(text, color):
  function background (line 70) | def background(text, rgb):

FILE: lib/pkcs7_padding.py
  function pkcs7_padding_data_length (line 1) | def pkcs7_padding_data_length(buffer, buffer_size, modulus):
  function pkcs7_padding_pad_buffer (line 17) | def pkcs7_padding_pad_buffer(buffer: bytearray, data_length: int, buffer...
  function padding_size (line 25) | def padding_size(size: int) -> int:

FILE: lib/protobuf.py
  class ProtoError (line 3) | class ProtoError(Exception):
    method __init__ (line 4) | def __init__(self, msg):
    method __str__ (line 7) | def __str__(self):
  class ProtoFieldType (line 12) | class ProtoFieldType(IntEnum):
  class ProtoField (line 23) | class ProtoField:
    method __init__ (line 24) | def __init__(self, idx, type, val):
    method isAsciiStr (line 29) | def isAsciiStr(self):
    method __str__ (line 38) | def __str__(self):
  class ProtoReader (line 54) | class ProtoReader:
    method __init__ (line 55) | def __init__(self, data):
    method seek (line 59) | def seek(self, pos):
    method isRemain (line 62) | def isRemain(self, length):
    method read0 (line 65) | def read0(self):
    method read (line 71) | def read(self, length):
    method readInt32 (line 77) | def readInt32(self):
    method readInt64 (line 80) | def readInt64(self):
    method readVarint (line 83) | def readVarint(self):
    method readString (line 95) | def readString(self):
  class ProtoWriter (line 100) | class ProtoWriter:
    method __init__ (line 101) | def __init__(self):
    method write0 (line 104) | def write0(self, byte):
    method write (line 107) | def write(self, bytes):
    method writeInt32 (line 110) | def writeInt32(self, int32):
    method writeInt64 (line 114) | def writeInt64(self, int64):
    method writeVarint (line 118) | def writeVarint(self, vint):
    method writeString (line 125) | def writeString(self, bytes):
    method toBytes (line 129) | def toBytes(self):
  class ProtoBuf (line 133) | class ProtoBuf:
    method __init__ (line 134) | def __init__(self, data=None):
    method __getitem__ (line 146) | def __getitem__(self, idx):
    method __parseBuf (line 160) | def __parseBuf(self, bytes):
    method toBuf (line 180) | def toBuf(self):
    method dump (line 198) | def dump(self):
    method getList (line 202) | def getList(self, idx):
    method get (line 205) | def get(self, idx):
    method getInt (line 211) | def getInt(self, idx):
    method getBytes (line 219) | def getBytes(self, idx):
    method getUtf8 (line 227) | def getUtf8(self, idx):
    method getProtoBuf (line 233) | def getProtoBuf(self, idx):
    method put (line 239) | def put(self, field: ProtoField):
    method putInt32 (line 242) | def putInt32(self, idx, int32):
    method putInt64 (line 245) | def putInt64(self, idx, int64):
    method putVarint (line 248) | def putVarint(self, idx, vint):
    method putBytes (line 251) | def putBytes(self, idx, data):
    method putUtf8 (line 254) | def putUtf8(self, idx, data):
    method putProtoBuf (line 257) | def putProtoBuf(self, idx, data):
    method __parseDict (line 260) | def __parseDict(self, data):
    method toDict (line 273) | def toDict(self, out):

FILE: lib/sign.py
  function Sign (line 10) | def Sign(

FILE: lib/utils.py
  function trace_id (line 8) | def trace_id(device_id: Union[str, int] = "") -> str:
  function json_encode (line 54) | def json_encode(data: dict) -> str:
  function md5stub (line 67) | def md5stub(body) -> str:
  function xor (line 83) | def xor(data, key=5):
  function getUNIX (line 102) | def getUNIX(add: bool = False, addRandom: int = 0) -> int:

FILE: main.py
  class XGorgonDict (line 16) | class XGorgonDict(BaseModel):
  class XArgusDict (line 20) | class XArgusDict(BaseModel):
  class XLadonDict (line 26) | class XLadonDict(BaseModel):
  class PostBase64Dict (line 32) | class PostBase64Dict(BaseModel):
  function captcha (line 40) | def captcha(puzzle: str = Form(...), piece: str = Form(...)):
  function x_gorgon (line 52) | def x_gorgon(req: XGorgonDict):
  function tt_encrypt (line 64) | def tt_encrypt(req: PostBase64Dict):
  function tt_decrypt (line 77) | def tt_decrypt(req: PostBase64Dict):
  function xlog_encrypt (line 89) | def xlog_encrypt(req: PostBase64Dict):
  function xlog_encrypt (line 102) | def xlog_encrypt(req: PostBase64Dict):
  function x_argus (line 114) | def x_argus(req: XArgusDict):
  function xladon (line 127) | def xladon(req: XLadonDict):
Condensed preview — 29 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (862K chars).
[
  {
    "path": ".github/FUNDING.yml",
    "chars": 40,
    "preview": "custom: https://pay.oxapay.com/43013861\n"
  },
  {
    "path": ".gitignore",
    "chars": 24,
    "preview": "/__pycache__/*\n*.py[cod]"
  },
  {
    "path": "Aptfile",
    "chars": 41,
    "preview": "libsm6\nlibxrender1\nlibfontconfig1\nlibice6"
  },
  {
    "path": "LICENSE",
    "chars": 1065,
    "preview": "MIT License\n\nCopyright (c) 2023 Everbody\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
  },
  {
    "path": "Procfile",
    "chars": 58,
    "preview": "web: uvicorn main:app --host 0.0.0.0 --port ${PORT:-5000}\n"
  },
  {
    "path": "README.md",
    "chars": 1977,
    "preview": "# TikTok Algorithms (X-Gorgon, X-Khronos, XLOG 02, TTEncrypt 05, X-Argus, X-Ladon)\n\nThese are just few of TikTok algorit"
  },
  {
    "path": "example/comment.py",
    "chars": 2328,
    "preview": "from urllib.parse import urlencode\n\nimport requests\nfrom lib.sign import Sign\nfrom lib.utils import getUNIX, md5stub\n\n\n\n"
  },
  {
    "path": "example/gorgon.py",
    "chars": 825,
    "preview": "from ..lib.XGorgon import XGorgon\n\nxg = XGorgon()\nheaders= xg.calculate(\"aweme_id=6948740634060639493&os_api=25&device_t"
  },
  {
    "path": "example/like_video.py",
    "chars": 2353,
    "preview": "from urllib.parse import urlencode\n\nimport requests\nfrom lib.sign import Sign\nfrom lib.utils import getUNIX, md5stub\n\n\n\n"
  },
  {
    "path": "lib/ByteBuf.py",
    "chars": 860,
    "preview": "from .pkcs7_padding import pkcs7_padding_data_length\nimport ctypes\n\nclass ByteBuf:\n    def __init__(self, data, size=Non"
  },
  {
    "path": "lib/Captcha.py",
    "chars": 1679,
    "preview": "import base64\n\nimport cv2\nimport numpy as np\n\n\nclass PuzzleSolver:\n    def __init__(self, base64puzzle, base64piece):\n  "
  },
  {
    "path": "lib/Simon.py",
    "chars": 1480,
    "preview": "from ctypes import c_ulonglong\n\ndef get_bit(val, pos):\n    return 1 if val & (1 << pos) else 0\n\ndef rotate_left(v, n):\n "
  },
  {
    "path": "lib/Sm3.py",
    "chars": 4500,
    "preview": "class SM3:\n    def __init__(self) -> None:\n        self.IV = [1937774191, 1226093241, 388252375, 3666478592, 2842636476,"
  },
  {
    "path": "lib/TTEncrypt.js",
    "chars": 62623,
    "preview": "class TT {\n  __content = [];\n  __content_raw = [];\n  CF = 0;\n  begining = [0x74, 0x63, 0x05, 0x10, 0, 0];\n  dword_0 = [\n"
  },
  {
    "path": "lib/TTEncrypt.py",
    "chars": 78512,
    "preview": "import binascii\r\nimport gzip\r\nimport random\r\n\r\nfrom Crypto.Cipher import AES\r\n\r\n\r\nclass TT:\r\n    __content = []\r\n    __c"
  },
  {
    "path": "lib/XArgus.py",
    "chars": 6738,
    "preview": "from base64 import b64encode\nfrom hashlib import md5\nimport hashlib\nfrom random import randint, random\nfrom struct impor"
  },
  {
    "path": "lib/XGorgon.py",
    "chars": 4421,
    "preview": "\r\nimport hashlib\r\nfrom copy import deepcopy\r\nimport time\r\n\r\nclass XGorgon:\r\n    def __encryption(self):\r\n        tmp = '"
  },
  {
    "path": "lib/XLadon.py",
    "chars": 3593,
    "preview": "import base64\nimport ctypes\nimport hashlib\nfrom os import urandom\n\nfrom .pkcs7_padding import padding_size, pkcs7_paddin"
  },
  {
    "path": "lib/Xlog.py",
    "chars": 9124,
    "preview": "import binascii\r\nimport codecs\r\nimport ctypes\r\n\r\n\r\nclass XLOG:\r\n    def encrypt(self, inputStart):\r\n        inputStart ="
  },
  {
    "path": "lib/aweme_v2_pb2.py",
    "chars": 628274,
    "preview": "# -*- coding: utf-8 -*-\n# Generated by the protocol buffer compiler.  DO NOT EDIT!\n# source: aweme-v2.proto\n\nfrom google"
  },
  {
    "path": "lib/colorit.py",
    "chars": 1635,
    "preview": "import sys\nimport os\n\n\nclass Colors:\n    red = (245, 90, 66)\n    orange = (245, 170, 66)\n    yellow = (245, 252, 71)\n   "
  },
  {
    "path": "lib/pkcs7_padding.py",
    "chars": 940,
    "preview": "def pkcs7_padding_data_length(buffer, buffer_size, modulus):\n    if buffer_size % modulus != 0 or buffer_size < modulus:"
  },
  {
    "path": "lib/protobuf.py",
    "chars": 8796,
    "preview": "from enum import IntEnum, unique\n\nclass ProtoError(Exception):\n    def __init__(self, msg):\n        self.msg = msg\n\n    "
  },
  {
    "path": "lib/sign.py",
    "chars": 1099,
    "preview": "import time\n\nfrom .XArgus import Argus\nfrom .XLadon import Ladon\n\nfrom .XGorgon import XGorgon\n\n\n\ndef Sign(\n    params: "
  },
  {
    "path": "lib/utils.py",
    "chars": 2861,
    "preview": "import binascii\nimport hashlib\nimport json\nimport random\nimport time\nfrom typing import Union  # Make sure to import Uni"
  },
  {
    "path": "main.py",
    "chars": 3790,
    "preview": "#!encoding=utf8\r\nimport base64\r\n\r\nimport requests\r\nfrom fastapi import FastAPI, Form, Response\r\nfrom pydantic import Bas"
  },
  {
    "path": "requirements.txt",
    "chars": 93,
    "preview": "fastapi\nuvicorn \npydantic\npycryptodome\nopencv-python-headless\nnumpy\npython-multipart\nrequests"
  },
  {
    "path": "run.sh",
    "chars": 52,
    "preview": "uvicorn main:app --reload --host 0.0.0.0 --port 8100"
  },
  {
    "path": "runtime.txt",
    "chars": 13,
    "preview": "python-3.8.12"
  }
]

About this extraction

This page contains the full source code of the ssovit/x-gorogn-khronos-argus-ladon GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 29 files (810.3 KB), approximately 242.8k tokens, and a symbol index with 215 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!