def BINARY_SUBSCR(decompiler): oper2 = decompiler.stack.pop() oper1 = decompiler.stack.pop() if isinstance(oper2, ast.Sliceobj) and len(oper2.nodes) == 2: a, b = oper2.nodes a = None if isinstance(a, ast.Const) and a.value == None else a b = None if isinstance(b, ast.Const) and b.value == None else b return ast.Slice(oper1, 'OP_APPLY', a, b) elif isinstance(oper2, ast.Tuple): return ast.Subscript(oper1, 'OP_APPLY', list(oper2.nodes)) else: return ast.Subscript(oper1, 'OP_APPLY', [ oper2 ])
def SLICE_3(decompiler): tos = decompiler.stack.pop() tos1 = decompiler.stack.pop() tos2 = decompiler.stack.pop() return ast.Slice(tos2, 'OP_APPLY', tos1, tos)
def SLICE_2(decompiler): tos = decompiler.stack.pop() tos1 = decompiler.stack.pop() return ast.Slice(tos1, 'OP_APPLY', None, tos)
def SLICE_0(decompiler): return ast.Slice(decompiler.stack.pop(), 'OP_APPLY', None, None)