Firebird,解密存储过程? [英] Firebird, decrypt stored procedure?

查看:128
本文介绍了Firebird,解密存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把自己变成了一个我需要将一些从Firebird数据库移植到MSSQL中的功能的地方。表格模式和数据确定,所有这些都是可枚举的,可选择的是sysdba,但是应用程序层被证明是一种痛苦。
数据库有大约1000多个程序,我想通过一些审查来移动它们,而不是重建整个DAL。问题是(你猜到)它们似乎都是加密的。当我要求改变它来生成一个脚本时,我得到了ALTER脚本,但是该过程的正文看起来像一个二进制内容的base64字符串。我的第一个猜测是加密。



有没有办法解密这些机构,就像有MSSQL一样?请注意,Firebird数据库正在原始的Firebird安装中运行,没有任何东西被复制或移动,以防需要访问某些密钥。

解决方案

当您在Firebird中创建(或更改)存储过程时,Firebird会将原始文本存储在表<$ code> RDB $ PROCEDURE_SOURCE C $ C> RDB $程序。这不会被加密。这个身体与Firebird本身无关,因为它将使用存储过程的编译形式(在列 RDB $ PROCEDURE_BLR )中;它只存储允许isql(和其他工具)生成数据库的DDL脚本。



一些软件供应商不喜欢那些人访问他们的源代码,所以他们将使这个 RDB $ PROCEDURE_SOURCE 列或 - 可能是你的数据库的情况 - 以某种方式加密身体。



如果这是一个内部开发的应用程序,您将需要找到用于构建此数据库的原始脚本。



否则没有办法在不知道供应商(或开发人员)做什么的情况下撤消这种做法。另一个可能的解决方案是从BLR(二进制语言表示,存储过程的编译形式)中逆向工程到存储过程,但是我不知道这样做的工具(这可能不会导致非常可读的代码)。



其中之一可能违反许可协议,甚至可能违反当地法律。您最好的选择是联系这个遗留应用程序的供应商,并要求(或支付)这些源代码。



ISQL工具可以将BLR打印成可读形式,但由于它是非常低级别的,我不知道会有多么有用。有关示例,请参阅此答案


I got myself into a place where I need to port some functionality from a legacy Firebird database into MSSQL. The table schema and data was ok, all was enumerable and selectable for sysdba, however, the application layer is proving to be a pain. The database has some 1000+ procedures and I would like to to move them over with some review rather than rebuilding the whole DAL. The problem is (you guessed) that they all appear to be encrypted somehow. When I ask to alter it to generate a script I get the ALTER script but the body of the procedure looks like a base64 string of some binary content. My first guess is encryption.

Is there some way to decrypt those bodies, like there is for MSSQL? Please note that Firebird database is running on its original box, in its original Firebird installation, nothing has been copied or moved, in case access to some keys is required.

解决方案

When you create (or alter) a stored procedure in Firebird, Firebird will store the original body in column RDB$PROCEDURE_SOURCE of table RDB$PROCEDURES. This will not be encrypted. This body is not relevant for Firebird itself, as it will use the compiled form of the stored procedure (in column RDB$PROCEDURE_BLR); it is only stored to allow isql (and other tools) to generate the DDL script of the database.

Some software vendors don't like that people have access to their sourcecode, and so they will either null this RDB$PROCEDURE_SOURCE column or - as is likely the case with your database - encrypt the body in some way.

If this is an application that was developed in-house, you will need to find the original scripts used to build this database.

Otherwise there is no way to undo this without knowing exactly what the vendor (or developer) has done. Another possible solution would be to reverse engineer to stored procedure from the BLR (Binary Language Representation, the compiled form of the stored procedure), but I am not aware of tools that do this (and this might not result in very readable code).

Doing either of these might violate the license agreement, and maybe even local law. Your best bet would be to contact the vendor of this legacy application and ask (or pay) them for this source code.

The ISQL tool can print the BLR in 'readable' form, but as it is very low-level, I don't know how helpful that will be. For an example see this answer.

这篇关于Firebird,解密存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