axhlzy / Il2CppHookScripts

frida-based libil2cpp.so runtime parsing script
MIT License
530 stars 168 forks source link

每次调用函数都会出现 "KeyError: 'message'" 报错信息 #28

Closed UPON-2021 closed 9 months ago

UPON-2021 commented 1 year ago

系统环境

电脑

图片

脚本就是按照README.md 编译生成的脚本

涉及到报错的 一些包的版本 图片

平板

图片

报错信息:

图片

fat com.hypergryph.arknights
     ____
    / _  |   Frida 16.0.8 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at https://frida.re/docs/home/
   . . . .
   . . . .   Connected to M2105K81AC (id=192.168.1.3:5555)
Spawned `com.hypergryph.arknights`. Resuming main thread!               
[M2105K81AC::com.hypergryph.arknights ]-> i("UnityEngine.Networking")
 --------------------------------------------------------------                                               
| List Images { assembly -> image -> classCount -> imageName } |                                              
 --------------------------------------------------------------                                               
Traceback (most recent call last):                                                                            
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,                                                                
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code           
    exec(code, run_globals)
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\Scripts\frida.exe\__main__.py", line 7, in <module>
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 1362, in main
    app.run()
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\application.py", line 398, in run
    self._reactor.run()
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\reactor.py", line 44, in run
    self._run_until_return(self)
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 435, in _process_input
    if not self._exec_and_print(self._evaluate_expression, expression):
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 463, in _exec_and_print
    (t, value) = self._perform_on_reactor_thread(lambda: exec(arg))
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\application.py", line 768, in _perform_on_reactor_thread
    raise error
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\application.py", line 752, in work
    result[0] = f()
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 463, in <lambda>
    (t, value) = self._perform_on_reactor_thread(lambda: exec(arg))
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 648, in _evaluate_expression
    return self._parse_evaluate_result(result)
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 661, in _parse_evaluate_result
    raise JavaScriptError(result[1])
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 1195, in __init__
    super().__init__(error["message"])
KeyError: 'message'

尝试使用frida

图片

图片

