Add Python 3.14 bytecode support and improve 3.13/3.14 recovery#605
Open
Techuouo520 wants to merge 2 commits into
Open
Add Python 3.14 bytecode support and improve 3.13/3.14 recovery#605Techuouo520 wants to merge 2 commits into
Techuouo520 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds Python 3.14 bytecode support and improves recovery for newer Python 3.13/3.14 bytecode patterns.
Changes
pycdasoperand formatting for newer opcodes.pycdcrecovery for unsupported or partially supported bytecode.Opcode Support / Improvements
Added or improved handling for:
CALL_KWINSTRUMENTED_CALL_KWCALL_FUNCTION_EXINSTRUMENTED_CALL_FUNCTION_EXMAKE_FUNCTIONSET_FUNCTION_ATTRIBUTETO_BOOLFORMAT_SIMPLEFORMAT_WITH_SPECCONVERT_VALUEMAKE_CELLCOPY_FREE_VARSLOAD_FAST_CHECKLOAD_FAST_AND_CLEARLOAD_FAST_BORROWLOAD_FAST_BORROW_LOAD_FAST_BORROWLOAD_SMALL_INTLOAD_COMMON_CONSTANTLOAD_SPECIALSTORE_FAST_LOAD_FASTSTORE_FAST_STORE_FASTMAP_ADDDICT_UPDATEDICT_MERGECALL_INTRINSIC_1CALL_INTRINSIC_2POP_ITERNOT_TAKENEND_ASYNC_FOREXTENDED_ARGFixes
.pycfiles being reported as unknown magic / unsupported version.CALL/CALL_KWNULL self-slot handling.json.dumps(..., ensure_ascii=False).MAKE_FUNCTIONhandling.SET_FUNCTION_ATTRIBUTEhandling.BINARY_OPsubscription handling.try/exceptrecovery aroundJUMP_IF_NOT_EXC_MATCH.except X as ecleanup patterns such ase = None; del e.pycdc.exestack reserve to better handle deeply nested / obfuscated bytecode.Tests
CALL_KWregression test..pycrecognition and disassembly..pycfiles.Related Issues
Fixes #603
Fixes #587
Fixes #542
Fixes #569
Fixes #595
Refs #540
Refs #498
Notes
Python 3.14 source decompilation is still best-effort. Complex or heavily obfuscated control flow may still produce imperfect source output or placeholder conditions, but the files should now be recognized and disassembled instead of failing at magic/version detection.