scanner39.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2019, 2021-2022 by Rocky Bernstein
  2. #
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. """Python 3.9 bytecode decompiler scanner.
  16. Does some token massaging of xdis-disassembled instructions to make
  17. things easier for decompilation.
  18. This sets up opcodes Python's 3.9 and calls a generalized
  19. scanner routine for Python 3.7 and up.
  20. """
  21. from uncompyle6.scanners.scanner38 import Scanner38
  22. from uncompyle6.scanners.scanner37base import Scanner37Base
  23. # bytecode verification, verify(), uses JUMP_OPs from here
  24. from xdis.opcodes import opcode_38 as opc
  25. # bytecode verification, verify(), uses JUMP_OPS from here
  26. JUMP_OPs = opc.JUMP_OPS
  27. class Scanner39(Scanner38):
  28. def __init__(self, show_asm=None):
  29. Scanner37Base.__init__(self, (3, 9), show_asm)
  30. return
  31. pass
  32. if __name__ == "__main__":
  33. print("Note: Python 3.9 decompilation not supported")