rocky / python-uncompyle6

A cross-version Python bytecode decompiler
GNU General Public License v3.0
3.79k stars 413 forks source link

Parse error at or near `POP_EXCEPT' instruction at offset 64 #335

Closed keyvanvafaee closed 3 years ago

keyvanvafaee commented 4 years ago

Instruction context:
->
 L.   7        46  POP_EXCEPT
                  48  LOAD_CONST               None
                  50  RETURN_VALUE
Instruction context:
->
 L.  13        46  POP_EXCEPT
                  48  LOAD_CONST               None
                  50  RETURN_VALUE
Instruction context:
->
 L.  19        46  POP_EXCEPT
                  48  LOAD_CONST               None
                  50  RETURN_VALUE
Instruction context:
->
 L.  25        46  POP_EXCEPT
                  48  LOAD_CONST               None
                  50  RETURN_VALUE
Instruction context:
->
 L.  30        20  POP_EXCEPT
                  22  LOAD_CONST               None
                  24  RETURN_VALUE
Instruction context:
->
 L.  36        20  POP_EXCEPT
                  22  LOAD_CONST               None
                  24  RETURN_VALUE
Instruction context:

 L.  49        92  POP_EXCEPT
->                94  LOAD_CONST               None
                  96  RETURN_VALUE
                  98  END_FINALLY
Instruction context:
->
 L.  65        64  POP_EXCEPT
                  66  LOAD_CONST               None
                  68  RETURN_VALUE
import base64, marshal, zlib

def a--- This code section failed: ---

 L.   3         0  SETUP_FINALLY        40  'to 40'

 L.   4         2  LOAD_FAST                'cod'
                4  LOAD_METHOD              decode
                6  CALL_METHOD_0         0  ''
                8  STORE_FAST               'cod'

 L.   5        10  LOAD_GLOBAL              base64
               12  LOAD_METHOD              b16decode
               14  LOAD_FAST                'cod'
               16  LOAD_METHOD              replace
               18  LOAD_GLOBAL              base64
               20  LOAD_METHOD              b16encode
               22  LOAD_CONST               b'xatvjhgfjvethjyklkkluyhoipl'
               24  CALL_METHOD_1         1  ''
               26  LOAD_METHOD              decode
               28  CALL_METHOD_0         0  ''
               30  LOAD_STR                 ''
               32  CALL_METHOD_2         2  ''
               34  CALL_METHOD_1         1  ''
               36  POP_BLOCK
               38  RETURN_VALUE
             40_0  COME_FROM_FINALLY     0  '0'

 L.   6        40  POP_TOP
               42  POP_TOP
               44  POP_TOP

 L.   7        46  POP_EXCEPT
               48  LOAD_CONST               None
               50  RETURN_VALUE
               52  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 46

def b--- This code section failed: ---

 L.   9         0  SETUP_FINALLY        40  'to 40'

 L.  10         2  LOAD_FAST                'cod'
                4  LOAD_METHOD              decode
                6  CALL_METHOD_0         0  ''
                8  STORE_FAST               'cod'

 L.  11        10  LOAD_GLOBAL              base64
               12  LOAD_METHOD              b32decode
               14  LOAD_FAST                'cod'
               16  LOAD_METHOD              replace
               18  LOAD_GLOBAL              base64
               20  LOAD_METHOD              b32encode
               22  LOAD_CONST               b'xatvjhgfjvethjyklkkluyhoipl'
               24  CALL_METHOD_1         1  ''
               26  LOAD_METHOD              decode
               28  CALL_METHOD_0         0  ''
               30  LOAD_STR                 ''
               32  CALL_METHOD_2         2  ''
               34  CALL_METHOD_1         1  ''
               36  POP_BLOCK
               38  RETURN_VALUE
             40_0  COME_FROM_FINALLY     0  '0'

 L.  12        40  POP_TOP
               42  POP_TOP
               44  POP_TOP

 L.  13        46  POP_EXCEPT
               48  LOAD_CONST               None
               50  RETURN_VALUE
               52  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 46

def c--- This code section failed: ---

 L.  15         0  SETUP_FINALLY        40  'to 40'

 L.  16         2  LOAD_FAST                'cod'
                4  LOAD_METHOD              decode
                6  CALL_METHOD_0         0  ''
                8  STORE_FAST               'cod'

 L.  17        10  LOAD_GLOBAL              base64
               12  LOAD_METHOD              b64decode
               14  LOAD_FAST                'cod'
               16  LOAD_METHOD              replace
               18  LOAD_GLOBAL              base64
               20  LOAD_METHOD              b64encode
               22  LOAD_CONST               b'xatvjhgfjvethjyklkkluyhoipl'
               24  CALL_METHOD_1         1  ''
               26  LOAD_METHOD              decode
               28  CALL_METHOD_0         0  ''
               30  LOAD_STR                 ''
               32  CALL_METHOD_2         2  ''
               34  CALL_METHOD_1         1  ''
               36  POP_BLOCK
               38  RETURN_VALUE
             40_0  COME_FROM_FINALLY     0  '0'

 L.  18        40  POP_TOP
               42  POP_TOP
               44  POP_TOP

 L.  19        46  POP_EXCEPT
               48  LOAD_CONST               None
               50  RETURN_VALUE
               52  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 46

def d--- This code section failed: ---

 L.  21         0  SETUP_FINALLY        40  'to 40'

 L.  22         2  LOAD_FAST                'cod'
                4  LOAD_METHOD              decode
                6  CALL_METHOD_0         0  ''
                8  STORE_FAST               'cod'

 L.  23        10  LOAD_GLOBAL              base64
               12  LOAD_METHOD              b85decode
               14  LOAD_FAST                'cod'
               16  LOAD_METHOD              replace
               18  LOAD_GLOBAL              base64
               20  LOAD_METHOD              b85encode
               22  LOAD_CONST               b'xatvjhgfjvethjyklkkluyhoipl'
               24  CALL_METHOD_1         1  ''
               26  LOAD_METHOD              decode
               28  CALL_METHOD_0         0  ''
               30  LOAD_STR                 ''
               32  CALL_METHOD_2         2  ''
               34  CALL_METHOD_1         1  ''
               36  POP_BLOCK
               38  RETURN_VALUE
             40_0  COME_FROM_FINALLY     0  '0'

 L.  24        40  POP_TOP
               42  POP_TOP
               44  POP_TOP

 L.  25        46  POP_EXCEPT
               48  LOAD_CONST               None
               50  RETURN_VALUE
               52  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 46

def e--- This code section failed: ---

 L.  27         0  SETUP_FINALLY        14  'to 14'

 L.  28         2  LOAD_GLOBAL              zlib
                4  LOAD_METHOD              decompress
                6  LOAD_FAST                'cod'
                8  CALL_METHOD_1         1  ''
               10  POP_BLOCK
               12  RETURN_VALUE
             14_0  COME_FROM_FINALLY     0  '0'

 L.  29        14  POP_TOP
               16  POP_TOP
               18  POP_TOP

 L.  30        20  POP_EXCEPT
               22  LOAD_CONST               None
               24  RETURN_VALUE
               26  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 20

def f--- This code section failed: ---

 L.  33         0  SETUP_FINALLY        14  'to 14'

 L.  34         2  LOAD_GLOBAL              marshal
                4  LOAD_METHOD              loads
                6  LOAD_FAST                'cod'
                8  CALL_METHOD_1         1  ''
               10  POP_BLOCK
               12  RETURN_VALUE
             14_0  COME_FROM_FINALLY     0  '0'

 L.  35        14  POP_TOP
               16  POP_TOP
               18  POP_TOP

 L.  36        20  POP_EXCEPT
               22  LOAD_CONST               None
               24  RETURN_VALUE
               26  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 20

def g--- This code section failed: ---

 L.  39         0  SETUP_FINALLY        86  'to 86'

 L.  40         2  LOAD_FAST                'mod'
                4  LOAD_CONST               16
                6  COMPARE_OP               ==
                8  POP_JUMP_IF_FALSE    22  'to 22'

 L.  41        10  LOAD_GLOBAL              base64
               12  LOAD_METHOD              b16decode
               14  LOAD_FAST                'dat'
               16  CALL_METHOD_1         1  ''
               18  POP_BLOCK
               20  RETURN_VALUE
             22_0  COME_FROM             8  '8'

 L.  42        22  LOAD_FAST                'mod'
               24  LOAD_CONST               32
               26  COMPARE_OP               ==
               28  POP_JUMP_IF_FALSE    42  'to 42'

 L.  43        30  LOAD_GLOBAL              base64
               32  LOAD_METHOD              b32decode
               34  LOAD_FAST                'dat'
               36  CALL_METHOD_1         1  ''
               38  POP_BLOCK
               40  RETURN_VALUE
             42_0  COME_FROM            28  '28'

 L.  44        42  LOAD_FAST                'mod'
               44  LOAD_CONST               64
               46  COMPARE_OP               ==
               48  POP_JUMP_IF_FALSE    62  'to 62'

 L.  45        50  LOAD_GLOBAL              base64
               52  LOAD_METHOD              b64decode
               54  LOAD_FAST                'dat'
               56  CALL_METHOD_1         1  ''
               58  POP_BLOCK
               60  RETURN_VALUE
             62_0  COME_FROM            48  '48'

 L.  46        62  LOAD_FAST                'mod'
               64  LOAD_CONST               85
               66  COMPARE_OP               ==
               68  POP_JUMP_IF_FALSE    82  'to 82'

 L.  47        70  LOAD_GLOBAL              base64
               72  LOAD_METHOD              b85decode
               74  LOAD_FAST                'dat'
               76  CALL_METHOD_1         1  ''
               78  POP_BLOCK
               80  RETURN_VALUE
             82_0  COME_FROM            68  '68'
               82  POP_BLOCK
               84  JUMP_FORWARD        100  'to 100'
             86_0  COME_FROM_FINALLY     0  '0'

 L.  48        86  POP_TOP
               88  POP_TOP
               90  POP_TOP

 L.  49        92  POP_EXCEPT
               94  LOAD_CONST               None
               96  RETURN_VALUE
               98  END_FINALLY
            100_0  COME_FROM            84  '84'

Parse error at or near `LOAD_CONST' instruction at offset 94

