lekpooh / unpyc

Automatically exported from code.google.com/p/unpyc
0 stars 0 forks source link

Syntax error at or near `SETUP_LOOP' token at offset 16 #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I use :
BACKTRACK 2 LINUX.
PYTHON 2.5\2.4.
UNPYC R24.  

scripts-2.5 # python2.5 unpyc -o /root -c  downloader.pyc

unpyc.Walker.ParserError: --- This code section failed: ---
0       LOAD_FAST         'self'
3       LOAD_ATTR         'decoder'
6       LOAD_ATTR         'start'
9       CALL_FUNCTION_0   ''
12      POP_TOP           ''
13      SETUP_LOOP        '1988'
16      SETUP_LOOP        '545'
19      LOAD_FAST         'self'
22      LOAD_ATTR         'servers'
25      GET_ITER          ''
26      FOR_ITER          '544'
29      STORE_FAST        'server'
32      SETUP_LOOP        '105'
35      LOAD_FAST         'server'
38      LOAD_ATTR         'busy_threads'
41      SLICE+0           ''
42      GET_ITER          ''
....
1980    POP_TOP           ''
1981_0  COME_FROM         ''
1981    JUMP_ABSOLUTE     '1193'
1984_0  COME_FROM         ''
1984    POP_BLOCK         ''
1985_0  COME_FROM         ''
1985    JUMP_ABSOLUTE     '16'
1988_0  COME_FROM         ''
1988    LOAD_CONST        ''
1991    RETURN_VALUE      ''

Syntax error at or near `SETUP_LOOP' token at offset 16.

The file I'm trying to decompile is from SABNZBD+ 0.4.6.  I modified
downloader.py late 2008 and I accidentally lost it after I compiled it.  I
include a unmodified downloader.py and my compiled\modified downloader.pyo.

Please fix this as soon as possible!

I ATTECHED FILES!!!!!!!!!!1
DOWNLOAD THEM TO HELP ME!!

I include a unmodified downloader.py and my compiled\modified downloader.pyo.

Original issue reported on code.google.com by semibloc...@gmail.com on 17 Jun 2009 at 5:42

Attachments:

GoogleCodeExporter commented 9 years ago
To semiblocked:

Hello, see you again,haha.

I have fix this problem,but another problem occured. 

To fix this problem,you can add the following grammer in p_grammer function in 
Parser.py:
whilestmt ::= SETUP_LOOP 
stmts JUMP_IF_FALSE POP_TOP
stmts_opt JUMP_ABSOLUTE COME_FROM

The reason is :
for a while loop, while 1 : is a loop that never stopped if no break, so python
compiler optimized this as 'SETUP_LOOP <then some other statements>', but there 
is
none corresponding grammer to handle this in current unpyc.

If you fix this problem ,please let me know. And hope you can fix the left other
problems and tell how do you fix them.

We can talk more about python in future.

Original comment by higerinb...@gmail.com on 17 Jun 2009 at 1:49