rocky / python-decompile3

Python decompiler for 3.7-3.8 Stripped down from uncompyle6 so we can refactor and start to fix up some long-standing problems
GNU General Public License v3.0
1.1k stars 155 forks source link

Python 3.8 - COME_FROM parse error. #71

Closed acureau closed 2 years ago

acureau commented 2 years ago

Description

Decompile fails because of a parse error. "Parse error at or near `COME_FROM' instruction at offset 20_0" Bytecode is able to be properly disassembled.

How to Reproduce

$ decompyle3 decompyle3 -o . <attached file>.pyc
Instruction context:

 L. 269        14  LOAD_FAST                'tile'
                  16  LOAD_ATTR                unit
                  18  POP_JUMP_IF_FALSE_BACK     4  'to 4'
->              20_0  COME_FROM            12  '12'

# file RiftWizard.pyc
# --- This code section failed: ---

 L. 269         0  BUILD_LIST_0          0
                2  LOAD_FAST                '.0'
              4_0  COME_FROM            44  '44'
              4_1  COME_FROM            30  '30'
              4_2  COME_FROM            18  '18'
                4  FOR_ITER             46  'to 46'

 L. 269         6  STORE_FAST               'tile'

 L. 269         8  LOAD_FAST                'tile'
               10  LOAD_ATTR                prop
               12  POP_JUMP_IF_TRUE     20  'to 20'

 L. 269        14  LOAD_FAST                'tile'
               16  LOAD_ATTR                unit
               18  POP_JUMP_IF_FALSE_BACK     4  'to 4'
             20_0  COME_FROM            12  '12'

 L. 269        20  LOAD_FAST                'tile'
               22  LOAD_ATTR                unit
               24  LOAD_DEREF               'self'
               26  LOAD_ATTR                caster
               28  COMPARE_OP               !=
               30  POP_JUMP_IF_FALSE_BACK     4  'to 4'

 L. 269        32  LOAD_FAST                'tile'
               34  LOAD_ATTR                unit
               36  JUMP_IF_TRUE_OR_POP    42  'to 42'
               38  LOAD_FAST                'tile'
               40  LOAD_ATTR                prop
             42_0  COME_FROM            36  '36'
               42  LIST_APPEND           2  ''
               44  JUMP_BACK             4  'to 4'
             46_0  COME_FROM             4  '4'
               46  RETURN_VALUE
               -1  RETURN_LAST

Parse error at or near `COME_FROM' instruction at offset 20_0

Files

Bytecode: https://drive.google.com/file/d/1I_o6sQfxoox3YeDLBp9QBNeX6xo4G6ma/view?usp=sharing Disassembly: https://drive.google.com/file/d/1-MGh-GSLT5ApCfleigsvEDysYBDRG44x/view?usp=sharing

Environment

Decompyle3 Version: 3.7.7 Python Version: 3.8.0 OS: Windows 10

rocky commented 2 years ago

While this is a reasonable bug report - it shows you bothered to read the issue template, even if the first part of the Disassembly has been removed - what you are trying to do is a little dodgy: you are want to disassemble RiftWizard.py which lists for about $15, presumably so you can cheat at playing the game.

And you are enlisting the help of others to do so in this endeavor.

acureau commented 2 years ago

Hi rocky, I do not consider this a suspicious activity as I paid for this game, and I should be able to do what I'd like with the code running on my machine.

I have already succeeded in my goals via other means, and I am not looking to get help in doing this so much as I am attempting to help your project by reporting a bug I came across in my own research. I am not knowledgeable enough to contribute a fix for this, so do with it what you will.

rocky commented 2 years ago

Hi am-nobody -

Sure, I understand your point of view.

In the future, these kinds of things are not in a form that are suitable for bug reporting here. I am happy to stick to with the kind of situations where you wrote wrote the code yourself and have the ability to narrow the problem to a small test case and have the solution to that.

I realize that is going to be useful to a smaller number of people, but that's okay.

I will however be more lenient to those who sponsor me or the project.

Darth-Carrotpie commented 2 years ago

While this is a reasonable bug report - it shows you bothered to read the issue template, even if the first part of the Disassembly has been removed - what you are trying to do is a little dodgy: you are want to disassemble RiftWizard.py which lists for about $15, presumably so you can cheat at playing the game.

And you are enlisting the help of others to do so in this endeavor.

While this can be 'a point of view' from your stand point, it is not from a legal stand point. Paying for the end product as an end-user usually gives the right to use it, but does not give the right to it's source code. You can read their license agreement for details, but more often that not, decompiling a legal product is breaking agreements and laws. A whole other story is about using tools like this to decompile malware.

acureau commented 2 years ago

While this can be 'a point of view' from your stand point, it is not from a legal stand point. Paying for the end product as an end-user usually gives the right to use it, but does not give the right to it's source code. You can read their license agreement for details, but more often that not, decompiling a legal product is breaking agreements and laws. A whole other story is about using tools like this to decompile malware.

Alright, so lets say I buy a book. I scratch out a sentence and reword it so I can better understand the meaning. At what point was that legally questionable? I don't need the rights to the book's contents to modify my own copy.

I don't think software is any different. Interference with online services and copyright infringements are a different story.

Darth-Carrotpie commented 2 years ago

While this can be 'a point of view' from your stand point, it is not from a legal stand point. Paying for the end product as an end-user usually gives the right to use it, but does not give the right to it's source code. You can read their license agreement for details, but more often that not, decompiling a legal product is breaking agreements and laws. A whole other story is about using tools like this to decompile malware.

Alright, so lets say I buy a book. I scratch out a sentence and reword it so I can better understand the meaning. At what point was that legally questionable? I don't need the rights to the book's contents to modify my own copy.

I don't think software is any different. Interference with online services and copyright infringements are a different story.

Well, but they are very different by law in most countries in the world. There's a reason why various forms of licensing exists which specifically let you read or modify (and in some cases distribute) source, i.e. MIT. Most coders have specific wording in their contracts, that all code which they write belongs to the company and it doesn't matter that it can be reused in another job even if slightly changed, they legally can't. There's a huge gap between copyright and copyleft within software engineering and totally worth a discussion. Discussing in comments under an issue are not the appropriate place though, let's not spam the devs.