axhlzy / Il2CppHookScripts

frida-based libil2cpp.so runtime parsing script
MIT License
519 stars 165 forks source link

部分失效 #7

Closed 350030173 closed 3 years ago

350030173 commented 3 years ago

attach的时候,i()方法显示not a function

λ frida -U -l C:\Users\Administrator\Desktop\工具\Il2CppDumperTool-master\U3DHook\Ufun.js -F


/ _  |   Frida 14.2.2 - A world-class dynamic instrumentation toolkit

| (_| |

| Commands: // |_| help -> Displays the help system . . . . object? -> Display information about 'object' . . . . exit/quit -> Exit . . . . . . . . More info at https://www.frida.re/docs/home/ [MI 8::地球末日:生存]-> i() TypeError: not a function at list_Images (/Ufun.js:362) at i (/Ufun.js:212) [MI 8::地球末日:生存]->

spwan启动的时候,i()方法正常,a()方法失效

λ frida -U -l C:\Users\Administrator\Desktop\工具\Il2CppDumperTool-master\U3DHook\Ufun.js -f zombie.survival.craft.z --no-pause


/ _  |   Frida 14.2.2 - A world-class dynamic instrumentation toolkit

| (_| |

| Commands: // |_| help -> Displays the help system . . . . object? -> Display information about 'object' . . . . exit/quit -> Exit . . . . . . . . More info at https://www.frida.re/docs/home/ Spawned zombie.survival.craft.z. Resuming main thread! [MI 8::zombie.survival.craft.z]-> i()

[] 0xd69c5400 1527 mscorlib [] 0xd69c5438 10 System.Configuration [] 0xd69c5470 75 Mono.Security [] 0xd69c54a8 8 System.Xml [] 0xd69c54e0 594 System [] 0xd69c5518 56 System.Core [] 0xd69c5550 29 UnityEngine.SharedInternalsModule [] 0xd69c5588 587 UnityEngine.CoreModule [] 0xd69c55c0 2 System.Data [] 0xd69c55f8 1 System.Diagnostics.StackTrace [] 0xd69c5630 1 System.Globalization.Extensions [] 0xd69c5668 1 System.IO.Compression [] 0xd69c56a0 5 UnityEngine.AssetBundleModule [] 0xd69c56d8 38 UnityEngine.PhysicsModule [] 0xd69c5710 12 UnityEngine.SubsystemsModule [] 0xd69c5748 16 UnityEngine.TextRenderingModule [] 0xd69c5780 13 UnityEngine.UnityWebRequestModule [] 0xd69c57b8 25 UnityEngine.AudioModule [] 0xd69c57f0 2 UnityEngine.GridModule [] 0xd69c6a18 2 UiTest [] 0xd69c6a18 2 UiTest [] 0xd69c6a50 79 Unity.Addressables [] 0xd69c6a88 48 Unity.Mediation [] 0xd69c6ac0 262 devtodev_cross [] 0xd69c6af8 2 Facebook.Unity.Android [] 0xd69c6b30 29 Google.Play.AppUpdate [] 0xd69c6b68 46 Google.Play.AssetDelivery [] 0xd69c6ba0 8 Google.Play.Instant [] 0xd69c6bd8 8 Google.Play.Review [] 0xd69c6c10 7 SA.Foundation.Network [] 0xd69c6c48 6 Unity.Analytics.DataPrivacy [] 0xd69c6c80 33 Unity.ProBuilder [] 0xd69c6cb8 326 Assembly-CSharp-firstpass [] 0xd69c6cf0 11094 Assembly-CSharp

List 115 Images

[MI 8::zombie.survival.craft.z]-> a()


Added 0 Methods | All 0

[MI 8::zombie.survival.craft.z]->

axhlzy commented 3 years ago

不知道你说的是哪一款哈,刚才去 https://apkpure.com/cn/last-day-on-earth/zombie.survival.craft.z 下载的这款是没问题的 方法数量太多不建议全部 hook,B("filter"),p("filter")筛选一下来hook 吧 一般情况下不建议使用 Spawned 附加(u3d的导出函数需要在u3d初始化完成之后才能调用,然而这里只是判断了加载il2cpp的时机,这个时机去做u3d的事情未必能成功,而且涉及到这种三万个方法的查找也很慢),如果你想在早期 hook ,可以正常进去附加并使用 a() 添加后在使用 p('filter')进行筛选,最后拿到这些地址使用 bpoint.js 进行启动时附加 (启动时hook太多函数有概率崩掉,特别是掉java有报错的函数,可能java try catch 处理了,但是你这么附加到这种报错的函数依旧会崩掉),所以有筛选了hook 别一股脑全部 hook (下下策。。。。) 最后一点,a() 倒是带个参数呀。。。 之所以a() 添加了默认参数是希望直接用 B() 方便点

function a(imgOrCls){
    if (imgOrCls == undefined) {
        for (var i = 0 ;i< arr_img_names.length;i++){
            if ( arr_img_names[i] == 'Assembly-CSharp'){
                imgOrCls = arr_img_addr[i]
                break
            }
        }
    }
    addBreakPoints(imgOrCls)
}

要么就是你这里的初始化有问题,只有arr_img_names空的时候a()才是空,你既然能i(),那就顺带传参

1 2