Anonymous avatar Anonymous committed 656a26d

renamed ExeFile to DeclipParser
corrected 'KEYBOARD' opcode

Comments (0)

Files changed (4)

   def __str__(self):
     return repr(self.value)
 
-class ExeFile:
+class DeclipParser:
   '''class representing structure of clipper-compiled exe-file'''
   def __init__(self, fname, linker):
     ''' linker can be 'p' for plink86 or 'b' for blinker'''
     cnt = ord(self.fp.read(1))
     exestr = self.fp.read(cnt)
     return cnt, exestr
+
+  def buildGraph(self):
+    pass
         
 ########################################################################
 def isprint(ch):
         result += "\n"
   return result
 
-########################################################################
 def quoteString(val):
   '''put a string into quotes'''
   if type(val) == type(""):
     format = " '%s' : %3s,"
   return val, format
 
+########################################################################
+
 def main():
   '''write some info when called directly as an executable'''
   print
 '''Stdout frontend for declip library'''
 __revision__ = '$Rev: 78 $'
 
-from declip import ExeFile, dumpHex, quoteString
+from declip import DeclipParser, dumpHex, quoteString
 from parameters import Parameters
 import sys, re
 import pcodedata
 
 def formatD(params, startpos, bytecount, format):
   '''handle declip and disass formats'''
-  inputfile = ExeFile(params.get("FileName"), params.get("Linker"))
+  inputfile = DeclipParser(params.get("FileName"), params.get("Linker"))
   
   if params.get("Header"):
     print "pcode at    : 0x%08x %12d" % (inputfile.pcode, inputfile.pcode)
     sys.exit(0)
 
   if params.get("ListSubprograms"):
-    inputfile = ExeFile(params.get("FileName"), params.get("Linker"))
+    inputfile = DeclipParser(params.get("FileName"), params.get("Linker"))
     # print "first symbol: [%s]" % inputfile.getSymbol(0)
     if not params.get("AltSortSubs"):
       print "Subprograms:"
 
   def InitExeFile(self, params):
     self.fname.SetValue(params.get("FileName"))
-    self.ex = declip.ExeFile(params.get("FileName"), params.get("Linker"))
+    self.ex = declip.DeclipParser(params.get("FileName"), params.get("Linker"))
     self.metadata.SetValue("")
     self.metadata.AppendText("pcode at: 0x%X %i\n" % (self.ex.pcode, self.ex.pcode ))
     self.metadata.AppendText("firstfun at: 0x%X %i\n" % (self.ex.firstfun, self.ex.firstfun))
    88 : (   'FC_JMPIFFALSE'   ,   'IF %s'              ,   'flowctrl' ,   0  ,     1,    -4, ),
    89 : (   'FC_JMP'          ,   '&& j(%s)'           ,   'flowctrl' ,   0  ,     0,    -4, ),
    90 : (   'FC_JMPIFTRUE'    ,   '&& jt(%s)'          ,   'flowctrl' ,   0  ,     1,    -4, ),
-   91 : (   'CM_KEYBOARD'     ,   ''                   ,   'command'  ,   ''   ,     1,     0, ),
+   91 : (   'CM_KEYBOARD'     ,   'KEYBOARD %s'        ,   'command'  ,   0  ,     1,     0, ),
    93 : (   'FN_LASTKEY'      ,   'LASTKEY()'          ,   'function' ,   1  ,     0,     0, ),
    94 : (   'FN_RECCOUNT'     ,   'RECCOUNT()'         ,   'function' ,   1  ,     0,     0, ),
    98 : (   'OP_LE'           ,   '( %s <= %s )'       ,   'operator' ,   1  ,     2,     0, ),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.