Class: CFrida::Child

Inherits:
GObject show all
Defined in:
ext/c_frida/Child.c

Instance Method Summary collapse

Methods inherited from GObject

#off, #on

Instance Method Details

#argvObject



98
99
100
101
# File 'ext/c_frida/Child.c', line 98

static VALUE Child_argv(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("argv")));
}

#envpObject



107
108
109
110
# File 'ext/c_frida/Child.c', line 107

static VALUE Child_envp(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("envp")));
}

#identifierObject



71
72
73
74
# File 'ext/c_frida/Child.c', line 71

static VALUE Child_identifier(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("identifier")));
}

#inspectObject Also known as: to_s



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'ext/c_frida/Child.c', line 24

static VALUE Child_inspect(VALUE self)
{
    GET_GOBJECT_DATA();

    VALUE s;
    FridaChildOrigin origin;
    GString *inspect_s;

    inspect_s = g_string_new("#<Child: ");
    g_string_append(inspect_s, "pid=%+"PRIsVALUE", parent_pid=%+"PRIsVALUE);
    g_string_append(inspect_s, ", origin=%+"PRIsVALUE", identifier=%+"PRIsVALUE);

    if (d->handle)
        origin = frida_child_get_origin(d->handle);
    else
        origin = FRIDA_CHILD_ORIGIN_FORK;
    if (origin != FRIDA_CHILD_ORIGIN_FORK) {
        g_string_append(inspect_s, ", path=%+"PRIsVALUE", argv=%+"PRIsVALUE", envp=%+"PRIsVALUE);
        g_string_append(inspect_s, ">");
        s = rb_sprintf(inspect_s->str, \
                       rb_funcall(self, rb_intern("pid"), 0, NULL),  rb_funcall(self, rb_intern("parent_pid"), 0, NULL), \
                       rb_funcall(self, rb_intern("origin"), 0, NULL),  rb_funcall(self, rb_intern("identifier"), 0, NULL), \
                       rb_funcall(self, rb_intern("path"), 0, NULL),  rb_funcall(self, rb_intern("argv"), 0, NULL), \
                       rb_funcall(self, rb_intern("envp"), 0, NULL));
    } else {
        g_string_append(inspect_s, ">");
        s = rb_sprintf(inspect_s->str, \
                       rb_funcall(self, rb_intern("pid"), 0, NULL),  rb_funcall(self, rb_intern("parent_pid"), 0, NULL), \
                       rb_funcall(self, rb_intern("origin"), 0, NULL),  rb_funcall(self, rb_intern("identifier"), 0, NULL));
    }
    g_string_free(inspect_s, TRUE);
    return (s);
}

#originObject



116
117
118
119
# File 'ext/c_frida/Child.c', line 116

static VALUE Child_origin(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("origin")));
}

#parent_pidObject



80
81
82
83
# File 'ext/c_frida/Child.c', line 80

static VALUE Child_parent_pid(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("parent_pid")));
}

#pathObject



89
90
91
92
# File 'ext/c_frida/Child.c', line 89

static VALUE Child_path(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("path")));
}

#pidObject



62
63
64
65
# File 'ext/c_frida/Child.c', line 62

static VALUE Child_pid(VALUE self)
{
    return (rb_ivar_get(self, rb_intern("pid")));
}