def h--- This code section failed: ---

 L.  51         0  SETUP_FINALLY        58  'to 58'

 L.  52         2  LOAD_STR                 '16323264856485'
                4  STORE_DEREF              'mod'

 L.  53         6  LOAD_CLOSURE             'mod'
                8  BUILD_TUPLE_1         1
               10  LOAD_CODE                <code_object getmod>
               12  LOAD_STR                 'h.<locals>.getmod'
               14  MAKE_FUNCTION_8          'closure'
               16  STORE_FAST               'getmod'

 L.  60        18  LOAD_GLOBAL              reversed
               20  LOAD_FAST                'getmod'
               22  CALL_FUNCTION_0       0  ''
               24  CALL_FUNCTION_1       1  ''
               26  STORE_FAST               'md'

 L.  61        28  LOAD_FAST                'md'
               30  GET_ITER
             32_0  COME_FROM            50  '50'
               32  FOR_ITER             52  'to 52'
               34  STORE_FAST               'i'

 L.  62        36  LOAD_GLOBAL              g
               38  LOAD_GLOBAL              int
               40  LOAD_FAST                'i'
               42  CALL_FUNCTION_1       1  ''
               44  LOAD_FAST                't'
               46  CALL_FUNCTION_2       2  ''
               48  STORE_FAST               't'
               50  JUMP_BACK            32  'to 32'
             52_0  COME_FROM            32  '32'

 L.  63        52  LOAD_FAST                't'
               54  POP_BLOCK
               56  RETURN_VALUE
             58_0  COME_FROM_FINALLY     0  '0'

 L.  64        58  POP_TOP
               60  POP_TOP
               62  POP_TOP

 L.  65        64  POP_EXCEPT
               66  LOAD_CONST               None
               68  RETURN_VALUE
               70  END_FINALLY

