Commit Graph

59 Commits

Author SHA1 Message Date
Akash Munagala
ca73f05830 Print out frozenset in disasm too 2023-02-13 19:33:25 -08:00
Michael Hansen
60e4eb6316 Handle CACHE instructions in decompyle, and suppress them in disassembly by default.
Showing CACHE instructions and the extra PyCode fields in pycdas is now
controlled by command-line arguments.
2023-01-19 14:50:55 -08:00
Michael Hansen
5d855f0bd2 Fix LOAD_GLOBAL and cell var references in Python 3.11+ 2023-01-19 13:05:06 -08:00
Michael Hansen
379c0c94d0 Merge <3.11 VarNames and >=3.11 Locals+Names into a single variable for simplicity.
Also cleans up some extra verbose output by making extra PyCode fields optional
2023-01-19 11:32:07 -08:00
Michael Hansen
9f1d0f2a21 Add basic opcode (disassembly) support for Python 3.11 2023-01-19 11:32:07 -08:00
Michael Hansen
e623e9ac56 For String Refs, inherit the type of the reffed string object. 2022-12-01 11:42:31 -08:00
Adrian Haensler
882571c599 some fixes for 3.9 2022-07-08 17:45:07 -05:00
Nenad Čaklović
3039d8b410 Disassembler changes in 3.10 under BPO-27129 2022-03-24 22:06:35 +01:00
GawdOfROFL
e4e3a9f4ed added python 3.10 support 2021-10-10 00:52:41 +05:30
Michael Hansen
6140b4b33e Protect against out of range lookups in pycdas
Fixes #198.
2021-08-16 15:25:16 +00:00
Michael Hansen
56e549640f Fix format-truncation warning in bytecode.cpp 2021-04-12 10:12:45 -07:00
Michael Hansen
568867c80a Minor style adjustments 2020-10-20 21:08:02 -07:00
Aralox
0c9fbd9caf Issue-165 Added support for f-strings (literal string interpolation https://www.python.org/dev/peps/pep-0498/)
Opcodes handled: FORMAT_VALUE, BUILD_STRING.
Added AST node classes for FormattedValue and JoinedStr.
2020-10-17 20:52:57 +11:00
John Richards
ed11ba3fe4 Refactors how we handle NaN and infinity
The previous approach didn't work properly under MSVC. The wrong
output would be produced for NaN values.

This new approach will directly print out "nan" and "inf" with the
appropriate sign, rather than just wrapping the value in float('').
2020-10-15 21:35:19 -04:00
John Richards
870ecdc430 Handle NaN and infinity values
Right now, NaN/infinity values will produce "nan" and "inf", but
Python doesn't allow those in source code. This change will wrap
those values in float(''), which is allowed.

Tests for Python 2.7 and 3.8 have been added as well.

Fixes #136
2020-10-15 21:04:57 -04:00
Michael Hansen
8460d119fd Add bytecode support for Python 3.9 rc2 2020-09-29 09:28:15 -07:00
Michael Hansen
428d11c4b5 Add bytecode and disassembly support for Python 3.8.
Also fixes running pymultic from outside of its source directory.
2019-10-14 14:48:26 -07:00
Michael Hansen
8014ac2b14 Print unicode as default in Python 2.x when CO_FUTURE_UNICODE_LITERALS
is set.

Fixes #141.
2019-10-06 14:34:24 -07:00
Michael Hansen
5c896fa743 Clean up some loops with range-based for. 2019-10-04 15:56:24 -07:00
Michael Hansen
a9a362254e Use fputs instead of fprintf when no formatting is required 2018-01-28 15:37:44 -08:00
Michael Hansen
98ad031109 Add initial 3.7 alpha support, and fix 3.6 opcode map 2017-12-20 13:49:28 -08:00
Michael Hansen
b9dd99d518 Don't create special objects for NULL, just use NULL directly.
Also move null check into PycRef for nullable references.
2017-07-05 16:36:04 -07:00
Michael Hansen
6a9d6a6132 Update bytecode for Python 3.6 beta3, and use a common file for opcode names 2016-11-08 16:00:56 -08:00
Michael Hansen
5ee15c890c Fix display of cell vars 2016-09-07 18:22:49 -07:00
Michael Hansen
35e74d0e6e Show jump target on FOR_ITER instructions 2016-09-07 18:22:22 -07:00
Michael Hansen
4b55e0bcea Fix '...' missing in output 2016-08-30 13:32:53 -07:00
Dirk Faust
159c0c91f6 fix: conversion 2016-07-28 09:48:17 +02:00
Maxim
221ccdb67a size_t instead of ssize_t 2016-07-27 15:15:19 +03:00
Maxim
ed96c41005 Fix build with msvc 2016-07-27 14:00:17 +03:00
Michael Hansen
7701ed420e Make the comparison ops a bit more visually distinct 2016-07-15 13:37:50 -07:00
Fabien Siron
5936171e7a Add comparison argument to disassembly output 2016-07-10 19:45:29 +00:00
Michael Hansen
605d064fe7 Initial support for Python 3.6 disassembly 2016-06-22 22:06:09 -07:00
Michael Hansen
5fae3e2d1f Add Python 3.5 disassembly support 2015-10-01 16:06:09 -07:00
Michael Hansen
820397f9bf Interned strings and ASCII literals are always in the native format 2014-01-21 00:47:11 -08:00
Michael Hansen
176a049a68 Support new marshal types from Python 3.4 2014-01-21 00:42:37 -08:00
Michael Hansen
6ecbcfb564 Add documentation and initial framework for Python 3.4 support 2013-11-27 14:10:05 -08:00
Michael Hansen
ad03ec3034 Fixes for large operands (> 0x7fff). Closes #34 2013-08-06 22:16:28 -07:00
Michael Hansen
50657fb984 Preview of Python 3.3 support 2012-05-26 14:09:52 -07:00
Michael Hansen
f030a77767 Allow for output file override 2011-10-23 19:04:06 -07:00
Michael Hansen
c474d368a1 Use less conflicting filenames 2011-10-23 17:48:10 -07:00
Darryl Pogue
f795613445 Support for closure functions. 2011-10-16 22:46:17 -07:00
Michael Hansen
6a93c9f22d Actually output PyLong constants 2011-09-23 21:46:05 -07:00
Michael Hansen
be6ea32619 Add Python 3.2 support 2011-01-06 17:15:48 -08:00
Darryl Pogue
f1205548e5 Add raise, break, continue, and a hacky attempt at for loops.
for loops currently generate a core dump.
2011-01-01 02:31:31 -08:00
Darryl Pogue
132d62baf6 Added basic while loop support and a test system. 2010-12-31 02:42:58 -08:00
Michael Hansen
3f8311122d Update Windows version to include bytecode maps 2010-11-07 15:39:36 -08:00
Michael Hansen
1161c8de26 Use opcode mappings to keep things a bit cleaner and hopefully more sane 2010-09-04 01:20:41 -07:00
Michael Hansen
b45c30cc59 Add pycdas support for Python 2.7 2010-09-02 01:01:05 -07:00
Darryl Pogue
49c15b324c Updates to make progress. Progress is good. 2010-08-31 23:17:38 -07:00
Michael Hansen
7bb356d00a Improved output formatting, and added more instruction support 2009-08-03 23:13:50 +00:00