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

Add support for encoded mode #508

Closed
wants to merge 1 commit into from

Conversation

WorksButNotTested
Copy link
Contributor

Support sending base64 between the TTY and the script to prevent extended ascii sequences getting converted into multibyte UTF-8 characters.

* If we are in encoded mode, then send our data to
* the target in base64 encoded form.
*/
script_runner.on_stdin (Base64.encode (buf[:n]));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to encode it, post() has a data argument which supports binary data. It's passed to the message handler in the second argument. But we should improve the RPC API (built on top of send() + recv()) so it supports binary data in parameters and not only in the return value. The GumJS implementation can be found here. We could basically use a special marker, like ['frida:oob', offset, size], which specifies the offset into the data argument, and the size of the region.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I had the same problem on output. Sending ansi control codes to the stdout. Is it possible for frida core to work as a dumb byte pump rather than dealing with strings?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's only a matter of returning an ArrayBuffer instead of a string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can binary data only be sent/received by post and it's return value? Is there an ability to make an RPC to send bytes during the handling of the post? Or so they all have to be collated and sent by return?

@WorksButNotTested
Copy link
Contributor Author

Superseded by #525

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

Successfully merging this pull request may close these issues.

None yet

2 participants