function Bypass_frida() { var pt_strstr = Module.findExportByName( "libc.so" , 'strstr' ); Interceptor.attach(pt_strstr, { onEnter: function (args) { var args1 = args[ 0 ].readCString(); var args2 = args[ 1 ].readCString(); if ( args2.indexOf( "gum-js-loop" ) ! = = - 1 || args2.indexOf( "pool-frida" ) ! = = - 1 || args2.indexOf( "linjector" ) ! = = - 1 || args2.indexOf( "REJECT" ) ! = = - 1 || args2.indexOf( "frida" ) ! = = - 1 || args2.indexOf( "gmain" ) ! = = - 1 || args2.indexOf( "gdbus" ) ! = = - 1 || args2.indexOf( "tmp" ) ! = = - 1 ) { console.log( "strstr-->" , args1, args2); this.hook_str = true; } }, onLeave: function (retval) { if (this.hook_str) { retval.replace( 0 ); } } }); var pt_strcmp = Module.findExportByName( "libc.so" , 'strcmp' ); Interceptor.attach(pt_strcmp, { onEnter: function (args) { var args1 = args[ 0 ].readCString(); var args2 = args[ 1 ].readCString(); if ( args2.indexOf( "gum-js-loop" ) ! = = - 1 || args2.indexOf( "pool-frida" ) ! = = - 1 || args2.indexOf( "linjector" ) ! = = - 1 || args2.indexOf( "REJECT" ) ! = = - 1 || args2.indexOf( "frida" ) ! = = - 1 || args2.indexOf( "gmain" ) ! = = - 1 || args2.indexOf( "gdbus" ) ! = = - 1 || args2.indexOf( "tmp" ) ! = = - 1 ) { console.log( "strcmp-->" , args1, args2); this.hook_cmp = true; } }, onLeave: function (retval) { if (this.hook_cmp) { retval.replace( 0 ); } } }) } Bypass_frida(); |