8000 Add console.log on client side · Issue #8 · frida/frida-gum · GitHub
[go: up one dir, main page]

Skip to content

Add console.log on client side #8

Closed

Description

@radare

Without having to implicitly pass messages, this is important because most of the time you will not have access to the console of the target app.

as a workaround:

import frida
import sys

pid = int(sys.argv[1])
function_address = int(sys.argv[2], 16)

process = frida.attach(pid)
script = process.session.create_script("""
        function print(x) {
                send({type:"msg",msg:x});
        }
        print ("Hello World");
        """ % function_address)

def on_message(message, data):
        payload = message['payload']
        try:
                type = payload['type']
                if type == 'msg':
                        print payload['msg']
        except:
                print(message)
                pass

script.on('message', on_message)
script.load()

Activity

  1. oleavr commented on Feb 18, 2015

    @oleavr
    Member

    Very good point. On the "client" side (python in this case) the message.type field is send whenever send() was used, and error in case of an unhandled exception. Perhaps a third type could be added, and bindings are expected to handle that one explicitly?

  2. radare commented on Feb 19, 2015

    @radare
    Author

    that would be a good way to do that imho. usually "print" is just for showing some notes to help the user, if you want something more complex you can implement more machinery in the client side to handle other kind of messages

  3. oleavr commented on Feb 19, 2015

    @oleavr
    Member

    Agreed. So then either we change console.log() to send this message, or introduce print() in the global scope. I would argue the former is rather useless as it is now.

  4. oleavr commented on Feb 28, 2015

    @oleavr
    Member

    Implemented by 5b1d82c, and now also supported by frida/frida-python@59107ba and frida/frida-qml@d6b2c46.

  5. radare commented on Mar 1, 2015

    @radare
    Author

    Cool! Thanks

    On 28 Feb 2015, at 23:28, Ole André Vadla Ravnås notifications@github.com wrote:

    Closed #8.

    —
    Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0