浏览代码

更新 GMS 追踪逻辑,改为检测不稳定标识符,并调整拦截器以记录打开文件路径

xiongzhu 10 月之前
父节点
当前提交
76afcf7bcd
共有 2 个文件被更改,包括 5 次插入7 次删除
  1. 1 1
      injects/spoof_gms.js
  2. 4 6
      scripts/gms.js

+ 1 - 1
injects/spoof_gms.js

@@ -89,7 +89,7 @@ async function main() {
 
 async function onSpawnAdded(spawn) {
     try {
-        if (spawn.identifier.startsWith('com.google.android.gms')) {
+        if (spawn.identifier.includes('unstable')) {
             Log.i('[*] Tracing', spawn.pid, spawn.identifier)
             const tracer = await Tracer.open(spawn.pid, '../scripts/gms.js')
             tracers.push(tracer)

+ 4 - 6
scripts/gms.js

@@ -86,13 +86,13 @@ Java.perform(function () {
     //         console.log('value: ' + valueStr)
     //     }
     // })
-
-    Interceptor.attach(Module.findExportByName(null, 'ioctl'), {
+    const SIOCGIFHWADDR = 0x8927;
+    Interceptor.attach(Module.findExportByName(null, 'open'), {
         onEnter: function (args) {
-            Log.e('nl_socket_alloc', args[0])
+            var path = Memory.readCString(args[0])
+            Log.e('fopen', path)
         },
         onLeave: function (retval) {
-            Log.e('nl_socket_alloc: ' + retval)
         }
     })
     // // var libart = Process.getModuleByName('libart.so')
@@ -130,6 +130,4 @@ Java.perform(function () {
 
         return content
     }
-
-
 })