Open doctor8296 opened 3 days ago
Nice. Are people actually patching the String.fromCharCode
and String.prototype.charCodeAt
and bypassing Integrity?
Are people actually patching the
String.fromCharCode
andString.prototype.charCodeAt
and bypassing Integrity
They absolutely capabel of it. By hooking onto String.fromCharCode they can have clear view on what gets decrypted / what password is etc etc.
I even can imagine how it is possible to bypass integrity check (basically it is already possible by redefining Function.prototype.toString. And as you learn pattern of checks (order functions get checked) you can bypass it, since the behaviour of the protection is static. Or you can read stack and replace only when you need it).
And not only that! They can just crash the script with that, which is very dangerous in some cases.
The model should be consistent and independent (isolated) from any other external factors.
Talking of determined code behaviour, I very like the idea about randomized behaviour of it in someway, so some redefinitions that expect static checks will break. But unfortunately there is no possible way to get random values, "pure" random function, that cannot be redefined. But if you know how to get just random strings based only sole on literals or some other techniques, it will be helpful.
I collected/writed safe functions (based on literals), which are unpatchable and non-redefinable, and can safely be used for integrety checks or for "easy" encryption.
The only problem with those methods is that they have to use
String.fromCharCode
andString.prototype.charCodeAt
(which are patchable). It can be solved by predefined literal dictionaries with symbols and charcodes. But it is not convenient to have whole unicode dictionary in code, because it is very large. However as far as we know all the characters used in code (and it is very unlikely that it will have all the characters, I'd say even more than 2% of it). Or we can use limited predefined set, like only ASCII chars.