UNPKG

r2papi

Version:

r2api on top of r2pipe for typescript and js

26 lines (25 loc) 634 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.R2Frida = void 0; class R2Frida { constructor(r2) { this.r2 = r2; this.isAvailable = false; } checkAvailability() { if (!this.isAvailable) { const output = r2.cmd("o~frida://"); if (output.trim() === "") { throw new Error("There's no frida session available"); } } this.isAvailable = true; } eval(expr) { return r2.cmd(`"": ${expr}`); } targetDetails() { return r2.cmdj(":ij"); } } exports.R2Frida = R2Frida;