File: test-r_bin.go

package info (click to toggle)
radare2 0.9.6-3.1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 17,496 kB
  • ctags: 45,959
  • sloc: ansic: 240,999; sh: 3,645; makefile: 2,520; python: 1,212; asm: 312; ruby: 214; awk: 209; perl: 188; lisp: 169; java: 23; xml: 17; php: 6
file content (23 lines) | stat: -rw-r--r-- 452 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"os"
	"fmt"
	"r_bin"
)

func main() {
	if len (os.Args) < 2 {
		fmt.Println ("Usage:", os.Args[0], "<bin>")
		os.Exit (1)
	}
	b := r_bin.NewRBin ()
	b.Load (os.Args[1], false)
	baddr := b.Get_baddr ()
	fmt.Println ("-> Sections")
	fmt.Printf ("baddr=%08x\n", baddr)
	for _, s:= range b.Get_sections () {
		fmt.Printf ("offset=0x%08x va=0x%08x size=%05d %s\n",
				s.GetOffset(), baddr+s.GetRva(), s.GetSize(), s.GetName())
	}
}