From f251c901b8a4b7f6a896daba2290aa67d1674efe Mon Sep 17 00:00:00 2001 From: nezu Date: Wed, 5 Aug 2026 16:27:54 +0200 Subject: [PATCH] Update keygen.js --- keygen.js | 65 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 37 insertions(+), 28 deletions(-) diff --git a/keygen.js b/keygen.js index 65badbd..7ea09da 100644 --- a/keygen.js +++ b/keygen.js @@ -1,3 +1,6 @@ +// Made specifically for IDA 9.4 beta1 +// May not work for other versions of this software including future ones + const fs = require('fs'); const crypto = require('crypto'); @@ -19,7 +22,7 @@ const license = { issued_on: '2025-07-20 00:00:00', owner: 'auth', product_id: 'IDAPRO', - product_version: '9.3', + product_version: '9.4', add_ons: [], features: [], } @@ -33,8 +36,7 @@ function addons(license) { 'HEXX86', 'HEXX64', 'HEXARM', 'HEXARM64', 'HEXMIPS', 'HEXMIPS64', 'HEXPPC', 'HEXPPC64', 'HEXRV', 'HEXRV64', 'HEXARC', 'HEXARC64', - 'HEXV850' - + 'HEXV850', 'HEXDALVIK' ]; addons.forEach((addon, i) => { @@ -62,27 +64,31 @@ function sort(obj) { } } -const cModulus = Buffer.from("edfd42cbf978546e8911225884436c57140525650bcf6ebfe80edbc5fb1de68f4c66c29cb22eb668788afcb0abbb718044584b810f8970cddf227385f75d5dddd91d4f18937a08aa83b28c49d12dc92e7505bb38809e91bd0fbd2f2e6ab1d2e33c0c55d5bddd478ee8bf845fcef3c82b9d2929ecb71f4d1b3db96e3a8e7aaf93", "hex"); -const privateKey = Buffer.from("77c86abbb7f3bb134436797b68ff47beb1a5457816608dbfb72641814dd464dd640d711d5732d3017a1c4e63d835822f00a4eab619a2c4791cf33f9f57f9c2ae4d9eed9981e79ac9b8f8a411f68f25b9f0c05d04d11e22a3a0d8d4672b56a61f1532282ff4e4e74759e832b70e98b9d102d07e9fb9ba8d15810b144970029874", "hex"); +const cModulus = Buffer.from("3f0307607fed562fd5a163adc40fcc603373caa28414e64cdc4552a555b13ad4b3ad0a812800a03195300fd71634b90edb0d69ea710efebb2b0b9e72da2effb149de70bcbfa94b86af01ce455dbbd5fa987207651c7b60c2e4cafd0654188d98c30f64dc084d8547f0ac32db91124af82b3b15bf922a31f1d5e332f27615cea7", "hex"); +const privateKey = Buffer.from("8b3f5fdfad7f87239734c530e2ecebeb4fa48d79518756c15fd54636801cf7ea6367100566bf8b52b16bec05258d8426ea94c15841ab2d37802c07349df4c208584e86d25a6bfb82966cb2ddcd3d654e9994e814ca470577362a937cc984e404a0b68d173aab3180130118e1b03ed209a9d8757560a85a3c9b0d3380e7907c4f", "hex"); + +const V54 = 127; +const V56 = 95; +const PADKEY = Buffer.from("e2a7c300dfcc777f89b57500d8151c7fb1d97b3f9f170393311234ceeb9e377ae2a7c300dfcc777f89b57500d8151c7fb1d97b3f9f170393311234ceeb9e377ae2a7c300dfcc777f89b57500d8151c7fb1d97b3f9f170393311234ceeb9e377ae2a7c300dfcc777f89b57500d8151c7fb1d97b3f9f170393311234ceeb9e37", "hex"); function encrypt(message) { let modulusBuf = 0n; for (let i = cModulus.length - 1; i >= 0; i--) modulusBuf = (modulusBuf << 8n) + BigInt(cModulus[i]); - + let keyBuf = 0n; for (let i = privateKey.length - 1; i >= 0; i--) keyBuf = (keyBuf << 8n) + BigInt(privateKey[i]); - + var reversed = Buffer.from(message).reverse(); - + let msgBuf = 0n; for (let i = reversed.length - 1; i >= 0; i--) msgBuf = (msgBuf << 8n) + BigInt(reversed[i]); let base = msgBuf % modulusBuf, exponent = keyBuf, modulus = modulusBuf, encryptedBigInt = 1n; while (exponent > 0n) { - if (exponent % 2n === 1n) + if (exponent % 2n === 1n) encryptedBigInt = (encryptedBigInt * base) % modulus; exponent >>= 1n; base = (base * base) % modulus; } @@ -95,16 +101,17 @@ function encrypt(message) { function patch(filePath, search, replace) { try { const buf = fs.readFileSync(filePath); - const idx = buf.indexOf(search); - if (idx !== -1) { + let count = 0, idx = buf.indexOf(search); + while (idx !== -1) { buf.set(replace, idx); - fs.writeFileSync(filePath, buf); - console.log(`Patched ${filePath}`); - return; + count++; + idx = buf.indexOf(search, idx + search.length); } - else { + if (count > 0) { + fs.writeFileSync(filePath, buf); + console.log(`Patched ${filePath} (${count} occurrence${count === 1 ? '' : 's'})`); + } else { console.error(`Pattern not found in ${filePath}`); - return; } } catch (err) { console.error(`Error reading or writing file: ${filePath}`); @@ -114,17 +121,19 @@ function patch(filePath, search, replace) { } function sign(payload) { - var data = { payload }; - var dataStr = sort(data); + var dataStr = sort({ payload }); + var hash = crypto.createHash('sha256').update(dataStr).digest(); // 32 bytes - var buffer = Buffer.alloc(128, 0); - buffer.fill(0x42, 0, 33); // first 33 bytes filled with 0x42 + var U = Buffer.alloc(V54, 0); + hash.copy(U, V56); + var block = Buffer.alloc(V54); + for (var i = 0; i < V54; i++) block[i] = U[i] ^ PADKEY[i]; + if (block[0] === 0) block[0] ^= 1; - var hash = crypto.createHash('sha256').update(dataStr).digest(); - hash.copy(buffer, 33); // copy hash after first 33 bytes - - var encrypted = encrypt(buffer); - return encrypted.toString('hex').toUpperCase(); + var sig = encrypt(block); + var out = Buffer.alloc(128, 0); + sig.copy(out, 0); + return out.toString('hex').toUpperCase(); } license.signature = sign(license.payload); @@ -133,12 +142,12 @@ fs.writeFileSync('idapro.hexlic', sort(license)); console.log('License written to idapro.hexlic'); // --- Patcher --- -const search = Buffer.from('EDFD425CF978', 'hex'); -const replace = Buffer.from('EDFD42CBF978', 'hex'); +const search = Buffer.from("29f4481f796f9f66f2ff13cc4ab5b54f60845db603ba2c0bac8a9bc4b6cbdefc5c62bfc2f5ee850ac45ea97ad347e8b56dba5085af8c8aad9cc2ec626ca78a068006d658f68651da31a0a77c65a70ed73a40d53b08edd403c095aa0bcffa52f313ebcacaaa2ce5024a4e2b9aa70fc6092f38ae094d71e43f7690b5ddd3e9e4f7", "hex"); +const replace = Buffer.from("a107b71c8a08ba5350934f7cf6e81be3a24dc2e35f7200d80cbd70b37ed6811dd2146d3cb7e20ad19b2544c0ef14c5c66ffbbdf226ec3f3d544c04385303ca4a7179299340022f5d50948bcf8a60307e2c196329e51a5296dc419e40fef3ef7c6f015a09ebd979e79615338985643e666c14897f9f597e11f44341f496d56861", "hex"); ["ida.dll", "ida32.dll", "libida.so", "libida32.so", "libida.dylib", "libida32.dylib"].forEach(file => { if (fs.existsSync(file)) { console.log(`Patching ${file}...`); patch(file, search, replace); } -}); \ No newline at end of file +});