保护vb.net中的软件仅在一台计算机上运行

发布于 2024-08-24 00:30:00 字数 83 浏览 5 评论 0原文

我开发了一个小型应用程序,现在我想保护它。

我只想在我自己的计算机上运行它,并且我自己开发了它。

我怎样才能做到这一点?

I have developed a small application and now i want to protect it.

I want to run it only on my own computer and i have developed it for myself.

How can i do that?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

開玄 2024-08-31 00:30:00

A. 不要发布它。
B. 在代码中硬编码您的计算机名称,并使程序执行的第一件事是验证 System.Environment.MachineName 与其匹配。

A. Don't publish it.
B. Hard-code your computer name in the code, and make the first thing the program does to be verifying that System.Environment.MachineName matches it.

吃不饱 2024-08-31 00:30:00

您可以随时检查处理器 ID 或主板序列号。

Private Function SystemSerialNumber() As String
    ' Get the Windows Management Instrumentation object.
    Dim wmi As Object = GetObject("WinMgmts:")

    ' Get the "base boards" (mother boards).
    Dim serial_numbers As String = ""
    Dim mother_boards As Object = _
        wmi.InstancesOf("Win32_BaseBoard")
    For Each board As Object In mother_boards
        serial_numbers &= ", " & board.SerialNumber
    Next board
    If serial_numbers.Length > 0 Then serial_numbers = _
        serial_numbers.Substring(2)

    Return serial_numbers
End Function


Private Function CpuId() As String
    Dim computer As String = "."
    Dim wmi As Object = GetObject("winmgmts:" & _
        "{impersonationLevel=impersonate}!\\" & _
        computer & "\root\cimv2")
    Dim processors As Object = wmi.ExecQuery("Select * from " & _
        "Win32_Processor")

    Dim cpu_ids As String = ""
    For Each cpu As Object In processors
        cpu_ids = cpu_ids & ", " & cpu.ProcessorId
    Next cpu
    If cpu_ids.Length > 0 Then cpu_ids = _
        cpu_ids.Substring(2)

    Return cpu_ids
End Function

取自以下位置: http://www.vb-helper.com/howto_net_get_cpu_serial_number_id.html

这是一个问题 Jim 将其转换为 Option Strict。

You could always check the processor ID or motherboard serial number.

Private Function SystemSerialNumber() As String
    ' Get the Windows Management Instrumentation object.
    Dim wmi As Object = GetObject("WinMgmts:")

    ' Get the "base boards" (mother boards).
    Dim serial_numbers As String = ""
    Dim mother_boards As Object = _
        wmi.InstancesOf("Win32_BaseBoard")
    For Each board As Object In mother_boards
        serial_numbers &= ", " & board.SerialNumber
    Next board
    If serial_numbers.Length > 0 Then serial_numbers = _
        serial_numbers.Substring(2)

    Return serial_numbers
End Function


Private Function CpuId() As String
    Dim computer As String = "."
    Dim wmi As Object = GetObject("winmgmts:" & _
        "{impersonationLevel=impersonate}!\\" & _
        computer & "\root\cimv2")
    Dim processors As Object = wmi.ExecQuery("Select * from " & _
        "Win32_Processor")

    Dim cpu_ids As String = ""
    For Each cpu As Object In processors
        cpu_ids = cpu_ids & ", " & cpu.ProcessorId
    Next cpu
    If cpu_ids.Length > 0 Then cpu_ids = _
        cpu_ids.Substring(2)

    Return cpu_ids
End Function

Was taken from where: http://www.vb-helper.com/howto_net_get_cpu_serial_number_id.html

Here's a question by Jim to convert this for Option Strict.

去了角落 2024-08-31 00:30:00

这实际上取决于谁是“敌人”。

如果您希望保护它免受贪婪的、非破解者的朋友的侵害,那么您可以简单地仅在注册表中找到某个密码(使用加密安全散列函数)时才运行该应用程序,或者按照 Jay 的建议使用 MachineName 。

但如果您正在考虑保护它免受严重“敌人”的侵害,请注意:数学证明只要硬件不安全,在其上运行的任何软件本质上都是不安全的。这意味着每个软件都是可破解的,任何保护机制都是可绕过的(甚至是安全硬件设备,例如 Alladin 的 Finjan USB 产品密钥,因为其余硬件都是不安全的)。
由于当今大多数(如果不是全部)硬件都不安全,因此您根本无法在软件中获得 100% 的安全性。

在这两者之间,有许多用于许可和复制保护的安全解决方案。这一切都取决于谁是敌人以及威胁是什么。

It really depends on who is the "enemy".

If you wish to protect it from your greedy, non-cracker, friends, then you can simply have the application run only if a certain password is found in the registry (using a cryptographically secure hash function), or use the MachineName as Jay suggested.

But if you're thinking of protecting it from serious "enemies", do notice: It has been mathematically proven that as long as the hardware is insecure, any software running on it is inherently insecure. That means that every piece of software is crackable, any protection mechanism is bypassable (even secured-hardware devices such as Alladin's Finjan USB product key, since the rest of the hardware is insecure).
Since most (if not all) of today's hardware is insecure, you simply cannot get 100% security in a software.

In between, there are lots of security solutions for licensing and copy-protection. It all comes down to who is the enemy and what is the threat.

2024-08-31 00:30:00

无论您多么努力,如果有人真的想在另一台计算机上运行它,他们就会的。

所有需要做的就是对你的保护进行逆向工程以

  1. 删除

No matter how hard you try, if someone really want to run it on another computer, they will.

All need to do is reverse engineer your protection to

  1. remove it
  2. play with it
生寂 2024-08-31 00:30:00

另一种选择可能是让您的程序向用户询问一个具有派生答案的问题。这是一个脑死亡的例子......

你的程序:“现在几点了?”

您输入:(TheYear + 10 - theDay + 11) Mod 13

这样,实际上只有您可以运行该程序,而不是依赖于机器。

Another option might be to have your program ask the USER a question that has a derived answer. Here's a brain dead example....

Your Program: "What time is it now?"

You Enter: (TheYear + 10 - theDay + 11) Mod 13

In this way its actually ONLY YOU that can run the program instead of it being MACHINE dependent.

所有深爱都是秘密 2024-08-31 00:30:00

我在 VB DOS 中做过这样的事情。

我要么制作了一个不可删除的文件,该文件是特定机器的关键,其中包含代码,和/或读取 .pwl 文件并进行多项检查,这些检查仅在您的机器上。不可编辑的文件是用诸如 char 233 之类的扩展字符集制成的,因此当人们尝试查看它时,它将打开一个空白副本(编辑)(write.ex),因此无法读取数据,也无法编辑移动数据或删除。

它需要是某些字符;我不确定 128 到 255 之间的每个宪章是否都能发挥作用,有些扩展角色可以做到这一点,有些则不行,它也可以被击败,但它会把一些人拒之门外,

但是它可以在程序环境中读取或检查。没有什么是完全安全的,这是我搞乱的一些事情。

注意:该文件将很难删除,也许可以创建一个测试目录来测试这一点。

我希望这没关系,我不太擅长向人们传达信息;我从 1982 年就开始编程。

I have made things like this in VB DOS.

I either made a non-deletable file that is key to a specific machine with a code inside, and/or read the .pwl files and have several checks, that are only on your machine. The non-editable file is made with extended character sets like char 233 so when a person tries to look at it, it will open a blank copy (edit) (write.ex), so data cannot be read and it cannot be edited moved or deleted.

It needs to be certain characters; I am not sure if every charter between 128 and 255 will work it, some extended characters work to do this some will not, also it can be defeated, but it will keep some people out,

But it can be read or checked in a program environment. Nothing is totally secure, this is some of the things I mess with.

Note: the file will be very hard to delete, maybe make a test directory to test this.

I hope this is OK I am not very good at conveying info to people; I have programmed since 1982.

染火枫林 2024-08-31 00:30:00

另一个想法...我编写了一个不能直接运行的程序,它只能由外部文件运行,因此您可以在其中添加密码输入部分并加密密码,这样它就不能很容易地读取,我制作了一个可执行文件要测试的 vb 程序版本。它在松弛空间中写入一个字符,因此如果程序看到该值,它将不会运行,但是运行程序有一个不同的字符,并将其更改为该字符,并且该程序被设计为仅在该字符是时才允许进入正确的,仅由跑步者制作,然后当它进入时,它会变回来,这样它就不会保持打开状态,我做了这种事情,它确实有效,总有一种方法可以击败任何保护,目标是如果您不希望他们这样做,则可以减慢他们的速度或阻止他们运行或使用您的程序。我可能会在以后提供示例。

Another idea ... I wrote a program that cannot be run directly, it is only ran by an external file, so you could add in a password entry section to it and encrypt password so it cannot be read very easily ,I made an executable version of a vb program to test. it writes in to slack space a character so if the program sees that value it will not run, BUT the runner program has a different character, and it changes it to that character ,and the program is designed to only let in if the character is the proper one ,made only by the runner , then when it enters it changes it back so it is not left open , I have made this sorta thing, and it does work, there is always a way to defeat any protection , the goal is to slow them down or discourage them from running or using your program if you do not want them to.I may include examples at a later date.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文