-
Notifications
You must be signed in to change notification settings - Fork 48
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
unable to resolve: tls, crypto, zlib, bufferutil, utf-8-validate #65
Comments
Crypto definitely worked in version 10. This is one of the most disappointing updates I've seen. How did we go from a working project to one that barely works without scouring the closed issues section? It looks like 10 did something with browserify? to add node modules but has since dropped it so they just don't work. |
Sorry to hear that. The how is pretty simple: I ran out of time. So much blood, sweat and tears went into the rewrite that at some point I had to draw the line and consider it complete enough to get back to focusing on higher priority areas in Frida.
The new compiler only supports ESM, which means we couldn't use the existing Browserify shims without porting them. That's what I've done, but there are still a few missing. Perhaps you'd be interested in taking a stab at adding the ones you need for your particular project? PRs are super-appreciated. I am spread way too thin unfortunately. |
At this point I'm only missing crypto and could work around it but I'd be very interested in creating the new shims but I wouldn't be that sure how. I noticed for example the assert shim looks a lot like https://github.com/nodejs/node/blob/main/lib/assert.js but you've mentioned browserify shims which I'm not exactly sure about the specifics on. I'm still going to investigate but is there a brief high level explanation you could give regarding creating shims? EDIT: I've discovered the browserify shims at repos like https://github.com/browserify/crypto-browserify This should help me get started. I'm going to start with trying I'm doing lots of slow research into CJS vs ESM and converting some of these gross looking
But I think it's coming along well. |
Thanks! Basically what I've done is extract/port Node.js internals where the implementation seems reasonably untangled from their native code, and the Browserify shim when that isn't the case.
Note that Frida's Checksum API should be enough to cover e.g.
Sounds like a great plan!
Cool! The cjstoesm project might be helpful, at least as a starting point. |
So any solution for this? |
@kolanski you can try the esbuild way My project should be a PR to both frida cli and frida-compile but rn I don't have time... |
@Gavin0210 did you manage to compile ws? |
code
import WebSocket from 'ws';
command: frida-compile test_compile.js -o test.js
frida-compile version 16.1.8
following is package.json
{ "name": "test_frida_compile", "version": "1.0.0", "description": "", "main": "test.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "type": "module", "dependencies": { "ws": "^8.13.0" } }
The text was updated successfully, but these errors were encountered: