Hi friends, there is a script which generates encrypted passwords for Starship users. There is a series of marshal, zlib and base64 calls, which is reversed by the script. Is there a known bug in Marshal, or should I start the debugger now? The passwphrase for the attached script is "hey". cheers - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/ import marshal,base64,zlib exec marshal.loads(zlib.decompress(base64.decodestring(""" eJytVM+PGzUUfs6PzWZYwapAqbbAuiyF6Yqsqt2iomq1HGkvuQQJaS+pM3YzbjP2yHY6CdrVHNr+ Exz5L/gn4MidC2f+Az5Pkq0QlFMnmTf2s+d73/vmPWeEq43b/wxT498mSXSOwbskGZ0zqm+QbNF5 i+o9km16idU21bdIdUh26GmLrCRWf0ayS8+6dN6l+oAU0XcP689JbZHcohfA6VF9mxQj1SbVi57r 2PAFqS7p7bVH9+kFkew1mDvA/JJUCziGEYs3AozS7ch1yIiSg7dwJfjxzCkRVFml4Q7ng8F6zgUv hfeVdZLzJ84WXJgln+rnyvCgFuEIbzoV5s54/g3PcuFEFpTzvMp1lnPhFM9sUc6DklwboEmF5UIb 7YPO8PJkHvhz5ZbcWDOYaaOE45VYrmI18N/n2sctXlvDMczmPthC/wjEJ9bxUrtFTOBt6OAPoqSH h4c85MqrdUaeT1SoFDIenJ0OmpyWdu5AxDllwmuB8GLC33gNzm7700EytBWfA3s0esiD5TM7hTAY +IBIuS6PymXIrTkyKiRYjKL5+MI607nXZsrVAjLPlpHmFck0m+lyYgWIOAXRC2UkNHowuJMII+Mm M10zv2K8QosojUvy0tmpE0WyomQLFfK4o7BIGgUhxWSmjhJ/F/U3CdVX/BHPRKyE2SwiA0mEVQgI g49agXtmIVMWbmWMOvi1yZexyfaovhmb7BnRJWsGjC7RXh/TBZqgFdsO3XCJJvuELtqkO3RB0cPq T5v5VmyTSwDt00WLdI/CduxQNGbc14pNGm2H+Ajgo7SLoEPfhz25e3x8cv/eyX0wYuADRjepAQpE ga3jIP514H2E4SiNZ8NQj2E1h2nmPposd80TYnrUDi3SaFdD/37c8O9q9bF7T2eimEhxtk8+Hj6N 0XEh7W+wC/m134qT4PANGpdRVYMtm4V5KdGijSM0DqmnygffwfCp1WaFIsq0s+EU/gt4Bfh/ZDdn wx75JJ6U7EN2je2y91izOh4XQpvxeOj3MStnSqC88f1RsqtSiMXKy9zB/8DvYs/jH/46fWR+q3+v fv3lz5/+eJUmm5ylzRr6eB5vBif/4LAOaUShxuOrdKJoTlRjbXDWNN6wCFeSvdYmbcR+U65RiW9R Dh/gufNOP+m3dnq7bIdtI9VrbJ/9DYOcdyU= """)))
Christian Tismer wrote:
Hi friends,
there is a script which generates encrypted passwords for Starship users. There is a series of marshal, zlib and base64 calls, which is reversed by the script.
Is there a known bug in Marshal, or should I start the debugger now? The passwphrase for the attached script is "hey".
Aehmmm... can it be that code objects are no longer compatible between Python 2.0 and 2.1? sigh - ciao - chris -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
Christian Tismer wrote:
Christian Tismer wrote:
Hi friends,
there is a script which generates encrypted passwords for Starship users. There is a series of marshal, zlib and base64 calls, which is reversed by the script.
Is there a known bug in Marshal, or should I start the debugger now? The passwphrase for the attached script is "hey".
Aehmmm... can it be that code objects are no longer compatible between Python 2.0 and 2.1?
Yes, not suprisingly though... AFAIK the pyc format changed in every single version between 1.5.2 and 2.1. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
On Fri, Jun 01, 2001 at 09:01:38PM +0200, M.-A. Lemburg wrote:
Yes, not suprisingly though... AFAIK the pyc format changed in every single version between 1.5.2 and 2.1.
Worse, it's changed several times between each release :) -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
Thomas Wouters wrote:
On Fri, Jun 01, 2001 at 09:01:38PM +0200, M.-A. Lemburg wrote:
Yes, not suprisingly though... AFAIK the pyc format changed in every single version between 1.5.2 and 2.1.
Worse, it's changed several times between each release :)
But I didn't use .pyc at all, just a marshalled code object. There are no version headers or such. The same object worked in fact for Py 1.5.2 and 2.0, but no longer with 2.1 . I debugged the unmarshalling and saw what happened: The new code objects with their new scoping features were the problem. The new structures were simply added, and there is no way to skip these for older code objects, since there isn't any info. Some option for marshal to umarshal old-style code objects would ave helped. But then, I'm not sure if the opcodes are still assigned the same way in 2.1, or if there was some movement? This would kill it anyway. ciao - chris (now looking for another cheap way to do something invisible in Python without installing *anything* ) -- Christian Tismer :^) <mailto:tismer@tismer.com> Mission Impossible 5oftware : Have a break! Take a ride on Python's Kaunstr. 26 : *Starship* http://starship.python.net/ 14163 Berlin : PGP key -> http://wwwkeys.pgp.net/ PGP Fingerprint E182 71C7 1A9D 66E9 9D15 D3CC D4D7 93E2 1FAE F6DF where do you want to jump today? http://www.stackless.com/
Christian Tismer wrote:
Thomas Wouters wrote:
On Fri, Jun 01, 2001 at 09:01:38PM +0200, M.-A. Lemburg wrote:
Yes, not suprisingly though... AFAIK the pyc format changed in every single version between 1.5.2 and 2.1.
Worse, it's changed several times between each release :)
But I didn't use .pyc at all, just a marshalled code object.
That's the point: the header in pyc files is meant to signal the incompatibility of the following code object. Perhaps we should moev this version information into the marshal format of code objects themselves...
There are no version headers or such. The same object worked in fact for Py 1.5.2 and 2.0, but no longer with 2.1 . I debugged the unmarshalling and saw what happened: The new code objects with their new scoping features were the problem. The new structures were simply added, and there is no way to skip these for older code objects, since there isn't any info. Some option for marshal to umarshal old-style code objects would ave helped. But then, I'm not sure if the opcodes are still assigned the same way in 2.1, or if there was some movement? This would kill it anyway.
AFAIK, the assignments did not change, but several opcodes were added in 2.1, so code compiled in 2.1 will no run in 2.0.
ciao - chris
(now looking for another cheap way to do something invisible in Python without installing *anything* )
Why don't you use freeze or py2exe or Gordon's installer for these one file executables ? Alternatively, you should check the Python version and make sure that it matches the one used for compiling the byte code. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Company & Consulting: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
participants (3)
-
Christian Tismer
-
M.-A. Lemburg
-
Thomas Wouters