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

Invalid tokens #60

Open
wenq1 opened this issue Jan 29, 2023 · 5 comments
Open

Invalid tokens #60

wenq1 opened this issue Jan 29, 2023 · 5 comments

Comments

@wenq1
Copy link

wenq1 commented Jan 29, 2023

Just out of curiosity, why are the invalid tokens in the generated output?

in frida-agent-example,

$ npx frida-compile agent/index.ts -o _agent.js -c

image

This doen's look valid javascript by the way..., that is to say,

% node _agent.js 
/Users/wc/scratch/frida-tools/frida-agent-example/_agent.js:1
📦
^

SyntaxError: Invalid or unexpected token
    at Object.compileFunction (node:vm:352:18)

@oleavr
Copy link
Member

oleavr commented Jan 29, 2023

The output is not JavaScript, it's a simple container format (Frida-specific) for a bundle of ES Modules. It's in a human-readable text-encoding though to make it easy to inspect.

@wenq1
Copy link
Author

wenq1 commented Jan 31, 2023

I see. thanks. Anyway to turn it off so that I can generate a quick bundled agent.js for injection?

@re100io
Copy link

re100io commented Oct 18, 2023

I met the same problem too and it still bothers me too, is it because version of node of python? I tried but not work...

@NKU100
Copy link

NKU100 commented Dec 3, 2023

How did this problem finally be solved? I also want to generate a JS file that can be run directly.

@Syth-1
Copy link

Syth-1 commented Apr 12, 2024

i was running into issues with this when using evaluate with objection, using bun (or any bundler for that matter) pointing towards your entry script (index.ts) fixed this!

for bun the command used:
bun build ./agent/index.ts --outdir ./

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

5 participants