How to realize implicit flow Integrity Control by JavaScript
Editor to share with you how JavaScript to achieve implicit flow integrity control, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Implicit flow integrity control
When we try to anti-obfuscate the code, we first try to rename some functions or variables, but in JavaScript we can detect whether the function name has been modified, or we can get its original name or call order directly through the stack trace.
Arguments.callee.caller can help us create a stack trace to store previously executed functions, as shown in the following code:
Function getCallStack () {var stack = "#", total = 0, fn = arguments.callee; while ((fn = fn.caller)) {stack = stack + "" + fn.name; total++} return stack} function test1 () {console.log (getCallStack ();} function test2 () {test1 ();} function test3 () {test2 ();} function test4 () {test3 ();} test4 ()
Note: the more confusing the source code, the better the effect of this technique.
These are all the contents of the article "how JavaScript implements implicit flow integrity control". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!