hooklinker.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import {HookImpl} from "./HookImpl";
  2. export let hooklinker = {
  3. start: function () {
  4. // linker64 arm64
  5. if (Process.pointerSize === 8) {
  6. let module = Process.findModuleByName("linker64");
  7. Interceptor.attach(module.base.add(0xb5b48), {
  8. onEnter: function (args) {
  9. var path = args[3].readCString();
  10. console.log("path " + path);
  11. if (path.includes("libil2cpp.so")) {
  12. HookImpl.start();
  13. }
  14. }
  15. })
  16. } else {
  17. //linker
  18. }
  19. },
  20. startByOpen: function () {
  21. let open = Module.findExportByName(null, "open");
  22. if (open != null) {
  23. Interceptor.attach(open, {
  24. onEnter: function (args) {
  25. let path = args[0].readCString();
  26. if (path.includes("libil2cpp.so")) {
  27. this.hook = true;
  28. }
  29. },
  30. onLeave: function (ret) {
  31. if (this.hook) {
  32. HookImpl.start();
  33. }
  34. }
  35. })
  36. }
  37. }
  38. }