File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,5 +34,5 @@ If you have golang environment setup:
3434
3535Or, just download the binary:
3636
37- $ wget https://github.com/namhyung/das/releases/download/v0.1 /das-linux-amd64
37+ $ wget https://github.com/namhyung/das/releases/download/v0.2 /das-linux-amd64
3838 $ sudo install -D das-linux-amd64 /usr/local/bin/das
Original file line number Diff line number Diff line change @@ -17,6 +17,10 @@ import (
1717 str "strings"
1818)
1919
20+ const (
21+ DasVersion string = "v0.2"
22+ )
23+
2024const (
2125 OPTYPE_OTHER = iota
2226 OPTYPE_BRANCH
@@ -65,13 +69,19 @@ var (
6569 csect * DasFunc // current section
6670 strs map [uint64 ]string // string table
6771 lastOffset uint64 // last code offset
68- capstone bool
69- objdump string
72+ )
73+
74+ var (
75+ // command line options
76+ capstone bool
77+ objdump string
78+ version bool
7079)
7180
7281func init () {
7382 flag .BoolVar (& capstone , "c" , false , "Use capstone disassembler" )
7483 flag .StringVar (& objdump , "d" , "objdump" , "Path to objdump tool" )
84+ flag .BoolVar (& version , "v" , false , "Show version number" )
7585}
7686
7787func initDasParser (target string ) * DasParser {
@@ -105,6 +115,12 @@ func main() {
105115 flag .Parse ()
106116
107117 args := flag .Args ()
118+
119+ if version {
120+ fmt .Printf ("das (TUI disassembler): %s\n " , DasVersion )
121+ return
122+ }
123+
108124 if len (args ) < 1 {
109125 log .Fatal ("Usage: das <binary>" )
110126 }
You can’t perform that action at this time.
0 commit comments