自动加载PowerBuilder扩展
有谁知道是否可以使给定的 PowerBuilder 应用程序(我通常没有源代码)加载我提供的自定义扩展(非可视扩展)?
我知道我可以将我的 .pbd 添加到 PowerBuilder 中 PowerScript 目标的库列表中,但是当给定一个完整的基于 PowerBuilder 的 GUI 时,也许有一些我可以手动编辑的配置文件,指定我的额外 .pbd 的路径,以便在应用程序启动时加载?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不相信有一种简单的方法可以在运行时修补 pb .exe - .pbds 列表是在编译之前定义的,我不知道有什么方法可以在运行时更改它。 您可以考虑反编译和/或编辑 .exe,但这可能并不简单。
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.
最简洁的答案是不。 如果没有源,您就无法添加扩展,或者就此而言,无法调用此类扩展中的任何内容。
The short answer is no. Without the source, you can't add the extension, or for that matter, call anything in such an extension.
如果您有源代码(您表明没有),则可以使用 SetLibraryList 更改运行时库列表(出于某种原因不建议使用 iirc AddToLibraryList)。 通过读取启动命令行,您可以在运行时交换库以包含特定版本。
我不知道有什么方法可以修补现有的 PB .exe 来执行类似的操作。
即使您是一名出色的黑客,PB 生成的 .exe 确实是 PB VM 的引导加载程序,因此您需要了解“exe”的结构才能通过修补影响加载时库列表。 如果您只是将一个对象/函数的一种实现替换为另一种,那么您可能就完成了,否则您需要知道如何修补特定的 PBD/DLL 以调用添加的库中的函数。
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.