Migrate PYD Files

Fredrik Lundh fredrik at pythonware.com
Thu Sep 8 06:46:48 EDT 2005


David Duerrenmatt wrote:

> Is there a way to use old pyd files (Python 1.5.2) with a newer version
> of Python without recompiling them?

> Because the source code is not available anymore, I'm wondering whether
> it's possible or not to change few bytes with a hex editor (version
> number?). I'd like to give it a try since the modules don't use too
> critical functions.

on windows, Python PYD files are linked against that version of the Python
interpreter DLL (python15.dll, python22.dll, etc).  you could perhaps try
changing any occurence of "python15" to "python23" and see how get far
you get...

(another approach would be to develop a custom "python15.dll" which
implements the necessary operations and maps them to the appropriate
Python interpreter DLL (using LoadLibrary/GetProcAddress for "manual"
linking.  use "dumpbin /exports" on your PYD to see what Python API:s
it's using)

</F> 






More information about the Python-list mailing list