about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xexample/disas_and_graph.py13
-rw-r--r--miasm/core/parse_ad.py3
2 files changed, 5 insertions, 11 deletions
diff --git a/example/disas_and_graph.py b/example/disas_and_graph.py
index 6f505df3..268af176 100755
--- a/example/disas_and_graph.py
+++ b/example/disas_and_graph.py
@@ -20,13 +20,7 @@ except ImportError:
 import pickle
 import sys
 
-
-
-
-print sys.argv
-
-
-parser = OptionParser()
+parser = OptionParser(usage = "usage: %prog [options] file")
 parser.add_option('-a', "--address", dest="address", metavar="ADDRESS",
                   help="address to disasemble")
 parser.add_option('-m', "--architecture", dest="machine",metavar="MACHINE",
@@ -39,8 +33,9 @@ parser.add_option('-r', "--rawfile", dest="rawfile", action="store_true",
                   help="dont use PE/ELF/CLASS autodetect, disasm raw file")
 
 (options, args) = parser.parse_args(sys.argv[1:])
-print options, args
-
+if not args:
+    parser.print_help()
+    sys.exit(0)
 fname = args[0]
 ad_to_dis = options.address
 
diff --git a/miasm/core/parse_ad.py b/miasm/core/parse_ad.py
index acffa650..90cfc0d1 100644
--- a/miasm/core/parse_ad.py
+++ b/miasm/core/parse_ad.py
@@ -83,7 +83,7 @@ keywords = ("BYTE", "WORD", "DWORD", "SINGLE", "DOUBLE",
 
 tokens = keywords +(
     'NUMBER',
-    'PLUS','MINUS','TIMES','DIVIDE','EQUALS',
+    'PLUS','MINUS','TIMES','DIVIDE',
     'LPAREN','RPAREN','LBRA','RBRA', 'COLON',
     'OFFSET','NAME', 
     )
@@ -94,7 +94,6 @@ t_PLUS    = r'\+'
 t_MINUS   = r'-'
 t_TIMES   = r'\*'
 t_DIVIDE  = r'/'
-t_EQUALS  = r'='
 t_LPAREN  = r'\('
 t_RPAREN  = r'\)'
 t_LBRA  = r'\['