473,394 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Re: Decompile python2.5-pyc

En Mon, 15 Sep 2008 20:57:24 -0300, Manuel Ebert <ma*****@uos.deescribió:
short story I accidentally wrote rm *.py into my makefile (yes, I am
old-fashioned, and yes, that was very, veeeery stupid) and - bad things
never come alone - my remote backup files are corrupted. To cut a sad
story short: I just kind of lost four months work on my bachelor's
thesis, well almost. I still have the pyc files (and backuped them on
virtually every device I have access to now), but despite intense
googling I couldn't find any free way of decompiling 2.5-code -- there
is depython.net and the online version of decompyle, but they charge
money (which I currently don't have), and the free version of decompyle
can't handle marshal data 2.3, and I lack the skills necessary to
extend it to 2.5.

Does anybody know something I don't, some home-brewn decompiler,
anything? I *am* quite desperate...
If your code doesn't use too much features post-2.3, you could try
regenerating the .pyc files using the old marshal format and feed the
resulting .pyc to decompyle - if you're lucky it may accept it...

--- begin ---
import marshal

MAGIC23 = ';\xf2\r\n'

def load_pyc(filename):
f = open(filename, 'rb')
try:
magic = f.read(4)
timestamp = f.read(4)
codeobject = marshal.load(f)
finally:
f.close()
return magic, timestamp, codeobject

def dump_pyc_23(filename, timestamp, codeobject):
assert len(timestamp)==4
f = open(filename, 'wb')
try:
f.write(MAGIC23)
f.write(timestamp)
marshal.dump(codeobject, f, 0)
finally:
f.close()

magic, timestamp, codeobject = load_pyc("test25.pyc")
dump_pyc_23("test23.pyc", timestamp, codeobject)
--- end ---

Good luck!

--
Gabriel Genellina

Sep 16 '08 #1
0 1687

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jakub Moscicki | last post by:
Hello, A small problem: I get a signal during a system call (from xmlrpclib -> httplib) and an exception "IOError: Interrupted system call" is raised (this is system dependant, on other machine...
3
by: Adil Hasan | last post by:
Hello, I'm having problems trying to use ZSI to connect to a https url. I give the command and I get prompted for my X509 cert pass-phrase, but the program dies with an openssl error. Here's my...
1
by: km | last post by:
Hi all, is there a debian binary of python2.4 ? tia, KM
6
by: Henry Bloom | last post by:
Hello, I have two questions: 1. The file-size of my mdb-Database grew extremely large after having written a lot of VBA-code. I know about the /decompile-option tried it .... it did not work....
28
by: deko | last post by:
After doing a lot of vba work, I've noticed the size of my mdb has grown, even though no data or objects have been added. I've read that the following procedure will remedy this and improve...
30
by: DFS | last post by:
I hadn't ever used it until a couple months ago, but it seems to be a handy little switch. On some .mdbs it doesn't change the size, or actually increases it a little. But on others it cut the...
13
by: Jan | last post by:
Hi: I've used the /decompile switch lots of times when working with troublesome databases. Now, though, I have a database that is secured, and I can't get the /decompile switch to work with the...
17
by: rdemyan via AccessMonster.com | last post by:
I have a launcher program that creates the shortcut to open my application using the Shell command. On the form I have a decompile checkbox that I can conveniently use to decompile my program. I...
15
by: Christopher Taylor | last post by:
RHEL comes with Python2.3 installed. A program I need to install requires Python2.4 So I got Python2.4 from source and compiled it up. I configured it with --prefix=/usr --exec-prefix=/usr...
2
by: Steve | last post by:
How do you decompile an AccessXP database? Can it be done from some external point without actually opening the database? Thank you! Steve
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.