- Fix configure-plugins ([a-Z] -> [A-Z])
* Bindings
  - Make perl r_bin test work
  - In lua r_bin test open "/bin/ls" by default if
    arg[1] is not given
This commit is contained in:
Nibble 2010-03-05 02:03:54 +01:00
parent f9675b000c
commit 974e9707c6
3 changed files with 11 additions and 6 deletions

View File

@ -48,7 +48,7 @@ generate_configh () {
if [ ! "$oldlib" = "$lib" ]; then
[ -n "$oldlib" ] && echo " 0"
oldlib=$lib
uclib=$(echo $lib | tr '[a-z]' '[a-Z]')
uclib=$(echo $lib | tr '[a-z]' '[A-Z]')
echo
echo "#define R_${uclib}_STATIC_PLUGINS \\"
plugins="${plugins} __${uclib}"

View File

@ -1,7 +1,9 @@
-- RBin --
require "r_bin"
file = arg[1] or "/bin/ls"
b = r_bin.RBin ()
b:load ("/bin/ls", "")
b:load (file, "")
baddr = b:get_baddr ()
s = b:get_sections ()
nsects = s:size() - 1

View File

@ -1,11 +1,14 @@
use r2::r_bin;
$file = ($ARGV[0] ne "")?$ARGV[0]:"/bin/ls";
$b = r_bin::RBin->new ();
$b->load ("/bin/ls", undef);
$b->load ($file, undef);
$baddr = $b->get_baddr ();
printf ("baddr=0x%08x\n", $baddr);
$sects = $b->get_sections ();
print "-> Sections\n";
for $i (b->get_sections ()) {
for ($i = 0; $i < $sects->size (); $i++) {
$s = $sects->get ($i);
printf ("offset=0x%08x va=0x%08x size=%05i %s\n",
$i{"offset"}, baddr+$i{"rva"}, $i{"size"}, $i{"name"});
$s->{offset}, $baddr + $s->{rva}, $s->{size}, $s->{name});
}