Closed Monstrofil closed 1 year ago
Is there actually any way to "tell" uncompyle6 to skip such blocks in order to decompyle at least everything else?
e.g. here is how decompyle++ handles this:
# Source Generated with Decompyle++
# File: lambdas.pyc (Python 2.7)
Unsupported opcode: MAP_ADD
self.oldVehicleValue = (lambda variable0: (lambda .0: pass# WARNING: Decompyle incomplete
)(variable0)
)([
1,
2,
3])
Not perfect, but in big functions it's much better to see at least something:
self.vehicleVelocity = Vector3(0, 0, 0)
self.torpedoIndex = 0
self.selectedTorpedoAngle = 0
self.stateWeaponLocks = []
self.inBlueLineZone = False
self.selectedTorpedoGroup = 0
self.selectedTorpedoLaunchers = 0
self.gameRoomInfo = None
self.arenaUniqueId = None
self.oldVehicleValue = self.vehicle
Unsupported opcode: MAP_ADD
self.weaponsReloadAmmoID = (lambda variable0: pass# WARNING: Decompyle incomplete
)(WeaponType.ALL_WEAPONS)
Unsupported opcode: MAP_ADD
self.selectedWeaponsAmmo = (lambda variable0: pass# WARNING: Decompyle incomplete
)(WeaponType.ALL_WEAPONS)
self.shipHasWeapon = { }
self.shipHasAliveGuns = { }
self.GUISpeed = 0
self.minimapVaryId = None
self.updVarId = None
self.updateCellDataVaryId = None
self.fogHornVary = None
self.updateBlueLineVaryId = None
self.movementControl = None
self.oldFov = ConstantsShip.MIN_FOV
self.keysLastPressTime = None
self.projTraces = { }
self.damageStatLog = None
self.damageReportLogDirect = None
self.damageReportLogSplash = None
if devMode():
uncompyle6 works by function and if a particular function fails the other functions are still compiled. This is open source, so feel free to think up something and submit a PR.
I am open to adding an option that indicates putting in comments the errors or omitting the errors altogether and putting in a dummy function.
As for the original problem, that's is easily fixed. However while easily fixed seems to be more pervasive and appears in more bytecode versions than just 2.7.
When I get a chance, there will be a fix.
Description
I'm trying to decompile python2.7 code, but uncompyle6 fails near lambda-style instructions. I was able to prepare small example which reproduces the behaviour.
How to Reproduce
The following code is absolutely valid and can be executed:
The bytecode that python produces for me is the next:
Output Given
Expected behavior
Successfull decomplation or at lease skipped block.
Please modify for your setup
I tried to fix the issue myself, but it appears to be much harder than I thought about it.