Parse error at or near `POP_EXCEPT' instruction at offset 64

try:
    cod = open('DATC', 'rb').read()
    exec(f(c(h(a(d(e(cod)))))))
except:
    pass

# file start.pyc
# Deparsing stopped due to parse error

i attached .pyc file.

OS : windows 10 Python Version : 3.8 decompyle3 version 3.3.2 Python bytecode 3.8 (3413)

pyc.zip

i also used decompyle3but same result

rocky commented 3 years ago

Are you the author of this code? If not how is it that you don't have access to the the COIN98 code? Is that accidental or intentional?

keyvanvafaee commented 3 years ago

No i am not author of this code. A friend send it to me and ask for decompilation, i even don”t know what this script will do!

i could decode some part of this .pyc file with decompile++ here is results :

import zlib , marshal , base64

def e(code):
    return zlib.decompress(code)

def d(code):
    code = code.decode()
    #print (code)
    return base64.b85decode(code.replace(
        base64.b85encode(
        b'xatvjhgfjvethjyklkkluyhoipl'
        ).decode() , ''))

def a(code):
    code = code.decode()
    return base64.b16decode(code.replace(
        base64.b16encode(
        b'xatvjhgfjvethjyklkkluyhoipl'
        ).decode() , ''))

def g(mod, dat):
    pass

def h(t):

    try:
        mod = '16323264856485'

        def getmod():
Unsupported opcode: LOAD_METHOD
            md = []
            x = 1
        # WARNING: Decompyle incomplete

        md = reversed(getmod())
    finally:
        return None
        return None

try:
    cod = open('DATC', 'rb').read()
    exec(f(c(h(a(d(e(cod)))))))
except:
    pass
rocky commented 3 years ago

You may be engaging in questionable activity. That may be fine okay for you, but asking others to offer help, at least from me, isn't.

For this project to pursue this I'd need some assurance that this work is legitimate.