吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1616|回复: 27
收起左侧

[原创] 离线010Editor注册码生成html文件

  [复制链接]
fly92 发表于 2026-6-22 17:33
参考论坛的 Python版本 算法生成了一个html版本的生成注册码的文件,直接双击打开在浏览器里面就能输入用户名后点击生成就行了.方便没有安装python的玩家使用.
[HTML] 纯文本查看 复制代码
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>010 Editor 注册码生成器 (9C算法)</title>
    <style>
        :root{--primary:#2563eb;--primary-hover:#1d4ed8;--bg:#f8fafc;--card:#fff;--text:#1e293b;--sub:#64748b;--border:#e2e8f0;--ok-bg:#f0fdf4;--ok-text:#166534;--err-bg:#fef2f2;--err-text:#991b1b}
        *{box-sizing:border-box;margin:0;padding:0}
        body{font-family:system-ui,-apple-system,sans-serif;background:var(--bg);color:var(--text);display:flex;justify-content:center;align-items:center;min-height:100vh;padding:20px}
        .container{background:var(--card);width:100%;max-width:520px;padding:40px;border-radius:16px;box-shadow:0 4px 6px -1px rgba(0,0,0,.1);border:1px solid var(--border)}
        h1{font-size:24px;text-align:center;margin-bottom:8px}
        .subtitle{text-align:center;color:var(--sub);font-size:14px;margin-bottom:32px}
        .form-group{margin-bottom:20px}
        label{display:block;font-size:14px;font-weight:600;margin-bottom:8px}
        input[type="text"]{width:100%;padding:12px 16px;border:1px solid var(--border);border-radius:8px;font-size:16px;outline:none;transition:.2s}
        input[type="text"]:focus{border-color:var(--primary);box-shadow:0 0 0 3px rgba(37,99,235,.1)}
        button{width:100%;padding:14px;background:var(--primary);color:#fff;border:none;border-radius:8px;font-size:16px;font-weight:600;cursor:pointer;transition:.2s;margin-top:8px}
        button:hover{background:var(--primary-hover)}
        button:disabled{background:#94a3b8;cursor:not-allowed}
        .result-box{margin-top:24px;padding:16px;border-radius:8px;font-family:Consolas,Monaco,monospace;font-size:20px;text-align:center;letter-spacing:2px;word-break:break-all;display:none}
        .result-box.success{background:var(--ok-bg);color:var(--ok-text);border:1px solid #bbf7d0;display:block}
        .result-box.error{background:var(--err-bg);color:var(--err-text);border:1px solid #fecaca;font-family:inherit;font-size:14px;display:block;letter-spacing:normal}
        .verify-status{margin-top:8px;font-size:12px;text-align:center;color:var(--sub);display:none}
        .footer{margin-top:24px;text-align:center;font-size:12px;color:var(--sub)}
        .loading{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-radius:50%;border-top-color:#fff;animation:spin .8s linear infinite;margin-right:8px;vertical-align:middle}
        @keyframes spin{to{transform:rotate(360deg)}}
    </style>
</head>
<body>
<div class="container">
    <h1>&#128272; 010 Editor 注册码生成器</h1>
    <p class="subtitle">9C 算法 · 纯离线 · 确定性生成 · 自动验证</p>
    <div class="form-group">
        <label for="username">用户名 (Username)</label>
        <input type="text" id="username" placeholder="请输入用户名..." autocomplete="off" spellcheck="false">
    </div>
    <button id="generateBtn">生成注册码</button>
    <div id="resultBox" class="result-box"></div>
    <div id="verifyStatus" class="verify-status"></div>
    <div class="footer">&#9888;&#65039; 完全离线运行,不收集任何数据<br>Keygen | Build 20260622-v2</div>
</div>

<script>

window.onerror = function(msg, url, line) {
    var box = document.getElementById('resultBox');
    if (box) {
        box.className = 'result-box error';
        box.textContent = '&#10060; 运行时错误: ' + msg + ' (行:' + line + ')';
        box.style.display = 'block';
        document.getElementById('verifyStatus').style.display = 'none';
        var btn = document.getElementById('generateBtn');
        if (btn) { btn.disabled = false; btn.textContent = '生成注册码'; }
    }
    return true;
};

// ==================== 查找表 ====================
var TABLE_RAW_HEX =
    "b844cb39674f75231172015fda24bb3ec60717354b77f9638872821721480f0f" +
    "0f675f5be85a314869775b7847157a2b9212d138321ba14244223335607b4377" +
    "103bab1e00008153ae12021da877036f9230c0438e0a3c2dbf0c9562fa6ff030" +
    "e010f734fb17f428952f0d355a1d365a0b06cc15cc13fd0acf3b60286b067133" +
    "e414cd30673a5d17136ad66df909342d827b1e58996b527688518d5c7179852c" +
    "c01ff515110dcc685c5ef54964435e27bc0d1e2de37cee4c40585532082e2e11" +
    "5a06786906149272e7784531b7215617bf1d7740d638c23f8a12314a6e03ad2d" +
    "d669a041920140256746dd004f1ffc6ace401057df66fe623e4bdb411f238235" +
    "9a07f6554406a71cd243161bc928723f7010145fab74143e6e254b44d9507053" +
    "4b09420fe620d82f5e2e8b77026d1771697aea7f2846b55b716cba19993a7639" +
    "cd548d17886e24017e531333172d8e2bbe103d2a8205d159db63a1379a48d630" +
    "465c216a767a1c0ee760c71f650cb879b459f42726739a798217ba505c6d112a" +
    "1b6e86633c0e923f903402558960b555d11f392cc235802f7a2bfd649a75e84c" +
    "f0048551a8019579ad2c5b3f6001e638d8417663422a3533192ca25151585c08" +
    "ab172903c70a772bb377ac300719ec2bd0025203d333a90ff35d2561bf06ad22" +
    "7169b858e50dca5f56640d70db73a956fd59b75ae20b0e33dd0d3c5b603c5d49" +
    "a659bd53916d5e4c8d31d94979503d10e342ce611d12d57eed60e114f24e2d21" +
    "f0330127965a43628b5ea71fbe2f096f490d004a701cae5777244e00727e1e56" +
    "33008c460224cc5dc67a5078c724af58342df60d08478a35111efb3c1c45712b" +
    "9552a77721078956f375ef0ff1240f12e70a990152449c338e5ba1276d27a70b" +
    "7b1bdc60827f4b4f0770db67d9574a4fe8521262fc2c53200603396a23048018" +
    "8a77f319f01623463709ae565c67c243fd45ca65f24f600dcb22fd0b3b64fe3a" +
    "a67ff63b79356244f8314018974f17322a096a4c6102b55f74016501f14a6333" +
    "f4182d716971996efe7aab5de82e2b7cb475db6eb66f835fd66d2a3cc2052d29" +
    "db4422054f5f9a144065485dea151d332069454f9f693a48050f453b6c7c203b" +
    "fe709d74f6617441f131b0627b5750273315132908388c585634ef1aec003c0f" +
    "4247a77d6c7a794b8732bb5eb8586578f24fed001e6969625f25a2247e1fc162" +
    "cd7d8a2ffe173b64b8188377fe603b25a363bb344f21035bf471155f9f6e311a" +
    "0427cf7a3868892877466118eb69f51bc95ea80b466bca6a2a42431e0e5f4d51" +
    "8c013e41e9267630fa1ded015a6ff4492b641b46f207707d57266513c50b166b" +
    "4948e0651c6e521fb651025a693fd72bcd7abf2d803ee6510f67f25c030acd21" +
    "6102ff5c1e06ae335f34b63b754a815df45d7b255b2c5c0a2755a4164539f216";

function buildTable() {
    var hex = TABLE_RAW_HEX.replace(/\s/g, '');
    var table = new Uint32Array(256);
    for (var i = 0; i < 256; i++) {
        var off = i * 8;
        var b0 = parseInt(hex.substr(off, 2), 16);
        var b1 = parseInt(hex.substr(off + 2, 2), 16);
        var b2 = parseInt(hex.substr(off + 4, 2), 16);
        var b3 = parseInt(hex.substr(off + 6, 2), 16);
        table[i] = ((b3 << 24) | (b2 << 16) | (b1 << 8) | b0) >>> 0;
    }
    return table;
}

var TABLE = buildTable();
var TYPE_BYTE = 0x9C;
var VERSION_ARG = 17;

// ==================== 核心算法 ====================

function toupper(b) {
    return (b >= 0x61 && b <= 0x7A) ? (b - 32) : b;
}

function checksum(name, flag, a3, a4) {
    var encoder = new TextEncoder();
    var data = encoder.encode(name);

    var v5 = 0;
    var v9 = 0;
    var v10 = (15 * (a4 & 0xFF)) & 0xFF;
    var v11 = 0;
    var v12 = (17 * (a3 & 0xFF)) & 0xFF;

    for (var i = 0; i < data.length; i++) {
        var cu = toupper(data[i]);
        var idx_a = (cu + (flag ? 13 : 63)) & 0xFF;
        var idx_b = (cu + (flag ? 47 : 23)) & 0xFF;

        var v17 = (v5 + TABLE[cu]) >>> 0;
        var v18 = (TABLE[idx_a] ^ v17) >>> 0;
        var v20 = flag ? v9 : v11;

        var product = Math.imul(TABLE[idx_b], v18) >>> 0;
        v5 = (TABLE[v10] + TABLE[v12] + TABLE[v20] + product) >>> 0;

        v12 = (v12 + 9) & 0xFF;
        v10 = (v10 + 13) & 0xFF;
        v9 = (v9 + 19) & 0xFF;
        v11 = (v11 + 7) & 0xFF;
    }
    return v5 >>> 0;
}

function ad76(b) {
    return (((b ^ 0x18) + 61) ^ 0xA7) & 0xFF;
}

function c5b(v20) {
    var v1 = ((((v20 & 0xFFFF) ^ 0x7892) + 19760) & 0xFFFF) ^ 0x3421;
    if (v1 % 11 !== 0) return 0;
    return (Math.floor(v1 / 11)) & 0xFFFF;
}

var _cachedV20 = null;
function bestV20ForParam() {
    if (_cachedV20 !== null) return _cachedV20;
    for (var v20 = 0; v20 < 0x10000; v20++) {
        var r = c5b(v20);
        if (r >= 1 && r <= 1000) {
            _cachedV20 = { v20: v20, v21: r };
            return _cachedV20;
        }
    }
    throw new Error("无法找到合法的 v20 参数");
}

var _cachedBVer = null;
function bestBForVersion() {
    if (_cachedBVer !== null) return _cachedBVer;
    var bestB = 0, bestN2 = -1;
    for (var b = 0; b < 256; b++) {
        var n2 = ad76(b);
        if (n2 > bestN2) { bestB = b; bestN2 = n2; }
    }
    if (bestN2 < VERSION_ARG) {
        throw new Error("版本参数不满足要求: bestN2=" + bestN2);
    }
    _cachedBVer = { b: bestB, n2: bestN2 };
    return _cachedBVer;
}

function formatLicense(raw) {
    var hexs = "";
    for (var i = 0; i < raw.length; i++) {
        hexs += ("0" + raw[i].toString(16).toUpperCase()).slice(-2);
    }
    return hexs.match(/.{4}/g).join("-");
}

function keygen(name) {
    var param = bestV20ForParam();
    var ver = bestBForVersion();
    var v20 = param.v20;
    var v21 = param.v21;

    // keygen 中 a3 固定为 0
    var chk = checksum(name, 1, 0, v21 & 0xFF);
    var b4 = chk & 0xFF;
    var b5 = (chk >>> 8) & 0xFF;
    var b6 = (chk >>> 16) & 0xFF;
    var b7 = (chk >>> 24) & 0xFF;

    var b2 = ((v20 & 0xFF) ^ b5) & 0xFF;
    var b1 = (((v20 >>> 8) & 0xFF) ^ b7) & 0xFF;
    var b0 = (ver.b ^ b6) & 0xFF;

    return formatLicense([b0, b1, b2, TYPE_BYTE, b4, b5, b6, b7]);
}

// ==================== 验证模块 ====================

function nibble(c) {
    var o = c.charCodeAt(0);
    if (o >= 0x30 && o <= 0x39) return o - 0x30;
    if (((o - 79) & 0xDF) === 0) return 0;
    if (o === 0x6C) return 1;
    if (o >= 0x61 && o <= 0x7A) return (o - 87) & 0xFF;
    if (o >= 0x41 && o <= 0x5A) return (o - 55) & 0xFF;
    return 0;
}

function decodeLicense(lic) {
    var s = lic.replace(/o/g, '0').replace(/O/g, '0').replace(/l/g, '1');
    if (s.length !== 19 || s[4] !== '-' || s[9] !== '-' || s[14] !== '-') return null;
    var chars = s.replace(/-/g, '');
    if (chars.length !== 16) return null;
    var out = [];
    for (var i = 0; i < 16; i += 2) {
        out.push(((16 * nibble(chars[i])) + nibble(chars[i + 1])) & 0xFF);
    }
    return out;
}

function verify(name, lic) {
    var by = decodeLicense(lic);
    if (by === null) return false;

    var v39 = by[0], v40 = by[1], v41 = by[2], v42 = by[3];
    var n5999655_1 = by[4], v44 = by[5], v45 = by[6], v46 = by[7];

    if (v42 !== TYPE_BYTE) return false;

    var v20 = ((v44 ^ v41) + ((v46 ^ v40) << 8)) & 0xFFFF;
    var a1_108 = ad76((v45 ^ v39) & 0xFF);
    var v21 = c5b(v20);
    var n2 = a1_108;

    if (!(n2 !== 0 && (v21 - 1) <= 0x3E7)) return false;

    var n255 = (n2 < 2) ? n2 : 0;

    var chk = checksum(name, 1, n255 & 0xFF, v21 & 0xFF);

    var ok = (n5999655_1 === (chk & 0xFF))
          && (v44 === ((chk >>> 8) & 0xFF))
          && (v45 === ((chk >>> 16) & 0xFF))
          && (v46 === ((chk >>> 24) & 0xFF));

    if (!ok) return false;
    return VERSION_ARG <= a1_108;
}

// ==================== UI ====================
document.addEventListener('DOMContentLoaded', function() {
    var btn = document.getElementById('generateBtn');
    var box = document.getElementById('resultBox');
    var inp = document.getElementById('username');
    var status = document.getElementById('verifyStatus');

    function showResult(text, isErr) {
        box.className = 'result-box ' + (isErr ? 'error' : 'success');
        box.textContent = text;
        box.style.display = 'block';
        btn.disabled = false;
        btn.textContent = '生成注册码';
    }

    btn.addEventListener('click', function() {
        var raw = inp.value.trim();
        if (!raw) { showResult('&#10060; 用户名不能为空', true); status.style.display = 'none'; return; }
        if (raw.length > 100) { showResult('&#10060; 用户名不能超过100字符', true); status.style.display = 'none'; return; }

        btn.disabled = true;
        btn.innerHTML = '<span class="loading"></span>正在生成...';
        box.style.display = 'none';
        status.style.display = 'none';

        requestAnimationFrame(function() {
            setTimeout(function() {
                try {
                    var license = keygen(raw);
                    var isValid = verify(raw, license);
                    showResult(license, false);
                    status.textContent = isValid
                        ? '&#9989; 自动验证通过 (PASS)'
                        : '&#10060; 自动验证失败 (FAIL)';
                    status.style.color = isValid ? 'var(--ok-text)' : 'var(--err-text)';
                    status.style.display = 'block';
                } catch (err) {
                    showResult('&#10060; 生成失败: ' + err.message, true);
                    status.style.display = 'none';
                }
            }, 50);
        });
    });

    inp.addEventListener('keydown', function(e) { if (e.key === 'Enter') btn.click(); });
    console.log('%c&#9989; 010 Editor 9C Keygen v2.0 已就绪', 'color:#166534;font-weight:bold');
});
</script>
</body>
</html>

运行界面如图:
PixPin_2026-06-22_17-27-35.png
另外附带提供一个powershell脚本,用来实现网络验证响应:
[PowerShell] 纯文本查看 复制代码
#Requires -RunAsAdministrator
<#
.SYNOPSIS
    010 Editor License Check Mock Server (PowerShell版)
.DESCRIPTION
    替代Flask实现的本地许可证验证Mock服务。
    监听 127.0.0.1:80,仅对特定路径返回 "valid"。
.NOTES
    必须以管理员身份运行!绑定80端口需要提升权限。
    按 Ctrl+C 可安全停止服务。
#>

# ==================== 配置区 ====================
$ListenHost = "127.0.0.1"
$ListenPort = 80
$TargetPath = "/cgibin/010editor_check_license_9b.php"
$ResponseContent = "valid"
# ================================================

# 构造监听前缀(HttpListener要求以/结尾)
$prefix = "http://${ListenHost}:${ListenPort}/"

try {
    # 创建并启动 HTTP 监听器
    $listener = New-Object System.Net.HttpListener
    $listener.Prefixes.Add($prefix)
    $listener.Start()

    Write-Host "========================================" -ForegroundColor Cyan
    Write-Host " &#9989; Mock License Server 已启动" -ForegroundColor Green
    Write-Host " 监听地址: http://${ListenHost}:${ListenPort}" -ForegroundColor Yellow
    Write-Host " 目标路径: ${TargetPath}" -ForegroundColor Yellow
    Write-Host " 响应内容: ${ResponseContent}" -ForegroundColor Yellow
    Write-Host " 按 Ctrl+C 停止服务" -ForegroundColor Gray
    Write-Host "========================================" -ForegroundColor Cyan

    # 主循环:持续接收并处理请求
    while ($listener.IsListening) {
        # GetContext() 是阻塞调用,等待传入的HTTP请求
        $context = $listener.GetContext()
        $request = $context.Request
        $response = $context.Response

        # 获取请求路径(去除尾部斜杠和查询字符串以便精确匹配)
        $requestPath = $request.Url.AbsolutePath.TrimEnd('/')
        $targetClean = $TargetPath.TrimEnd('/')

        # 路由匹配判断
        if ($requestPath -eq $targetClean) {
            # &#9989; 路径匹配:返回 "valid"
            $buffer = [System.Text.Encoding]::UTF8.GetBytes($ResponseContent)
            $response.StatusCode = 200
            $response.ContentType = "text/plain; charset=utf-8"
            $response.ContentLength64 = $buffer.Length
            $response.OutputStream.Write($buffer, 0, $buffer.Length)

            Write-Host "[&#10003; MATCH] $($request.HttpMethod) $($request.Url.AbsolutePath) -> 200 valid" -ForegroundColor Green
        } else {
            # &#10060; 路径不匹配:返回404
            $notFoundMsg = "Not Found"
            $buffer = [System.Text.Encoding]::UTF8.GetBytes($notFoundMsg)
            $response.StatusCode = 404
            $response.ContentType = "text/plain; charset=utf-8"
            $response.ContentLength64 = $buffer.Length
            $response.OutputStream.Write($buffer, 0, $buffer.Length)

            Write-Host "[&#10007; MISS ] $($request.HttpMethod) $($request.Url.AbsolutePath) -> 404" -ForegroundColor DarkGray
        }

        # 关闭响应流,完成本次请求处理
        $response.OutputStream.Close()
        $response.Close()
    }
}
catch [System.Net.HttpListenerException] {
    Write-Host ""
    Write-Host "&#10060; 启动失败: $($_.Exception.Message)" -ForegroundColor Red
    Write-Host "&#128161; 常见原因:" -ForegroundColor Yellow
    Write-Host "   1. 未以管理员权限运行(绑定80端口需要提权)" -ForegroundColor Yellow
    Write-Host "   2. 80端口已被其他程序占用(如IIS、Nginx、Skype)" -ForegroundColor Yellow
    Write-Host "   3. Windows防火墙阻止了监听" -ForegroundColor Yellow
    Write-Host ""
    Write-Host "&#128161; 排查命令: netstat -ano | findstr :80" -ForegroundColor Cyan
}
catch [System.OperationCanceledException] {
    # Ctrl+C 触发的正常退出,不显示错误
    Write-Host "`n&#9209; 服务已手动停止" -ForegroundColor Yellow
}
finally {
    # 确保监听器被正确释放
    if ($listener -and $listener.IsListening) {
        $listener.Stop()
        $listener.Close()
        Write-Host "&#128274; 监听器已关闭" -ForegroundColor Gray
    }
}

运行界面:
PixPin_2026-06-22_17-29-39.png


由于脚本需要绑定 80端口,必须以 管理员权限 (Run as Administrator) 运行 PowerShell,否则 `HttpListener` 会抛出访问拒绝异常。
先在 hosts 文件中加上如下数据:
127.0.0.1 www.sweetscape.com

然后在管理员权限下,在命令行运行如下命令,刷新 DNS:
ipconfig /flushdns
之后再用管理员权限运行powershell脚本就行了

免费评分

参与人数 11吾爱币 +13 热心值 +9 收起 理由
冥界3大法王 + 2 膜拜。。。
chengdragon + 1 感谢分享
antiol + 3 + 1 我很赞同!
buluo533 + 1 + 1 用心讨论,共获提升!
rolacn + 1 + 1 热心回复!
LuckyClover + 1 谢谢@Thanks!
ZiPP + 2 + 1 感谢发布原创作品,吾爱破解论坛因你更精彩!
Issacclark1 + 1 谢谢@Thanks!
thghx + 1 + 1 谢谢@Thanks!
enjon + 1 + 1 谢谢@Thanks!
wahahehe + 1 + 1 鼓励转贴优秀软件安全工具和文档!

查看全部评分

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

冥界3大法王 发表于 2026-6-23 12:22
   010 Editor 注册码生成器 (9C 算法)
==============================================

请输入用户名 (Username): Hello
正在计算中...

生成的注册码 (License Key):
----------------------------------------------
D6BC-009C-7101-D534
----------------------------------------------
自动校验状态: PASS

按下回车键退出...

[Delphi] 纯文本查看 复制代码
program O10EditorKeygen;

{$APPTYPE CONSOLE}

uses
  System.SysUtils,
  System.Character;

const
  TYPE_BYTE = $9C;
  VERSION_ARG = 17;

  TABLE_RAW_HEX =
    'b844cb39674f75231172015fda24bb3ec60717354b77f9638872821721480f0f' +
    '0f675f5be85a314869775b7847157a2b9212d138321ba14244223335607b4377' +
    '103bab1e00008153ae12021da877036f9230c0438e0a3c2dbf0c9562fa6ff030' +
    'e010f734fb17f428952f0d355a1d365a0b06cc15cc13fd0acf3b60286b067133' +
    'e414cd30673a5d17136ad66df909342d827b1e58996b527688518d5c7179852c' +
    'c01ff515110dcc685c5ef54964435e27bc0d1e2de37cee4c40585532082e2e11' +
    '5a06786906149272e7784531b7215617bf1d7740d638c23f8a12314a6e03ad2d' +
    'd669a041920140256746dd004f1ffc6ace401057df66fe623e4bdb411f238235' +
    '9a07f6554406a71cd243161bc928723f7010145fab74143e6e254b44d9507053' +
    '4b09420fe620d82f5e2e8b77026d1771697aea7f2846b55b716cba19993a7639' +
    'cd548d17886e24017e531333172d8e2bbe103d2a8205d159db63a1379a48d630' +
    '465c216a767a1c0ee760c71f650cb879b459f42726739a798217ba505c6d112a' +
    '1b6e86633c0e923f903402558960b555d11f392cc235802f7a2bfd649a75e84c' +
    'f0048551a8019579ad2c5b3f6001e638d8417663422a3533192ca25151585c08' +
    'ab172903c70a772bb377ac300719ec2bd0025203d333a90ff35d2561bf06ad22' +
    '7169b858e50dca5f56640d70db73a956fd59b75ae20b0e33dd0d3c5b603c5d49' +
    'a659bd53916d5e4c8d31d94979503d10e342ce611d12d57eed60e114f24e2d21' +
    'f0330127965a43628b5ea71fbe2f096f490d004a701cae5777244e00727e1e56' +
    '33008c460224cc5dc67a5078c724af58342df60d08478a35111efb3c1c45712b' +
    '9552a77721078956f375ef0ff1240f12e70a990152449c338e5ba1276d27a70b' +
    '7b1bdc60827f4b4f0770db67d9574a4fe8521262fc2c53200603396a23048018' +
    '8a77f319f01623463709ae565c67c243fd45ca65f24f600dcb22fd0b3b64fe3a' +
    'a67ff63b79356244f8314018974f17322a096a4c6102b55f74016501f14a6333' +
    'f4182d716971996efe7aab5de82e2b7cb475db6eb66f835fd66d2a3cc2052d29' +
    'db4422054f5f9a144065485dea151d332069454f9f693a48050f453b6c7c203b' +
    'fe709d74f6617441f131b0627b5750273315132908388c585634ef1aec003c0f' +
    '4247a77d6c7a794b8732bb5eb8586578f24fed001e6969625f25a2247e1fc162' +
    'cd7d8a2ffe173b64b8188377fe603b25a363bb344f21035bf471155f9f6e311a' +
    '0427cf7a3868892877466118eb69f51bc95ea80b466bca6a2a42431e0e5f4d51' +
    '8c013e41e9267630fa1ded015a6ff4492b641b46f207707d57266513c50b166b' +
    '4948e0651c6e521fb651025a693fd72bcd7abf2d803ee6510f67f25c030acd21' +
    '6102ff5c1e06ae335f34b63b754a815df45d7b255b2c5c0a2755a4164539f216';

var
  TABLE: array [0 .. 255] of Cardinal;

procedure BuildTable;
var
  I, Off: Integer;
  B0, B1, B2, B3: Byte;
begin
  for I := 0 to 255 do
  begin
    Off := I * 8 + 1; // Delphi string is 1-indexed
    B0 := StrToInt('$' + TABLE_RAW_HEX[Off] + TABLE_RAW_HEX[Off + 1]);
    B1 := StrToInt('$' + TABLE_RAW_HEX[Off + 2] + TABLE_RAW_HEX[Off + 3]);
    B2 := StrToInt('$' + TABLE_RAW_HEX[Off + 4] + TABLE_RAW_HEX[Off + 5]);
    B3 := StrToInt('$' + TABLE_RAW_HEX[Off + 6] + TABLE_RAW_HEX[Off + 7]);
    TABLE[I] := (Cardinal(B3) shl 24) or (Cardinal(B2) shl 16) or
      (Cardinal(B1) shl 8) or B0;
  end;
end;

function ToUpper(B: Byte): Byte; inline;
begin
  if (B >= $61) and (B <= $7A) then
    Result := B - 32
  else
    Result := B;
end;

// 模拟 JavaScript Math.imul(a, b) 32位整型乘法溢出
function Imul(A, B: Cardinal): Cardinal; inline;
begin
  Result := Cardinal(Int64(A) * Int64(B));
end;

function Checksum(const Name: string; Flag: Boolean; A3, A4: Byte): Cardinal;
var
  Data: TBytes;
  V5, V9, V10, V11, V12, Product, V17, V18, V20: Cardinal;
  Cu, IdxA, IdxB: Byte;
  I: Integer;
begin
  Data := TEncoding.UTF8.GetBytes(Name);
  V5 := 0;
  V9 := 0;
  V10 := (15 * A4) and $FF;
  V11 := 0;
  V12 := (17 * A3) and $FF;

  for I := 0 to Length(Data) - 1 do
  begin
    Cu := ToUpper(Data[I]);
    if Flag then
    begin
      IdxA := (Cu + 13) and $FF;
      IdxB := (Cu + 47) and $FF;
      V20 := V9;
    end
    else
    begin
      IdxA := (Cu + 63) and $FF;
      IdxB := (Cu + 23) and $FF;
      V20 := V11;
    end;

    V17 := V5 + TABLE[Cu];
    V18 := TABLE[IdxA] xor V17;

    Product := Imul(TABLE[IdxB], V18);
    V5 := TABLE[V10] + TABLE[V12] + TABLE[V20] + Product;

    V12 := (V12 + 9) and $FF;
    V10 := (V10 + 13) and $FF;
    V9 := (V9 + 19) and $FF;
    V11 := (V11 + 7) and $FF;
  end;
  Result := V5;
end;

function Ad76(B: Byte): Byte; inline;
begin
  Result := (((B xor $18) + 61) xor $A7) and $FF;
end;

function C5b(V20: Word): Integer; inline;
var
  V1: Integer;
begin
  V1 := ((V20 xor $7892) + 19760) and $FFFF;
  V1 := V1 xor $3421;
  if (V1 mod 11) <> 0 then
    Exit(0);
  Result := (V1 div 11) and $FFFF;
end;

procedure GetBestV20ForParam(out V20: Word; out V21: Word);
var
  W: Integer;
  R: Integer;
begin
  for W := 0 to $FFFF do
  begin
    R := C5b(W);
    if (R >= 1) and (R <= 1000) then
    begin
      V20 := W;
      V21 := R;
      Exit;
    end;
  end;
  raise Exception.Create('无法找到合法的 v20 参数');
end;

procedure GetBestBForVersion(out B: Byte; out N2: Byte);
var
  TempB, TempN2, BestB, BestN2: Integer;
begin
  BestB := 0;
  BestN2 := -1;
  for TempB := 0 to 255 do
  begin
    TempN2 := Ad76(TempB);
    if TempN2 > BestN2 then
    begin
      BestB := TempB;
      BestN2 := TempN2;
    end;
  end;
  if BestN2 < VERSION_ARG then
    raise Exception.Create('版本参数不满足要求');
  B := BestB;
  N2 := BestN2;
end;

function FormatLicense(const Raw: array of Byte): string;
var
  HexStr: string;
  I: Integer;
begin
  HexStr := '';
  for I := 0 to Length(Raw) - 1 do
    HexStr := HexStr + Format('%.2X', [Raw[I]]);

  Result := Format('%s-%s-%s-%s', [HexStr.Substring(0, 4), HexStr.Substring(4,
    4), HexStr.Substring(8, 4), HexStr.Substring(12, 4)]);
end;

function Keygen(const Name: string): string;
var
  V20, V21: Word;
  BestB, BestN2: Byte;
  Chk: Cardinal;
  B0, B1, B2, B4, B5, B6, B7: Byte;
begin
  GetBestV20ForParam(V20, V21);
  GetBestBForVersion(BestB, BestN2);

  Chk := Checksum(Name, True, 0, V21 and $FF);
  B4 := Chk and $FF;
  B5 := (Chk shr 8) and $FF;
  B6 := (Chk shr 16) and $FF;
  B7 := (Chk shr 24) and $FF;

  B2 := ((V20 and $FF) xor B5) and $FF;
  B1 := (((V20 shr 8) and $FF) xor B7) and $FF;
  B0 := (BestB xor B6) and $FF;

  Result := FormatLicense([B0, B1, B2, TYPE_BYTE, B4, B5, B6, B7]);
end;

function Nibble(C: Char): Byte;
var
  O: Integer;
begin
  O := Ord(C);
  if (O >= $30) and (O <= $39) then
    Exit(O - $30);
  if ((O - 79) and $DF) = 0 then
    Exit(0);
  if O = $6C then
    Exit(1);
  if (O >= $61) and (O <= $7A) then
    Exit((O - 87) and $FF);
  if (O >= $41) and (O <= $5A) then
    Exit((O - 55) and $FF);
  Result := 0;
end;

function DecodeLicense(const Lic: string; out Bytes: TBytes): Boolean;
var
  S, Chars: string;
  I: Integer;
begin
  Bytes := nil;
  S := Lic.Replace('o', '0').Replace('O', '0').Replace('l', '1');
  if (S.Length <> 19) or (S[5] <> '-') or (S[10] <> '-') or (S[15] <> '-') then
    Exit(False);

  Chars := S.Replace('-', '');
  if Chars.Length <> 16 then
    Exit(False);

  SetLength(Bytes, 8);
  for I := 0 to 7 do
  begin
    Bytes[I] := ((16 * Nibble(Chars[I * 2 + 1])) + Nibble(Chars[I * 2 + 2]
      )) and $FF;
  end;
  Result := True;
end;

function Verify(const Name: string; const Lic: string): Boolean;
var
  By: TBytes;
  V39, V40, V41, V42, N5999655_1, V44, V45, V46, A1_108, N2, N255: Byte;
  V20: Word;
  V21: Integer;
  Chk: Cardinal;
  Ok: Boolean;
begin
  if not DecodeLicense(Lic, By) then
    Exit(False);

  V39 := By[0];
  V40 := By[1];
  V41 := By[2];
  V42 := By[3];
  N5999655_1 := By[4];
  V44 := By[5];
  V45 := By[6];
  V46 := By[7];

  if V42 <> TYPE_BYTE then
    Exit(False);

  V20 := ((V44 xor V41) + ((V46 xor V40) shl 8)) and $FFFF;
  A1_108 := Ad76((V45 xor V39) and $FF);
  V21 := C5b(V20);
  N2 := A1_108;

  if not((N2 <> 0) and ((V21 - 1) <= $3E7)) then
    Exit(False);

  if N2 < 2 then
    N255 := N2
  else
    N255 := 0;

  Chk := Checksum(Name, True, N255 and $FF, V21 and $FF);

  Ok := (N5999655_1 = (Chk and $FF)) and (V44 = ((Chk shr 8) and $FF)) and
    (V45 = ((Chk shr 16) and $FF)) and (V46 = ((Chk shr 24) and $FF));

  if not Ok then
    Exit(False);
  Result := VERSION_ARG <= A1_108;
end;

var
  Username: string;
  License: string;

begin
  try
    BuildTable;
    Writeln('==============================================');
    Writeln('     010 Editor 注册码生成器 (9C 算法) ');
    Writeln('==============================================');
    Writeln;

    Write('请输入用户名 (Username): ');
    Readln(Username);
    Username := Username.Trim;

    if Username = '' then
    begin
      Writeln('[错误] 用户名不能为空!');
      Exit;
    end;

    if Username.Length > 100 then
    begin
      Writeln('[错误] 用户名不能超过100个字符!');
      Exit;
    end;

    Writeln('正在计算中...');
    License := Keygen(Username);

    Writeln;
    Writeln('生成的注册码 (License Key):');
    Writeln('----------------------------------------------');
    Writeln(License);
    Writeln('----------------------------------------------');

    Write('自动校验状态: ');
    if Verify(Username, License) then
    begin
      // 绿色高亮显示 PASS
      if TOSVersion.Platform = pfWindows then
      begin
        Writeln('PASS');
      end
      else
        Writeln('PASS');
    end
    else
    begin
      Writeln('FAIL');
    end;

  except
    on E: Exception do
      Writeln('[异常] ' + E.ClassName + ': ' + E.Message);
  end;

  Writeln;
  Write('按下回车键退出...');
  Readln;

end.
bachelor66 发表于 2026-6-23 09:05
还是html的方便,人人都能用,感谢楼主的分享                  
zyrwl 发表于 2026-6-22 19:26
qianwei11 发表于 2026-6-22 20:07
特别厉害,谢谢分享
q303772510 发表于 2026-6-22 21:56
谢谢分享!
jy02236902 发表于 2026-6-23 03:55

挺好用。。。。。。。。。。。。。。。
jxnc 发表于 2026-6-23 07:53
这个厉害,谢谢
szhorse 发表于 2026-6-23 07:54
确实,还是网页版的舒服
LuckyClover 发表于 2026-6-23 08:21
有用帮顶
XTDR12 发表于 2026-6-23 08:23
感谢楼主大佬分享,厉害
cx6516484 发表于 2026-6-23 08:33
挺方便的,感谢!
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - 52pojie.cn ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2026-6-24 09:50

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表