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

_agent.js NOT like a normal js file #24

Closed
0x79H opened this issue Jul 21, 2022 · 7 comments
Closed

_agent.js NOT like a normal js file #24

0x79H opened this issue Jul 21, 2022 · 7 comments

Comments

@0x79H
Copy link

0x79H commented Jul 21, 2022

Hi. I checkout the latest version (c709844). When i run npm run build (frida-compile agent/index.ts -o _agent.js -c) , the output file _agent.js include emoji, and it not like a normal js file. I also try npm run watch (frida-compile agent/index.ts -o _agent.js -w)

I try to find the reason. I found this at frida-compile , and understand the output is normal.

But i don't know why _agnet.js work in frida. Maybe it only work in Frida? Or new features of the js engine? Any helpful info?

I also try to find the parameters in frida-compile where I could get a normal javascript output file, but nothing there. What i miss?

Thanks.

@oleavr
Copy link
Owner

oleavr commented Jul 21, 2022

Hi,

The new frida-compile outputs a Frida-specific container format for multiple ESMs in a single .js, and that's what you're seeing.

Check out the new frida-tools -- there is now a frida-compile tool there and the REPL supports loading .ts files through -l.

Cheers!

@ghost
Copy link

ghost commented Aug 5, 2022

Hi,

The new frida-compile outputs a Frida-specific container format for multiple ESMs in a single .js, and that's what you're seeing.

Check out the new frida-tools -- there is now a frida-compile tool there and the REPL supports loading .ts files through -l.

Cheers!

Can I use .ts files from a .py script similar to loading .js scripts?

@ChiChou
Copy link

ChiChou commented Aug 7, 2022

Hi,
The new frida-compile outputs a Frida-specific container format for multiple ESMs in a single .js, and that's what you're seeing.
Check out the new frida-tools -- there is now a frida-compile tool there and the REPL supports loading .ts files through -l.
Cheers!

Can I use .ts files from a .py script similar to loading .js scripts?

I have the same issue here

@andreafioraldi
Copy link

Hi,
The new frida-compile outputs a Frida-specific container format for multiple ESMs in a single .js, and that's what you're seeing.
Check out the new frida-tools -- there is now a frida-compile tool there and the REPL supports loading .ts files through -l.
Cheers!

Can I use .ts files from a .py script similar to loading .js scripts?

I have the same issue here

+1

@ChiChou
Copy link

ChiChou commented Aug 18, 2022

@andreafioraldi the problem is the line break on Windows. Mine solved by suppplying newline='\n' to open, then the rest remains the same

with (filename).open('r', encoding='utf8', newline='\n') as fp:
        return fp.read()

@qiaozhi-4
Copy link

你好请问有解决吗

@muniategui
Copy link

muniategui commented Aug 17, 2024

你好请问有解决吗

Dude, you are writing just under the answer.
If you are in windows open('r', encoding='utf8', newline='\n') the utf8 and \n has to be set.
#24 (comment)

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

6 participants