Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am oleavr on github.
  • I am oleavr (https://keybase.io/oleavr) on keybase.
  • I have a public key whose fingerprint is 4C04 3651 FBE7 3BE0 A755 1F4C EE8B 45E9 7675 076F

To claim this, I am signing this object:

@oleavr
oleavr / frida-core-1.0.vapi
Last active January 20, 2024 03:15
The frida-core API consumed by bindings like frida-python, frida-qml, etc.
[CCode (cheader_filename = "frida-core.h", cprefix = "Frida", lower_case_cprefix = "frida_")]
namespace Frida {
public static void init ();
public static void shutdown ();
public static void deinit ();
public static unowned GLib.MainContext get_main_context ();
public class DeviceManager : GLib.Object {
public DeviceManager ();
@oleavr
oleavr / frida-core-1.0.vapi
Created February 18, 2015 01:38
The frida-core VAPI consumed by bindings
[CCode (cheader_filename = "frida-core.h", cprefix = "Frida", lower_case_cprefix = "frida_")]
namespace Frida {
public static void init ();
public static void shutdown ();
public static void deinit ();
public static unowned GLib.MainContext get_main_context ();
public enum DeviceType {
LOCAL,
TETHER,
@oleavr
oleavr / frida-node-example.js
Last active August 20, 2021 14:42
Frida Node.js example
var frida = require('frida');
frida.attach('cat')
.then(function (session) {
console.log('attached:', session);
return session.createScript(
'function onMessage(message) {' +
'send({ name: "pong", payload: message });' +
'recv(onMessage);' +
'}' +
@oleavr
oleavr / qnx-probe-physical-memory.c
Last active February 12, 2024 15:17
How to probe the total amount of physical memory on QNX
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/syspage.h>
int
main(int argc, char *argv[])
{
struct asinfo_entry *entries = SYSPAGE_ENTRY(asinfo);
size_t count = SYSPAGE_ENTRY_SIZE(asinfo) / sizeof(struct asinfo_entry);
@oleavr
oleavr / gist:47d02312ea5676677a53
Created June 3, 2015 00:52
ObjC class creation API draft 1
const NSAutoreleasePool = ObjC.classes.NSAutoreleasePool;
const pool = NSAutoreleasePool.alloc().init();
const MyConnectionDelegateProxy = ObjC.registerClass({
name: 'MyConnectionDelegateProxy',
protocols: [ObjC.protocols.NSURLConnectionDelegate, ObjC.protocols.NSURLConnectionDataDelegate],
methods: {
'- connection:didReceiveResponse:': {
retType: 'void',
argTypes: ['object', 'object'],
implementation: function (connection, response) {
@oleavr
oleavr / gist:8c24293c53f9ea8c07bd
Created June 3, 2015 19:41
ObjC class creation API draft 2
const NSAutoreleasePool = ObjC.classes.NSAutoreleasePool;
const pool = NSAutoreleasePool.alloc().init();
const NSObject = ObjC.classes.NSObject;
const NSURLConnectionDataDelegate = ObjC.protocols.NSURLConnectionDataDelegate;
const MyConnectionDelegateProxy = ObjC.registerClass({
name: 'MyConnectionDelegateProxy',
parent: NSObject,
protocols: [NSURLConnectionDataDelegate],
overrides: {
@oleavr
oleavr / gist:dfd568c2fb3315f3a7fc
Last active August 29, 2015 14:22
ObjC class creation API draft 3
const NSObject = ObjC.classes.NSObject;
const NSURLConnectionDataDelegate = ObjC.protocols.NSURLConnectionDataDelegate;
const MyConnectionDelegateProxy = ObjC.registerClass({
name: 'MyConnectionDelegateProxy',
super: NSObject,
protocols: [NSURLConnectionDataDelegate],
methods: {
'- init': function () {
console.log('- init');
const self = this.super.init();
diff --git a/glib/Makefile.am b/glib/Makefile.am
index e022c30..8a1f942 100644
--- a/glib/Makefile.am
+++ b/glib/Makefile.am
@@ -209,6 +209,8 @@ libglib_2_0_la_SOURCES = \
gwakeup.c \
gprintf.c \
gprintfint.h \
+ frida-log.c \
+ frida-log.h \
@oleavr
oleavr / example.js
Last active June 9, 2016 23:19
Interceptor context example
'use strict';
Module.enumerateExports('libssl.so', {
onMatch(e) {
if (e.type === 'function')
Interceptor.attach(e.address, createHook(e.name, e.address));
},
onComplete() {
}
});