Skip to content

Commit

Permalink
Update hook.js
Browse files Browse the repository at this point in the history
还原激活功能
  • Loading branch information
L1bws authored Dec 20, 2023
1 parent 9fd794f commit 76c31bd
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ const crypto = require("crypto");
const pubdec = crypto["publicDecrypt"];
delete crypto["publicDecrypt"];
let fingerprint, email, uuid, license, computerInfo = "";
let License = ""
crypto.publicDecrypt = function (key, buffer) {
log("PubDec Key:" + key);
log("buf: " + buffer.toString('base64'));
if (buffer.slice(0, 26).compare(Buffer.from("CRACKED_BY_DIAMOND_HUNTERS")) == 0) {
License = buffer.toString('base64');
let ret = buffer.toString().replace("CRACKED_BY_DIAMOND_HUNTERS", "");
log("backdoor data,return : " + ret);
return Buffer.from(ret);
}
return pubdec(key, buffer);
};

const fetch = require("electron-fetch")
fetch_bak = fetch['default'];
Expand All @@ -30,6 +42,31 @@ fetch.default = async function fetch(url, options) {
ret = await data.buffer();
log('[fetch]Ret ' + ret.toString());

ret = Buffer.from('{"code":0,"retry":true,"msg":"' + Buffer.from("CRACKED_BY_DIAMOND_HUNTERS" + JSON.stringify(
{
"fingerprint": fingerprint,
"email": email,
"license": license,
"type": ""
})).toString('base64') + '"}');
log("replace ret: " + ret.toString());
data.text = () => {
return new Promise((resolve, reject) => {
resolve(ret.toString());
});
};
data.json = () => {
return new Promise((resolve, reject) => {
resolve(JSON.parse(ret.toString()));
});
};
}
if (url.indexOf('api/client/renew') != -1) {
ret = await data.buffer();
log('[fetch]Ret ' + ret.toString());

ret = Buffer.from('{"success":true,"code":0,"retry":true,"msg":"' + License + '"}');
log("replace ret: " + ret.toString());
data.text = () => {
return new Promise((resolve, reject) => {
resolve(ret.toString());
Expand All @@ -41,7 +78,6 @@ fetch.default = async function fetch(url, options) {
});
};
}

return new Promise((resolve, reject) => {
resolve(data);
});
Expand Down

0 comments on commit 76c31bd

Please sign in to comment.