┌──(UPON💀DESKTOP-HVRI740)-[F:/Arknight/arkModify/scripts/Il2CppHookScripts]-[ts]                                                                                                                                      1s  ⨯  
└─# frida -Uf com.hypergryph.arknights -l .\Il2cppHook\_Ufunc.js
     ____
    / _  |   Frida 16.0.8 - A world-class dynamic instrumentation toolkit
   | (_| |
    > _  |   Commands:
   /_/ |_|       help      -> Displays the help system
   . . . .       object?   -> Display information about 'object'
   . . . .       exit/quit -> Exit
   . . . .
   . . . .   More info at https://frida.re/docs/home/
   . . . .
   . . . .   Connected to M2105K81AC (id=192.168.1.3:5555)
Spawned `com.hypergryph.arknights`. Resuming main thread!               
[M2105K81AC::com.hypergryph.arknights ]-> c()
Error: imageOrName can not be null
[M2105K81AC::com.hypergryph.arknights ]-> c("UnityEngine.Networking")

 Current -> UnityEngine.Networking.dll @ 0x7dd4ac68c0                                     

 ---------------------------------------------------------------------------------------- 
| List Classes { namespace {classPtr->filedsCount->methodsCount->enumClass->className} } |
 ---------------------------------------------------------------------------------------- 

[*] UnityEngine.Networking
        [-] 0x7dd4d8e400 (F:30/M:17/E:0)        ChannelBuffer
        [-] 0x7dd4d8e280 (F:3/M:6/E:0)  ChannelPacket
        [-] 0x7dd1ee2c00 (F:34/M:42/E:0)        ClientScene
        [-] 0x7dd4d8e580 (F:0/M:1/E:0)  ClientAttribute
        [-] 0x7dd4d8e700 (F:0/M:1/E:0)  ClientCallbackAttribute
        [-] 0x7dd4d8e880 (F:0/M:2/E:0)  DotNetCompatibility
        [-] 0x7dd1ee2f00 (F:6/M:10/E:0) LocalClient
        [-] 0x7dd4cefa00 (F:1/M:6/E:0)  ULocalConnectionToClient
        [-] 0x7dd4cefc00 (F:1/M:5/E:0)  ULocalConnectionToServer
        [-] 0x7dd1ee3200 (F:2/M:7/E:0)  LogFilter
        [-] 0x7dd4d8ea00 (F:0/M:3/E:0)  MessageBase
        [-] 0x7d99807c00 (F:15/M:29/E:0)        NetworkAnimator
        [-] 0x7dd4299b00 (F:6/M:65/E:0) NetworkBehaviour
        [-] 0x7dd4e01100 (F:5/M:16/E:0) NetBuffer
        [-] 0x7dd4e01280 (F:4/M:0/E:0)  UIntFloat
        [-] 0x7dd4e01400 (F:0/M:1/E:0)  FloatConversion
        [-] 0x7dd1ee3080 (F:24/M:39/E:0)        NetworkClient
        [-] 0x7dd1eea600 (F:19/M:41/E:0)        NetworkConnection
        [-] 0x7dd4e01580 (F:3/M:8/E:0)  NetworkCRC
        [-] 0x7dd4e01700 (F:2/M:0/E:0)  NetworkBroadcastResult
        [-] 0x7dd1ee3e00 (F:19/M:40/E:0)        NetworkDiscovery
        [-] 0x7dd4e01880 (F:16/M:2/E:0) NetworkHash128
        [-] 0x7dd1ee3680 (F:20/M:59/E:0)        NetworkIdentity
        [-] 0x7dd4e01a00 (F:3/M:9/E:0)  NetworkInstanceId
        [-] 0x7dd1eca800 (F:13/M:67/E:0)        NetworkLobbyManager
        [-] 0x7d98d97a00 (F:3/M:20/E:0) NetworkLobbyPlayer
        [-] 0x7dd4ddef00 (F:3/M:0/E:1)  PlayerSpawnMethod
        [-] 0x7dbf0eb680 (F:48/M:132/E:0)       NetworkManager
        [-] 0x7d9986ca00 (F:5/M:4/E:0)  NetworkManagerHUD
        [-] 0x7dd4e01b80 (F:1/M:5/E:0)  NetworkMessageHandlers
        [-] 0x7dd1eeaa00 (F:16/M:50/E:0)        NetworkMigrationManager
        [-] 0x7dd1ee7800 (F:5/M:6/E:0)  NetworkProximityChecker
        [-] 0x7dd4e01d00 (F:5/M:25/E:0) NetworkReader
        [-] 0x7dd4e01e80 (F:4/M:13/E:0) NetworkScene
        [-] 0x7dd4e02000 (F:1/M:7/E:0)  NetworkSceneId
        [-] 0x7dd1ee3c80 (F:24/M:82/E:0)        NetworkServer
        [-] 0x7dd1eec000 (F:12/M:31/E:0)        NetworkServerSimple
        [-] 0x7dd1ee3f80 (F:0/M:3/E:0)  NetworkStartPosition
        [-] 0x7dd1ee8c00 (F:19/M:36/E:0)        NetworkTransformChild
        [-] 0x7dd1ee7d00 (F:34/M:77/E:0)        NetworkTransform
        [-] 0x7dd1efb000 (F:4/M:10/E:0) NetworkTransformVisualizer
        [-] 0x7dd4e02180 (F:5/M:26/E:0) NetworkWriter
        [-] 0x7dd4e02300 (F:5/M:4/E:0)  PlayerController
        [-] 0x7dd4cefe00 (F:0/M:4/E:0)  NetworkMessageDelegate
        [-] 0x7dd4cfc000 (F:0/M:4/E:0)  SpawnDelegate
        [-] 0x7dd4cfc200 (F:0/M:4/E:0)  UnSpawnDelegate
        [-] 0x7dd4e02480 (F:1/M:2/E:0)  MsgType
        [-] 0x7dd1d58a80 (F:5/M:3/E:0)  NetworkMessage
        [-] 0x7dd4ddf180 (F:2/M:0/E:1)  Version
        [-] 0x7dd4ddf400 (F:4/M:0/E:1)  ChannelOption

[*]
        [-] 0x7dd1ee2a80 (F:2/M:0/E:0)  PendingOwner
        [-] 0x7dd1ee2d80 (F:2/M:0/E:0)  InternalMsg
        [-] 0x7dd1ee6b80 (F:8/M:0/E:1)  FilterLevel
        [-] 0x7dd1eea400 (F:0/M:4/E:0)  CmdDelegate
        [-] 0x7dd1ee6e00 (F:5/M:0/E:1)  UNetInvokeType
        [-] 0x7dd1ee3380 (F:3/M:2/E:0)  Invoker
        [-] 0x7dd1ee7080 (F:8/M:0/E:1)  ConnectState
        [-] 0x7dd1ee3500 (F:3/M:1/E:0)  PacketStat
        [-] 0x7dd1eea800 (F:0/M:4/E:0)  ClientAuthorityCallback
        [-] 0x7dd1ee3800 (F:2/M:0/E:0)  PendingPlayer
        [-] 0x7dd1ee7300 (F:3/M:0/E:1)  SceneChangeOption
        [-] 0x7dd1ee3980 (F:3/M:0/E:0)  PendingPlayerInfo
        [-] 0x7dd1ee3b00 (F:1/M:0/E:0)  ConnectionPendingPlayers
        [-] 0x7dd1ee7580 (F:3/M:0/E:1)  CheckMethod
        [-] 0x7dbc4c6e40 (F:1/M:7/E:0)  ServerSimpleWrapper
        [-] 0x7dd1ee7a80 (F:6/M:0/E:1)  TransformSyncMode
        [-] 0x7dd1ee7f80 (F:9/M:0/E:1)  AxisSyncMode
        [-] 0x7dd1ee8200 (F:4/M:0/E:1)  CompressionSyncMode
        [-] 0x7dd1eeac00 (F:0/M:4/E:0)  ClientMoveCallback3D
        [-] 0x7dd1eeae00 (F:0/M:4/E:0)  ClientMoveCallback2D

[*] UnityEngine.Networking.NetworkSystem
        [-] 0x7dd4d8eb80 (F:1/M:3/E:0)  StringMessage
        [-] 0x7dd4d8ed00 (F:1/M:4/E:0)  IntegerMessage
        [-] 0x7dd4d8ee80 (F:0/M:3/E:0)  EmptyMessage
        [-] 0x7dd4dff000 (F:1/M:3/E:0)  ErrorMessage
        [-] 0x7dd4dff180 (F:0/M:1/E:0)  ReadyMessage
        [-] 0x7dd4dff300 (F:0/M:1/E:0)  NotReadyMessage
        [-] 0x7dd4dff480 (F:3/M:3/E:0)  AddPlayerMessage
        [-] 0x7dd4dff600 (F:1/M:3/E:0)  RemovePlayerMessage
        [-] 0x7dd4dff780 (F:3/M:3/E:0)  PeerAuthorityMessage
        [-] 0x7dd4dff900 (F:2/M:0/E:0)  PeerInfoPlayer
        [-] 0x7dd4dffa80 (F:6/M:4/E:0)  PeerInfoMessage
        [-] 0x7dd4dffc00 (F:2/M:3/E:0)  PeerListMessage
        [-] 0x7dd4dffd80 (F:5/M:3/E:0)  ReconnectMessage
        [-] 0x7dd4dfff00 (F:5/M:3/E:0)  ObjectSpawnMessage
        [-] 0x7dd4e00080 (F:4/M:3/E:0)  ObjectSpawnSceneMessage
        [-] 0x7dd4e00200 (F:1/M:3/E:0)  ObjectSpawnFinishedMessage
        [-] 0x7dd4e00380 (F:1/M:3/E:0)  ObjectDestroyMessage
        [-] 0x7dd4e00500 (F:2/M:3/E:0)  OwnerMessage
        [-] 0x7dd4e00680 (F:2/M:3/E:0)  ClientAuthorityMessage
        [-] 0x7dd4e00800 (F:4/M:3/E:0)  AnimationMessage
        [-] 0x7dd4e00980 (F:2/M:3/E:0)  AnimationParametersMessage
        [-] 0x7dd4e00b00 (F:2/M:3/E:0)  AnimationTriggerMessage
        [-] 0x7dd4e00c80 (F:2/M:3/E:0)  LobbyReadyToBeginMessage
        [-] 0x7dd4e00e00 (F:2/M:0/E:0)  CRCMessageEntry
        [-] 0x7dd4e00f80 (F:1/M:3/E:0)  CRCMessage

----------------------------
Traceback (most recent call last):
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\Scripts\frida.exe\__main__.py", line 7, in <module>
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 1362, in main
    app.run()
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\application.py", line 398, in run
    self._reactor.run()
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\reactor.py", line 44, in run
    self._run_until_return(self)
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 435, in _process_input
    if not self._exec_and_print(self._evaluate_expression, expression):
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 463, in _exec_and_print
    (t, value) = self._perform_on_reactor_thread(lambda: exec(arg))
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\application.py", line 768, in _perform_on_reactor_thread
    raise error
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\application.py", line 752, in work
    result[0] = f()
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 463, in <lambda>
    (t, value) = self._perform_on_reactor_thread(lambda: exec(arg))
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 648, in _evaluate_expression
    return self._parse_evaluate_result(result)
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 661, in _parse_evaluate_result
    raise JavaScriptError(result[1])
  File "C:\Users\15592\AppData\Local\Programs\Python\Python310\lib\site-packages\frida_tools\repl.py", line 1195, in __init__
    super().__init__(error["message"])
KeyError: 'message'
axhlzy commented 1 year ago

这个问题是 frida-il2cpp-bridge 的bug,新版本的frida-il2cpp-bridge api 变动太多了,后续有空再更新一下

axhlzy commented 1 year ago

这个ts分支下的脚本用不了的时候你可以再去尝试一下master分支下的哪个老版本的

axhlzy commented 9 months ago

有新版本的il2cpp-frida-bridge不会出现这个问题