dll源代码_如果要在没有源代码的情况下对DLL应用强符号,该怎么办。

dll源代码

This article is neither here to teach you how to crack a DLL nor to encourage you to do so.  However, this is a situation that can occur often with legacy applications.

本文既不是在这里教您如何破解DLL,也不鼓励您这样做。 但是,这种情况通常会在旧版应用程序中发生。

It is not uncommon in mature systems that iterate through many generations of versions to end up with DLL's that are either missing some or all source or it might be difficult to easily replicate the build environment.  When security wasn't as important is it is now, signing DLL's wasn't an important portion of the workflow.

在成熟的系统中,迭代经过许多代版本以得到缺少某些或全部源的DLL的情况并不少见,否则可能很难轻松地复制构建环境。 当安全性变得不那么重要时,对DLL进行签名并不是工作流的重要组成部分。

Therefore, we need this little tip to be able to sign a DLL without a source code.

因此,我们需要这个小技巧来能够在没有源代码的情况下对DLL进行签名。

In order to execute the task you need the following linking tools; Ildasm and Ilasm

为了执行任务,您需要以下链接工具; ILDASMILASM

Both are in the .NET SDK. The path will usually be something like this depending on which version of the SDK is installed: C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin or they can be found in the .NET runtime installation path.  Here is the path for .NET 2.0: C:\Windows\Microsoft.NET\Framework\v2.0.50727

两者都在.NET SDK中。 取决于安装的SDK版本,路径通常是这样的:C:\ Program Files \ Microsoft SDKs \ Windows \ v6.0A \ Bin或可以在.NET运行时安装路径中找到。 这是.NET 2.0的路径:C:\ Windows \ Microsoft.NET \ F 拼写\ v 2.0.50727

1) You will need to use .NET SDK to create a new key. you can do this by either within the Visual Studio IDE or using the command prompt by typing "sn -k example.snk". Be sure to record the path where you keep this key.

1)您将需要使用.NET SDK创建新密钥。 您可以在Visual Studio IDE中或通过在命令提示符下键入“ sn -k example.snk”来执行此操作。 确保记录保存此密钥的路径。

2) Using the command prompt, go to the folder with your DLL. Copy ilasm.exe and ildasm.exe to the same directory and also the previously created key file. (In this case example.snk)

2)在命令提示符下,转到包含DLL的文件夹。 将ilasm.exe和ildasm.exe复制到同一目录以及先前创建的密钥文件中。 (在这种情况下为example.snk)

Note: if you have your environment variables set up to .NET SDK then you don't have to copy these programs or you can reference the path explicitly.

注意:如果将环境变量设置为.NET SDK,则不必复制这些程序,也可以显式引用路径。

3) Type “ildasm example.dll /out=example.il” to decompile the DLL into IL format with the resource file that we will use later to be attached with the key file

3)输入“ ildasm example.dll /out=example.il”,使用资源文件将DLL反编译为IL格式,稍后我们将使用该资源文件将其附加到密钥文件中

4) Type “ilasm example.il /dll/resource=example.res /key=example.snk /optimize”. This command recompiles the DLL with the il file, resource file and the new key file together.

4)输入“ ilasm example.il /dll/resource=example.res /key=example.snk / optimize”。 此命令将il文件,资源文件和新密钥文件一起重新编译DLL。

5) Validate the strong name by using "sn -v example.dll" from the command prompt.

5)通过在命令提示符下使用“ sn -v example.dll”来验证强名称。

You now have a strongly typed DLL that can be safely signed in any application without source code or recreating a build environment.

现在,您有了一个强类型的DLL,可以在任何应用程序中对其进行安全签名,而无需源代码或重新创建构建环境。

翻译自: https://www.experts-exchange.com/articles/3153/What-to-do-when-you-want-to-apply-a-strong-sign-to-a-DLL-without-a-source-code.html

dll源代码

sqlite3 数据库支持加密,分别使用QtCreator 和 VS2017 分别编译出64位 debug release DLL , (QtCreator只有动态 使用mingW 64 MSVC20147) (VS2017 有动态DLL和静态库 V14.1 ) 有工程源码,也可自行编译。 实例: QString exepath = QCoreApplication::applicationDirPath() +"/GameData.db"; int result=sqlite3_open(exepath.toLatin1().data(),&db); result=sqlite3_key(db,"abcd",4); //使用密码,第一次为设置密码 result=sqlite3_exec(db,"CREATE TABLE [MyTable] ([ID] INTEGER PRIMARY KEY NOT NULL,[MyText] TEXT NULL)",0,0,0); result=sqlite3_exec(db,"INSERT INTO MyTable (MyText) VALUES ('测试!')",0,0,0); result=sqlite3_close(db); 压缩包目录结构: +---sqlite3_QT | | .qmake.stash | | sqlite3.pro | | sqlite3.pro.user | | sqlite3.vcxproj | | sqlite3.vcxproj.filters | | sqlite3.vcxproj.user | | | +---mingw_x64 | | +---debug | | | libsqlite3.a | | | sqlite3.dll | | | sqlite3.h | | | sqlite3userauth.h | | | | | \---release | | libsqlite3.a | | sqlite3.dll | | sqlite3.h | | sqlite3userauth.h | | | +---msvc2017_x64 | | +---debug | | | sqlite3.dll | | | sqlite3.h | | | sqlite3.pdb | | | sqlite3userauth.h | | | | | \---release | | sqlite3.dll | | sqlite3.h | | sqlite3userauth.h | | | \---sqlite3 | \---secure | \---src | \---sqlite3_VS2017 | sqlite3.sln | sqlite3.vcxproj | sqlite3.vcxproj.filters | sqlite3.vcxproj.user | +---msvc2017_x64 | +---debug | | +---dyn | | | sqlite3.dll | | | sqlite3.h | | | sqlite3.pdb | | | sqlite3userauth.h | | | | | \---static | | sqlite3.h | | sqlite3.lib | | sqlite3.pdb | | sqlite3userauth.h | | | \---release |
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值