[Feature Request] Better Self Defender
See original GitHub issueOkey, in #754 I has been misstake with title. What about create smarter defender not like the current?
For example: Create a hash of current code. If hash is different - broke code. Second way: Check length of current code. Third way: Create few hashes of few functions and check this hashes. (this way for too long code)
For example:
const kruzya = 0;
function getKruzya() { return kruzya +1}; // we get hash of this function (just for example)
console.log(getKruzya());
in obfuscate mode:
const hashes = [{function: _0x2, hash: "ABC"}]; // just example hash
const 0x1 = 0;
function _0x2() {return 0x1 + 1}; // so if I edit this function, name, or body (content/context) of function - code just broke.
console.log( _0x2());
// just typo example
function check() {
const e = hashes[0];
if (typeof e.function !== "undefined") // check if func is exist ...
const body = e.functionName;
if (!body || !body.length) BROKE_CODE(); // note: just second check but I think this is optional.
const newHash = getHash(body);
const oldHash = e.hash;
if (oldHash !== newHash) BROKE_CODE();
}
else BROKE_CODE(); // just typo example
and yep. This is all. I didn’t think about HOW TO CHECK HASH. But I hope this is simple 👀
My code is just example.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Enabling and disabling Self-Defense
The Self-Defense mechanism of Kaspersky Endpoint Security is enabled by default. You can disable Self-Defense, if necessary. To enable or disable Self-Defense:.
Read more >15 Self-Defense Products Every Runner Should Know About
We hope you never need most of the products on this list, but with runner safety at a premium, here are some items...
Read more >The Ultimate Self-Defense Guide: How to Keep Yourself Safe ...
1) Maintain Awareness. Any good self-defense instructor will tell you that the first and best self-protection tool you can employ is general situational ......
Read more >Self-defense classes in high demand; Experts point to rising ...
INDIANAPOLIS, Ind.– Demand for self-defense classes are on the rise and experts point to rising violence across the nation as the reason.
Read more >Surveillance Self-Defense Against the Trump Administration
Trump is about to have more tools of surveillance at his disposal than any tyrant ever has. Here's how to protect yourself.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The main problem is that such kind of code can be detected and removed. So right now I’m more focused on code transformations than on additional code helpers.
Seems it’s a duplicate of https://github.com/javascript-obfuscator/javascript-obfuscator/issues/330
Anyway, not in the nearest plans