WingIDE破解代码-支持最新版本

WingIDE破解代码

目前支持WingIDE Pro 的5、6、7、8、9、10、11、12 版本。

目前官网最新是11.X.X版本,但是通过反编译,已经能知道12.X.X的魔数了)

代码如下,直接python keygen.py即可。(仅供学习研究)

python 复制代码
#!/usr/bin/env python3
"""
WingIDE Pro Activation Code Generator (Interactive CLI Version)
Generates activation codes for WingIDE Professional with an interactive interface.
"""

import hashlib
import platform
import random
import string
import sys

# Check Python version
py_version = platform.python_version()
if py_version[0] != "3":
    print(
        "Can't run under python2 env! Please run tool under python 3.2 or later version!"
    )
    sys.exit(1)

# Constants
BASE16 = "0123456789ABCDEF"
BASE30 = "123456789ABCDEFGHJKLMNPQRTVWXY"

# Supported WingIDE versions and their magic numbers
VERSION_MAGICS = {
    "5.X.X": [7, 123, 23, 87],
    "6.X.X": [23, 161, 47, 9],
    "7.X.X": [221, 13, 93, 27],
    "8.X.X": [179, 95, 45, 245],
    "9.X.X": [123, 17, 42, 7],
    "10.X.X": [102, 99, 107, 117],
    "11.X.X": [6, 24, 15, 22],
    "12.X.X": [198, 232, 214, 228],
}


def generate_random_string(size=20, chars=string.ascii_uppercase + string.digits):
    """Generate a random string of specified size."""
    return "".join(random.choice(chars) for _ in range(size))


def base_convert(number, from_digits, to_digits, ignore_negative=True):
    """
    Convert a number between different base systems.

    Args:
        number: The number to convert
        from_digits: Source base digits
        to_digits: Target base digits
        ignore_negative: Whether to ignore negative signs

    Returns:
        Converted number as string
    """
    if not ignore_negative and str(number)[0] == "-":
        number = str(number)[1:]
        neg = 1
    else:
        neg = 0

    # Convert to decimal first
    x = 0
    for digit in str(number):
        x = x * len(from_digits) + from_digits.index(digit)

    # Convert to target base
    res = ""
    while x > 0:
        digit = x % len(to_digits)
        res = to_digits[digit] + res
        x //= len(to_digits)

    if neg:
        res = "-" + res
    return res


def add_hyphens(code):
    """Add hyphens to format the code."""
    return f"{code[:5]}-{code[5:10]}-{code[10:15]}-{code[15:]}"


