views:

209

answers:

3

Does anybody know whether it's possible to make a given PowerBuilder application (for which I usually don't have the source code) load a custom extension (a nonvisual extension) which I provide?

I know that I could add my .pbd to the library list of the PowerScript target in PowerBuilder, but when given a complete PowerBuilder-based GUI, maybe there is some configuration file I could edit by hand, specifying the path to my extra .pbd, so that its loaded as the application starts?

+2  A: 

I don't believe there is a simple way to patch a pb .exe at runtime - the list of .pbds is defined before compilation and I don't know any way to change it at runtime. You could look into decompiling and or editing the .exe but this is likely to be non-trivial.

Colin Pickard
+2  A: 

If you have the source code, which you indicate you do not, you can use SetLibraryList to change the runtime library list (iirc AddToLibraryList is not recommended for one reason or another). By reading the startup command line, you could then swap out libraries at runtime to include particular versions.

I'm not aware of any way to patch an existing PB .exe to do something like this.

Even if you're a hacker extraordinaire, the PB-produced .exes are really bootstrap loaders for the PB VM, so you'd need to understand the structure of the "exe" to affect the load-time library list via patching. If you're simply swapping one implementation of an object/function for another you might be done, otherwise you'll need to know how to patch a particular PBD/DLL to call the function(s) in your added library.

DaveE
+2  A: 

The short answer is no. Without the source, you can't add the extension, or for that matter, call anything in such an extension.

psant