radareorg / radare2-bindings

Bindings of the r2 api for Valabind and friends
GNU Lesser General Public License v3.0
132 stars 92 forks source link

Cannot start a few examples for Nodejs bindings #88

Open dukebarman opened 9 years ago

dukebarman commented 9 years ago
# node r2irc.js 
 [=>] Initializing r2 core... 
/home/radare/bindings/radare2-bindings/node-ffi/node_modules/ffi/lib/_foreign_function.js:36
      throw new TypeError('Expected ' + numArgs +
            ^
TypeError: Expected 7 arguments, got 3
    at ForeignFunction.proxy (/home/radare/bindings/radare2-bindings/node-ffi/node_modules/ffi/lib/_foreign_function.js:36:13)
    at StructType.load (/home/radare/bindings/radare2-bindings/node-ffi/r_core.js:141:13)
    at Object.<anonymous> (/home/radare/bindings/radare2-bindings/node-ffi/examples/r2irc.js:59:10)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
# node bin.js 
/home/radare/bindings/radare2-bindings/node-ffi/node_modules/ffi/lib/_foreign_function.js:36
      throw new TypeError('Expected ' + numArgs +
            ^
TypeError: Expected 7 arguments, got 5
    at ForeignFunction.proxy (/home/radare/bindings/radare2-bindings/node-ffi/node_modules/ffi/lib/_foreign_function.js:36:13)
    at StructType.load (/home/radare/bindings/radare2-bindings/node-ffi/r_bin.js:141:13)
    at Object.<anonymous> (/home/radare/bindings/radare2-bindings/node-ffi/examples/bin.js:4:7)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Other examples are normally start.

jpenalbae commented 9 years ago

node.js ffi bindings are broken since long time ago...

Please try with r2pipe: https://www.npmjs.com/package/r2pipe https://github.com/radare/radare2-bindings/tree/master/r2pipe/nodejs

@XVilka We should probably kill the node-ffi bindings or at least make a note on the README.md about being disconnected in favor of r2pipe

radare commented 9 years ago

Let's assign this task for 1.0, we have time to upgrade the valabind generator for latest node-ffi