jjdredd / ljd

LuaJIT raw-bytecode decompiler
MIT License
10 stars 7 forks source link

decompilation errors #5

Open KITT3000 opened 9 years ago

KITT3000 commented 9 years ago

I use ljd-v2.1, decompile several files and work, but at one (so far) appeared such errors. I tried with the other branches, but they did not decompiles files (even those without errors at this decompiles).

 kamil@AsusK53SV ~/ljd-ljv2.1 $ python3 main.py Fillable.luc
 Traceback (most recent call last):
  File "main.py", line 123, in <module>
    retval = main()
  File "main.py", line 104, in main
    ljd.ast.unwarper.unwarp(ast)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 36, in unwarp
    _run_step(_unwarp_ifs, node)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 43, in _run_step
    statements.contents = step(statements.contents, **kargs)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 161, in _unwarp_ifs
    _unwarp_if_statement(start, body, end, end)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 937, in _unwarp_if_statement
    topmost_end)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 1028, in _extract_if_expression
    expression = _compile_expression(expression, None, true, false)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 504, in _compile_expression
    parts = _unwarp_expression(body, end, true, false)
  File "/home/kamil/ljd-ljv2.1/ljd/ast/unwarper.py", line 622, in _unwarp_expressio000n
    assert target in terminators
 AssertionError
jjdredd commented 9 years ago

Sorry, the control-flow analysis still fails sometimes. I will concentrate on data-flow analysis first. This will take much time. It's possible that I'll have to rewrite it in C++ with a slightly different algo.