Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rebuilding frida bindings #71

Open
jeanbmar opened this issue Feb 12, 2022 · 5 comments
Open

Rebuilding frida bindings #71

jeanbmar opened this issue Feb 12, 2022 · 5 comments

Comments

@jeanbmar
Copy link

jeanbmar commented Feb 12, 2022

@oleavr I've developed a one-liner to get the proper binaries since it could be a bit tedious to manually find the frida dependency, delete it and set the environment variables:

https://www.npmjs.com/package/frida-rebuild

Usage: npx frida-rebuild --runtime=electron --target=16.0.0

It will locate frida automatically and climb the directories if used in a workspace / monorepo.
Creating an issue so future users can find it from Google :).

@moweixuanshou
Copy link

Thank you very much for your help, but frida-Rebuild does not seem to work for the Nodev16 version of Electron

@jeanbmar
Copy link
Author

It should work, I did use it, e.g. https://github.com/jeanbmar/black-moon-rewind/blob/master/packages/launcher/package.json
What's your error message?

@moweixuanshou
Copy link

Thank you very much for your reply. When I try to install frida for electronV17.1.0, I run the npx frida-rebuild -- Runtime =electron --target=17.1.0 command to build, and the following error occurs

> prebuild-install || node-gyp rebuild

prebuild-install WARN install read ECONNRESET
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | x64
gyp info find Python using Python version 3.10.2 found at "C:\Python310\python.exe"
gyp info find VS using VS2022 (17.1.32210.238) found at:
gyp info find VS "D:\Program Files\Microsoft Visual Studio\2022\Community"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python310\python.exe
gyp info spawn args [
gyp info spawn args   'D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\lxl\\WebstormProjects\\electrondemo\\node_modules\\frida\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\lxl\\AppData\\Local\\node-gyp\\Cache\\17.1.0\\include\\node\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\lxl\\AppData\\Local\\node-gyp\\Cache\\17.1.0',
gyp info spawn args   '-Dnode_gyp_dir=D:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\lxl\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.1.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\lxl\\WebstormProjects\\electrondemo\\node_modules\\frida',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'C:\\Users\\lxl\\WebstormProjects\\electrondemo\\node_modules\\frida\\build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
    at file:///C:/Users/lxl/WebstormProjects/electrondemo/node_modules/frida-rebuild/lib/index.js:21:5
    at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
    at async Promise.all (index 0)
    at async ESMLoader.import (node:internal/modules/esm/loader:337:24)
    at async loadESM (node:internal/process/esm_loader:88:5)
    at async handleMainPromise (node:internal/modules/run_main:61:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 20164,
  stdout: null,
  stderr: null
}

@jeanbmar
Copy link
Author

Unfortunately I'm not sure Frida binaries for electron 17 are available yet

@moweixuanshou
Copy link

Thank you very much for your reply. I have tried the version of electron 16 and it can run normally. Thank you very much for helping me solve my most trouble this week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants