VB6 (erk) - 内联函数?
我使用 VB6 作为应用程序。
是否可以强制编译器内联函数?
或者是否有一个插件可以实现同样的效果?
我的代码中有一个安全部分,我希望通过在使用代码的每个点重复代码而不是作为函数列出一次来使其难以破解。
希望有人能回答我的问题!
I use VB6 for an application.
Is it possible to force the compiler to inline a function?
Or is there an add-in that achieves the same thing?
There's a secure part of my code that I want to make difficult to hack, by repeating the code at every point where it is used instead of being listed once as a function.
Hope someone can answer my question!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
IMO 如果这是您作为安全措施所做的事情,那么您将遇到比让 VB 内联您的函数更大的问题。 我认为 VB6 中没有任何规定可以做到这一点。 而且我倾向于认为这种技术会让你的代码更容易被破解,因为你会看到同样非常重要的函数一遍又一遍地重复......抱歉:-(
IMO if this is what you're doing as a security measure, you have bigger problems than getting VB to inline your function. And I don't think there is any provision in VB6 to do this. AND I tend to think that this technique would make it easier to hack your code, since you'd see the same really important function repeated over and over again... Sorry :-(
不支持内联函数。 然而,有几件事对你有利。
首先,VB6 是出了名的难以反编译,历史上市场上缺乏反编译器就证明了这一点。 对于试图恢复丢失的源代码或破解 VB6 的人来说,结果不太有用。
但是...
如果您使用的是 ActiveX DLL,那么编写兼容 DLL 的人就可以很容易地破解您的软件。 我的公司发现处理此问题的最佳方法是将关键对象设为公共不可创建并交换打包的二进制数据。
public non-creatable 会阻止某人引用 DLL、创建该对象的实例,然后运行测试来查看您在做什么。 二进制数据是为了掩盖您正在交换的数据。
在有关 COM 的文献中,您可以找到更安全的方法来处理这些问题,但您可以通过这些简单的操作来使 ActiveX 应用程序更难以被破解。
我公司的目标不是让某人不可能破解我们的软件,而是让它变得足够困难,以便我们的竞争对手与我们打交道的成本更低,而不是尝试破解我们的系统(CAD/CAM 系统)
There is no support for inlining a function. However there are several things working in your favor.
First VB6 is notoriously difficult to decompile as witness by the lack of decompilers on the market over the history. The results has been less than useful for people trying to recover lost source code or hack VB6.
But...
If you are using ActiveX DLLs then it could very easy to hack your software by a person writing a compatible DLL. The best way my company found to deal with this is to make critical objects public non-creatable and exchange packed binary data.
The public non-creatable prevents somebody from referencing the DLL, creating instance of that object and then running tests to see what you are doing. The binary data is to obscure the data you are exchanging.
In you look in the literature about COM there are more secure ways of dealing with these issues but these are simple things you can do to make a ActiveX application more difficult to hack.
My company goal isn't to make it impossible for somebody to hack our software but make it difficult enough that it cost less for our competitor to deal with us rather than try to hack our system (A CAD/CAM system)
正如 Dave 所说,VB 编译器不支持这一点。
如果你真的想要这个为什么不运行搜索& 替换代码的副本并构建该副本。 在命令行上执行此操作应该不会太困难。
As Dave said there is no support for that in the VB compiler.
If you really want to this why not run a search & replace on a copy of your code and build that copy. Doing that on the command line shouldn't be too difficult.