def sha_to_base30(digest):
    """
    Convert SHA digest to Base30 representation.

    Args:
        digest: SHA hash digest

    Returns:
        Base30 representation of the digest
    """
    # Take every other character
    filtered_digest = "".join([c for i, c in enumerate(digest) if i // 2 * 2 == i])
    result = base_convert(filtered_digest, BASE16, BASE30)

    # Pad with '1' if needed
    while len(result) < 17:
        result = "1" + result
    return result


def loop_algorithm(ecx, lichash):
    """
    Core algorithm for generating activation code parts.

    Args:
        ecx: Magic number
        lichash: License hash

    Returns:
        Processed value
    """
    part = 0
    for char in lichash:
        part = ecx * part + ord(char) & 1048575
    return part


def generate_license_id():
    """
    Generate a new license ID with guaranteed digits in each group.

    Returns:
        Formatted license ID with digits in each group (e.g., CNXB6-7R5CN-1RHY1-ATPE7)
    """
    # Characters to use (excluding 0 and O to avoid confusion)
    chars = "123456789ABCDEFGHJKLMNPQRTVWXY"
    digits = "123456789"

    # Generate each group ensuring at least one digit per group
    groups = []

    # First group (5 chars): "CN" + 3 chars with at least 1 digit
    # Start with "CN"
    group1_chars = ["C", "N"]
    # Add 3 random chars
    group1_chars.extend(random.choices(chars, k=3))
    # Replace one of the last 3 chars with a digit to ensure at least one digit
    digit_pos = random.randint(2, 4)
    group1_chars[digit_pos] = random.choice(digits)
    groups.append("".join(group1_chars))

    # Second, third, and fourth groups (5 chars each): at least 1 digit per group
    for _ in range(3):
        # Generate 5 random chars
        group_chars = random.choices(chars, k=5)
        # Replace one random char with a digit to ensure at least one digit
        digit_pos = random.randint(0, 4)
        group_chars[digit_pos] = random.choice(digits)
        groups.append("".join(group_chars))

    # Join all groups with hyphens
    return "-".join(groups)


def calculate_activation_code(version, license_id, request_code):
    """
    Calculate the activation code based on version, license ID, and request code.

    Args:
        version: WingIDE version string
        license_id: License ID
        request_code: Request code from WingIDE

    Returns:
        Activation code or None if invalid version
    """
    # Validate inputs
    if not request_code.strip():
        raise ValueError("Request code cannot be empty")

    if version not in VERSION_MAGICS:
        raise ValueError(f"Unsupported WingIDE version: {version}")

    print(f"\nLicense ID: {license_id}")
    print(f"WingIDE Version: {version}")

    # Generate hash
    sha_hasher = hashlib.sha1()
    sha_hasher.update(request_code.encode("utf-8"))
    sha_hasher.update(license_id.encode("utf-8"))
    hash_result = sha_hasher.hexdigest().upper()

    # Process hash
    lichash = add_hyphens(request_code[:3] + sha_to_base30(hash_result))

    # Get version magic numbers
    version_magic = VERSION_MAGICS[version]

    # Generate activation code parts
    activation_code = (
        format(loop_algorithm(version_magic[0], lichash), "05x")
        + format(loop_algorithm(version_magic[1], lichash), "05x")
        + format(loop_algorithm(version_magic[2], lichash), "05x")
        + format(loop_algorithm(version_magic[3], lichash), "05x")
    )

    # Convert to Base30 and pad if needed
    activation_code = base_convert(activation_code.upper(), BASE16, BASE30)
    while len(activation_code) < 17:
        activation_code = "1" + activation_code

    # Format final activation code
    return add_hyphens("AXX" + activation_code)


def select_version():
    """Let user select WingIDE version interactively."""
    print("WingIDE Pro Activation Code Generator")
    print("=" * 40)
    print("\nSelect WingIDE Version:")

    # Convert dict_keys to list to maintain consistent ordering
    version_list = list(VERSION_MAGICS.keys())

    # Display versions with indices
    for i, version in enumerate(version_list, 1):
        print(f"  {i}. {version}")

    print()

    while True:
        try:
            choice = input("Enter version number (1-{}): ".format(len(version_list)))
            choice_idx = int(choice) - 1

            if 0 <= choice_idx < len(version_list):
                return version_list[choice_idx]
            else:
                print(
                    "Invalid selection. Please enter a number between 1 and {}.".format(
                        len(version_list)
                    )
                )
        except ValueError:
            print("Invalid input. Please enter a number.")


def confirm_license_id(license_id):
    """Ask user to confirm or regenerate license ID."""
    while True:
        print(f"\nGenerated License ID: {license_id}")
        choice = (
            input("Is this license ID acceptable? (yes/no/generate again): ")
            .strip()
            .lower()
        )

        if choice in ["yes", "y"]:
            return license_id
        elif choice in ["no", "n"]:
            return None
        elif choice in ["generate again", "generate", "g"]:
            return generate_license_id()
        else:
            print("Please enter 'yes', 'no', or 'generate again'.")


def get_request_code():
    """Get request code from user."""
    print("\nNext Step:")
    print("Please open WingIDE and go to Help -> Register...")
    print("Enter the Request Code shown in the dialog.")

    while True:
        request_code = input("\nEnter Request Code: ").strip()
        if request_code:
            return request_code
        else:
            print("Request code cannot be empty. Please try again.")


def interactive_main():
    """Interactive main entry point."""
    try:
        # Step 1: Select version
        version = select_version()

        # Step 2: Generate and confirm license ID
        license_id = generate_license_id()
        while True:
            confirmed_id = confirm_license_id(license_id)
            if confirmed_id:
                license_id = confirmed_id
                break
            else:
                # User said "no", exit
                print("Exiting...")
                return

        # Step 3: Get request code
        request_code = get_request_code()

        # Step 4: Calculate and display activation code
        activation_code = calculate_activation_code(version, license_id, request_code)
        print(f"\nActivation Code: {activation_code}")
        print(
            "\nCopy this activation code and paste it in the WingIDE registration dialog."
        )

    except KeyboardInterrupt:
        print("\n\nOperation cancelled by user.")
    except Exception as e:
        print(f"\nError: {e}")
        sys.exit(1)


def display_help():
    """Display help information."""
    print("WingIDE Pro Activation Code Generator (Interactive CLI)")
    print("=" * 55)
    print("This script generates activation codes for WingIDE Professional.")
    print("\nUsage:")
    print("  python keygen_cli.py              # Interactive mode")
    print("  python keygen_cli.py --help       # Show this help")
    print("\nIn interactive mode, you will:")
    print("  1. Select a WingIDE version")
    print("  2. Review and confirm a generated license ID")
    print("  3. Enter a request code from WingIDE")
    print("  4. Receive an activation code to use in WingIDE")


def main():
    """Main entry point."""
    # Handle help argument
    if len(sys.argv) > 1 and sys.argv[1] in ["-h", "--help", "help"]:
        display_help()
        return

    # Run interactive mode
    interactive_main()


if __name__ == "__main__":
    main()
相关推荐
共享家95271 天前
搭建 AI 聊天机器人:”我的人生我做主“
前端·javascript·css·python·pycharm·html·状态模式
Hgfdsaqwr1 天前
Python在2024年的主要趋势与发展方向
jvm·数据库·python
一晌小贪欢1 天前
Python 测试利器:使用 pytest 高效编写和管理单元测试
python·单元测试·pytest·python3·python测试
小文数模1 天前
2026年美赛数学建模C题完整参考论文(含模型和代码)
python·数学建模·matlab
Halo_tjn1 天前
基于封装的专项 知识点
java·前端·python·算法
Hgfdsaqwr1 天前
掌握Python魔法方法(Magic Methods)
jvm·数据库·python
weixin_395448911 天前
export_onnx.py_0130
pytorch·python·深度学习
s1hiyu1 天前
使用Scrapy框架构建分布式爬虫
jvm·数据库·python
2301_763472461 天前
使用Seaborn绘制统计图形:更美更简单
jvm·数据库·python
无垠的广袤1 天前
【VisionFive 2 Lite 单板计算机】边缘AI视觉应用部署:缺陷检测
linux·人工智能·python·opencv·开发板