Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unsupported argument found for LIST_EXTEND #489

Open
YWtheGod opened this issue Jun 1, 2024 · 7 comments
Open

Unsupported argument found for LIST_EXTEND #489

YWtheGod opened this issue Jun 1, 2024 · 7 comments

Comments

@YWtheGod
Copy link

YWtheGod commented Jun 1, 2024

# Source Generated with Decompyle++
# File: easy.pyc (Python 3.9)

from copy import copy
from renpy.display.screen import ScreenDisplayable, get_screen_variant
from renpy.exports import loadable, pure, store
from renpy.game import context
from renpy.store import ImageReference
from saga.display.image import Image, placement
from saga.display.sdf import SDF
pure(f'''{__name__}.placement''')

def image(fn):
    if isinstance(fn, str):
        return Image(fn)

image = pure(image)

def outline(fn, **kwargs):
Unsupported opcode: DICT_MERGE
    sdf = fn.replace('.png', '.sdf')
    if not loadable(sdf):
        return fn
# WARNING: Decompyle incomplete

outline = pure(outline)

def ref(*args):
    what = context().images.apply_attributes(None, None, args)
    return ImageReference(what)


def screen(name = None, *, _scope, _sensitive, *args, **kwargs):
    scr = copy(get_screen_variant(name))
    scr.modal = 'False'
    if _sensitive:
        scr.sensitive = _sensitive
    _duplicatable = kwargs.pop('_duplicatable', False)
    if not _scope:
        pass
    scope = {
        '_args': args,
        '_kwargs': kwargs }

    def _duplicate(args = None):
        return ScreenDisplayable(scr, None, None, '', scope, **('alt', 'scope'))

    rv = _duplicate(None)
    if _duplicatable:
        rv._duplicate = _duplicate
        rv._duplicatable = True
    return rv


def stage(child = None, *, ctrl, *args, **kwargs):
Unsupported argument found for LIST_EXTEND
Error decompyling easy.pyc: std::bad_cast

easy.zip

@ddouworld
Copy link
Contributor

Make sure you are using pycdc built with the latest source code

@YWtheGod
Copy link
Author

YWtheGod commented Jun 1, 2024

Yes, I got the latest source code and compiled it with MSYS gcc

(base) C:\Users\ywthe\pycdc>git show -s --format=%ci HEAD
2024-05-30 14:56:07 -0700

@greenozon
Copy link
Contributor

I see same error,
it means you hit some corner case with the LIST_EXTEND opcode support
which means that in the python 3.9 tasklist:
#450
is not a full checkbox, but half of it....

@ddouworld
Copy link
Contributor

I think you're missing at least three bytecode implementations of LIST_TO_TUPLE, CALL_FUNCTION_EX_A, and DICT_MERGE_A if you want the decompile to work. If the amount of code you want to decompile is not much. You can try some AI tools to decompile it for you. Hope it can help you.

@UJJWALJAAT
Copy link

UJJWALJAAT commented Jun 24, 2024

from copy import copy
from renpy.display.screen import ScreenDisplayable, get_screen_variant
from renpy.exports import loadable, pure, store
from renpy.game import context
from renpy.store import ImageReference
from saga.display.image import Image, placement
from saga.display.sdf import SDF
pure(f'''{name}.placement''')

def image(fn):
if isinstance(fn, str):
return Image(fn)

image = pure(image)

def outline(fn, **kwargs):
Unsupported opcode: DICT_MERGE
sdf = fn.replace('.png', '.sdf')
if not loadable(sdf):
return fn

WARNING: Decompyle incomplete

outline = pure(outline)

def ref(*args):
what = context().images.apply_attributes(None, None, args)
return ImageReference(what)

def screen(name = None, *, _scope, _sensitive, *args, **kwargs):
scr = copy(get_screen_variant(name))
scr.modal = 'False'
if _sensitive:
scr.sensitive = _sensitive
_duplicatable = kwargs.pop('_duplicatable', False)
if not _scope:
pass
scope = {
'_args': args,
'_kwargs': kwargs }

def _duplicate(args = None):
    return ScreenDisplayable(scr, None, None, '', scope, **('alt', 'scope'))

rv = _duplicate(None)
if _duplicatable:
    rv._duplicate = _duplicate
    rv._duplicatable = True
return rv

def stage(child = None, *, ctrl, *args, **kwargs):
Unsupported argument found for LIST_EXTEND
Error decompyling easy.pyc: std::bad_cast

[easy.zip](https://github.com/user-attachments/files/15521110/easy.zip)

from copy import copy from renpy.display.screen import ScreenDisplayable, get_screen_variant from renpy.exports import loadable, pure, store from renpy.game import context from renpy.store import ImageReference from saga.display.image import Image, placement from saga.display.sdf import SDF pure(f'{name}.placement') @pure def image(fn): if isinstance(fn, str): return Image(fn) return fn @pure def outline(fn, **kwargs): sdf = fn.replace('.png', '.sdf') if not loadable(sdf): return fn return SDF(fn, sdf=sdf, **kwargs) def ref(*args): what = context().images.apply_attributes(None, None, args) return ImageReference(what) def screen(name, *args, _scope=None, _sensitive='False', **kwargs): scr = copy(get_screen_variant(name)) scr.modal = 'False' if _sensitive: scr.sensitive = _sensitive _duplicatable = kwargs.pop('_duplicatable', False) scope = _scope or {'_args': args, '_kwargs': kwargs} def _duplicate(args): return ScreenDisplayable(scr, None, None, alt='', scope=scope) rv = _duplicate(None) if _duplicatable: rv._duplicate = _duplicate rv._duplicatable = True return rv def stage(child, *args, ctrl=(), **kwargs): return store.stage(*args, child=ref(*child, *ctrl), **kwargs) @pure def unscaled(fn): return Image(fn, oversample=1)

@greenozon
Copy link
Contributor

@UJJWALJAAT please use GH code-formatting

@UJJWALJAAT
Copy link

@UJJWALJAAT please use GH code-formatting

Why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants