frida anti pthread_create

function anti_pthread(){
  var p_pthread_create = Module.findExportByName("libc.so", "pthread_create");
  var pthread_create = new NativeFunction( p_pthread_create, "int", ["pointer", "pointer", "pointer", "pointer"]);
   
  Interceptor.replace( p_pthread_create, new NativeCallback(function (ptr0, ptr1, ptr2, ptr3) {
      var ret = ptr(0);
     
      if (ptr1.isNull() && ptr3.isNull()) {
       console.log("null")
      } else {
        try{
          console.log(ptr0,ptr1,ptr2,ptr3)
          ret = pthread_create(ptr0,ptr1,ptr2,ptr3);

        }catch(error){


        }
      }
      
  }, "int", ["pointer", "pointer", "pointer", "pointer"]));

}
posted @ 2022-11-15 15:03  公众号python学习开发  阅读(112)  评论(0编辑  收藏  举报