hlsg3.py 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # -*- coding:utf-8 -*-
  2. import sys
  3. __author__ = 'Snow'
  4. import frida
  5. dev = frida.get_remote_device()
  6. session = dev.attach("胡莱三国3")
  7. src = """
  8. setImmediate(function(){
  9. Java.perform(function(){
  10. send("starting script");
  11. var CPGameAuthCodeApi = Java.use("com.yulong.game.api.CPGameAuthCodeApi");
  12. CPGameAuthCodeApi.createGameApi.implementation = function(activity,appid){
  13. send("appid:"+appid);
  14. send("activity:"+activity);
  15. return CPGameAuthCodeApi.createGameApi(activity,appid);
  16. }
  17. var COOLPAD12ChannelInterfaceImpl = Java.use("com.hoolai.open.fastaccess.channel.impl.coolpad12.COOLPAD12ChannelInterfaceImpl");
  18. COOLPAD12ChannelInterfaceImpl.onCreate.implementation = function(context){
  19. send("onCreate invoked"+context);
  20. this.onCreate(context);
  21. }
  22. COOLPAD12ChannelInterfaceImpl.applicationInit.implementation = function(context){
  23. send("onCreate invoked"+context);
  24. this.applicationInit(context);
  25. }
  26. });
  27. });
  28. """
  29. def on_message(message,data):
  30. print("[-] {}".format(message))
  31. script = session.create_script(src)
  32. script.on("message", on_message)
  33. script.load()
  34. sys.stdin.read()