|
| 1 | +var r2 = require('../r_bin') |
| 2 | + |
| 3 | +var b = new r2.RBin() |
| 4 | +b.load(process.argv[2] || '/bin/ls', false); |
| 5 | + |
| 6 | +console.log('Base address:', b.get_baddr().toString(16)); |
| 7 | +console.log('Sections:'); |
| 8 | +b.get_sections().forEach(function(x) { |
| 9 | + console.log(' %s: size=%d vsize=%d rva=%d offset=%s srwx=%s', |
| 10 | + x.name, x.size, x.vsize, x.rva, |
| 11 | + x.offset.toString(16), x.srwx.toString(16)); |
| 12 | + }); |
| 13 | +console.log('Symbols:'); |
| 14 | +b.get_symbols().forEach (function(x) { |
| 15 | + console.log (' %s: fw=%s bind=%s type=%s rva=%d offset=%s size=%d ordinal=%d', |
| 16 | + x.name, x.forwarder, x.bind, x.type, x.rva, |
| 17 | + x.offset.toString(16), x.size, x.ordinal); |
| 18 | + }); |
| 19 | +console.log('Imports:'); |
| 20 | +b.get_imports().forEach(function(x) { |
| 21 | + console.log(' %s: bind=%s type=%s rva=%d offset=%s ordinal=%d hint=%d', |
| 22 | + x.name, x.bind, x.type, x.rva, |
| 23 | + x.offset.toString(16), x.ordinal, x.hint); |
| 24 | + }); |
| 25 | +console.log('Strings:'); |
| 26 | +b.get_strings().forEach(function(x) { |
| 27 | + console.log(' %s rva=%d offset=%s ordinal=%d size=%d', |
| 28 | + JSON.stringify(x.string), x.rva, |
| 29 | + x.offset.toString(16), x.ordinal, x.size); |
| 30 | + }); |
0 commit comments