EiNSTeiN- / decompiler

A decompiler with multiple backend support, written in Python. Works with IDA and Capstone.
526 stars 103 forks source link

"ir-parser" disasm error #8

Closed pfalcon closed 9 years ago

pfalcon commented 9 years ago

I'm trying to run tests/common/ply/ir_parser.py (for sample code it contains). I get:

$ PYTHONPATH=../../../src python ir_parser.py
Traceback (most recent call last):
  File "ir_parser.py", line 271, in <module>
    print parse(text)
  File "ir_parser.py", line 256, in parse
    return parser.parse(text, lexer=ir_lexer.lexer)
  File "/usr/lib/python2.7/dist-packages/ply/yacc.py", line 269, in parse
    return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
  File "/usr/lib/python2.7/dist-packages/ply/yacc.py", line 1051, in parseopt_notrack
    tok = self.errorfunc(errtoken)
  File "ir_parser.py", line 233, in p_error
    raise RuntimeError("Syntax error in input: %s" % (repr(p), ))
RuntimeError: Syntax error in input: LexToken(:,':',2,8)

Is there more info about this disassembler/syntax?

EiNSTeiN- commented 9 years ago

From the looks of that error, at some point I removed the support for named labels so loc_1: should just read 1:. You can see examples of the syntax in tests, for instance: https://github.com/EiNSTeiN-/decompiler/blob/master/tests/unit/test_ssa.py

pfalcon commented 9 years ago

That's the conclusion I came to a second ago too ;-). So, with #9 in mind, I may suggest re-adding it, otherwise, fixing ir_parser.py would work too ;-).

EiNSTeiN- commented 9 years ago

Fixed by 825e9968418457db1d4b31ee30c0db293bdaa91e