所以我的 Excel-VBA 项目密码很容易被破解......还有什么其他选择?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1063155/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
So my Excel-VBA project password can easily be cracked... What are other options?
提问by Jean-Fran?ois Corbett
Now that I know that there is an easy workaroundto the standard wayof locking and password-protecting VBA code, I'd like to move on to more effective ways of protecting code. I am to deliver an Excel-based tool to a client, but would like something more than simple annoyance-type protection that will only deter the laziest of hackers.
现在我知道锁定和密码保护 VBA 代码的标准方法有一个简单的解决方法,我想继续使用更有效的代码保护方法。我要向客户提供基于 Excel 的工具,但想要的不仅仅是简单的烦恼类型的保护,它只会阻止最懒惰的黑客。
Are there any options in Excel-VBA, or do we really have to compile a separate application and forget about our Excel-based interface?
Excel-VBA 中是否有任何选项,或者我们真的必须编译一个单独的应用程序而忘记我们基于 Excel 的界面?
采纳答案by Charles Williams
The easiest and most efficient way is to move your VBA code to a VB6 compiled Com/automation addin.
最简单和最有效的方法是将 VBA 代码移动到 VB6 编译的 Com/automation 插件。
Or you may want to consider a .Net (with obfuscator) solution if performance is not important.
或者,如果性能不重要,您可能需要考虑 .Net(带有混淆器)解决方案。
回答by Ross
Another Trick is to write the code against a excel object in Access then make the access file in to a .mde http://www.blog.methodsinexcel.co.uk/?s=Access+MDBPoor, but cheep ;-)
另一个技巧是针对 Access 中的 excel 对象编写代码,然后将访问文件转换为 .mde http://www.blog.methodsinexcel.co.uk/?s=Access+MDB很差,但很便宜 ;-)
回答by Bosco
No need to convert to another language - you should be able to obfuscate most of your VBA code through www.vbsobfuscator.com[Note: Links to archive.org]
无需转换为另一种语言 - 您应该能够通过www.vbsobfuscator.com[注意:链接到 archive.org]来混淆大部分 VBA 代码
回答by NikoDeem
Practically, VBA obfuscatorsdo not protect VBA code because they leave the structure of the algorithm unchanged, which can be traced back to the original algorithms which can then be recovered.
实际上,VBA 混淆器不保护 VBA 代码,因为它们保持算法的结构不变,可以追溯到可以恢复的原始算法。
Converting your VBA code to VB6means your application will be limited to 32bit Excel (VB6 doesn't have a 64-bit version) and it can be decompiled by VB decompilers such as https://www.vb-decompiler.org/
将您的VBA 代码转换为 VB6意味着您的应用程序将被限制为 32 位 Excel(VB6 没有 64 位版本)并且它可以被 VB 反编译器反编译,例如https://www.vb-decompiler.org/
Converting your VBA code to VB.NETisn't a perfect solution either, as .NET has a ‘reflection' mechanism which can convert the compiled code of .NET assembly into the original source code.
将VBA 代码转换为 VB.NET也不是一个完美的解决方案,因为 .NET 具有“反射”机制,可以将 .NET 程序集的编译代码转换为原始源代码。
You can convert your VBA code to C/C++, which would be a very effective form of protection, but since C/C++ and VBA are very different programming languages, the conversion of VBA code to C/C++ is difficult, error prone, and generally not worth the huge amount of time and effort that it takes.
您可以将VBA 代码转换为 C/C++,这将是一种非常有效的保护形式,但由于 C/C++ 和 VBA 是非常不同的编程语言,因此将 VBA 代码转换为 C/C++ 很困难,容易出错,并且通常不值得花费大量的时间和精力。
There is a tool called VbaCompiler for Excel(http://vbacompiler.com) which converts the VBA code to C language code and then compiles it into a DLL. The level of protection this tool claims to provide is similar to that of converting your VBA code to C/C++ but without the massive amount of manual work that is required for such a process.
有一个名为VbaCompiler for Excel( http://vbacompiler.com)的工具可将VBA 代码转换为 C 语言代码,然后将其编译为 DLL。此工具声称提供的保护级别类似于将 VBA 代码转换为 C/C++ 的级别,但无需进行此类过程所需的大量手动工作。