Skip to content

Instantly share code, notes, and snippets.

@CodingPapi
Created March 19, 2017 17:17
Show Gist options
  • Save CodingPapi/34c354a27d3d30eb5bf80465cbd13ec5 to your computer and use it in GitHub Desktop.
Save CodingPapi/34c354a27d3d30eb5bf80465cbd13ec5 to your computer and use it in GitHub Desktop.
Anti debug from browser
!function test() {
// 捕获异常,递归次数过多调试工具会抛出异常。
try{
!function cir(i)
{
// 当打开调试工具后,抛出异常,setTimeout执行test无参数,此时i == NaN,("" + i / i).length == 3
// debugger设置断点
( 1 !== ( "" + i / i).length || 0===a ) && function(){}.constructor("debugger")(),cir(++i);
} (0)
} catch(e) {
debugger;
setTimeout(test,500)
}
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment