rizinorg / rz-pipe

Access rizin via pipe from any programming language!
33 stars 11 forks source link

need rz-pipe for nodejs #41

Open weituotian opened 1 year ago

weituotian commented 1 year ago

jsdec is using javascript too.

wargio commented 1 year ago

jsdec is using duktape, which is another js engine.

weituotian commented 1 year ago

may be these codes:

const spawn = require('child_process').spawn;

let rizinExe = 'C:\\myprogram\\cutter.Windows\\rizin.exe';
const py = spawn(rizinExe,
    [
        '-p',
        'L:\\backup\\apk\\momo\\libmahoshojo.fix.so.rzdb',
        '-q0',
    ],
    {
        // detached: true
    });

py.stdout.on('data', function (res) {
    res = res.toString('utf8');
    console.log(res)
})
py.stderr.on('data', function (data) {
    console.log('standard error output:\n' + data);
});

py.stdin.write('e asm.arch\n', () => {
    console.log('write end');
});

output:

"C:\Program Files\nodejs\node.exe" K:\projects\nodejs\jstillery\x86\testCmdRizin.js
write end

arm