需要帮助解决我的疑虑 [英] Need help in solving my doubts

查看:71
本文介绍了需要帮助解决我的疑虑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生,我有几个疑问(特别是在C / C ++中)你可以帮我编程。这是我的疑惑,



疑惑1:

有没有办法在运行时将数据存储在可执行文件中。

例如在C中如果我创建一个简单的数据库,要求员工输入他的详细信息并且可以看到他的个人资料随时可用。



我做了什么?

据我所知(目前)我会为每位员工创建一个档案每当他输入他的ID时,它都可以打开特定文件并使用文件处理显示详细信息。但是如何将员工详细信息存储在可执行文件中。



有没有任何使用的功能?



怀疑2:

如何让我的程序安装在电脑上?

例如,如果我构建一个简单的程序,它会创建一个可执行文件(.exe)。我使用依赖walker复制了所有可执行文件的导入,并使我的程序在另一台计算机上运行,​​甚至在我构建程序的同一台计算机上运行。但是这台计算机都没有安装。



我做了什么?

1.在程序文件夹中手动创建了一个文件夹,但是我无法在控制面板的卸载窗口中找到我的程序。

2.我使用相同程序但没有用。



怀疑3:



如何使我的程序通过认证?



例如,当我显示我的程序时,它会提示用户获得管理员权限。我发现发布者:未知如何我能说出我的名字吗?



我做了什么?



我承认了。这是我所不知道的(目前)。



由于我的英语很差,我找不到我想要的东西。



请帮助我。



谢谢。

解决方案

  1. 没办法。在某些过时的操作系统中可能会出现这种情况,但在某些现代广泛使用的操作系存储在可执行模块中的内容只能是只读的。当任何可执行模块被加载执行时(任何PE文件; .EXE,.DLL和其他类型的PE文件之间没有区别,它都是相同的),它的文件被锁定,不能以任何方式修改;此锁定与文件系统权限或类似内容无关。



    您应该了解这是非常重要且基本的安全功能。
  2. 首先要考虑的是避免安装。在大多数情况下,您可以通过复制输出目录的内容来部署产品(不包括用于调试的一些文件,如果有的话)。实际上,这是最好的部署方式;后来,甚至微软也开始鼓励它。在现代文化中,这种部署通常被称为便携式,特别是在需要安装选项时。它是便携式的,因为人们可以随时在USB驱动器或SD卡上保存副本并立即在任何计算机上使用,但也可以通过复制到其他地方来部署。



    只有在必须更改系统配置中必不可少的内容时才真正需要安装。只有在卸载对于从产品中清理系统很重要时,安装才是重要的。例如,您可以注册一些文件类型,修改系统菜单,在本地防火墙中创建排除等等。



    对于安装开发,我强烈建议开源WiX:

    WiX - 维基百科,免费的百科全书 [ ^ ],

    WiX工具集 [ ^ ]。



    这是第一个正式的微软开源项目,第一个在外部网站上发布;这是非常合法的产品,完全符合MSBuild项目类型的官方标准。它的Visual Studio集成也非常好。



    我希望您提醒使用许多其他安装工具,但首先,安装项目类型与旧版Visual Studio捆绑在一起。由于一些很好的理由,微软将其从更高版本中逐步淘汰。从标准和稳健性的角度来看,它可以工作,但并不属于Visual Studio。
  3. 这取决于你所谓的认证。它可能只是一种民主,我不会注意,或者可能是使用基于公钥加密数字证书。在这种情况下,这是安装的一项重要功能,可帮助您的用户将您的产品标识为可信任。从技术上讲,您可以自己轻松生成证书并验证您的安装(以及您的一些程序集或其他组件)。但是用户如何知道这个认证不是假的?原则上,某些恶意艺术家可以创建您的软件的虚假版本,并将其用于用户系统上的某些恶意活动,例如间谍活动。为了避免这种情况,用户需要一种根据某种权限检查证书的方法。



    这就是为什么,如果你真的想要普通公众用户使用的证书,您必须从证书颁发机构购买证书。你可以在这里阅读这个问题:

    公钥证书 - 维基百科,免费的百科全书 [ ^ ],

    公共密钥基础设施 - 维基百科,免费的百科全书 [ ^ ],

    公开 - 密钥加密 - 维基百科,免费的百科全书 [ ^ ],

    证书颁发机构 - 维基百科,免费的百科全书 [ ^ ]。





-SA

引用:

怀疑1:

有没有办法在运行时将数据存储在可执行文件中时间。

例如在C中如果我创建一个简单的数据库,要求员工输入他的详细信息并可以随时查看他的个人资料。



否。可执行文件在运行时被锁定。代码运行时无法写入文件。



此外,将数据写入.EXE的问题非常复杂。



引用:

我做了什么?

据我所知(目前)我会为每个员工创建一个文件,每当他输入他的ID时,它都可以打开特定文件并使用文件处理显示详细信息。但是如何将员工详细信息存储在可执行文件中。



这根本没有意义。我不知道键入他的ID可以打开特定文件...的意思。键入ID在哪里?在这个.EXE中的应用程序中你是自定义的吗?



引用:

怀疑3:



如何让我的程序通过认证?



例如当我表现出来时程序它提示用户获得管理员权限。在那里我发现发布者:未知我如何提供我的名字?



由谁和为什么目的认证?应用程序显然需要管理员权限才能运行,但是你做了什么来实现这一点?你在项目中创建了一个清单吗?您是否在代码中执行了某些操作,例如尝试将某些内容写入HKEY_LOCAL_MACHINE注册表?这个应用程序做了什么?



签署代码以填写发布者字段并不意味着它不会要求管理员权限。


1。不,不好主意,使用数据库,一个文件,其中包含易于搜索,排序,更新等形式的所有信息。



2. < a href =https://en.wikipedia.org/wiki/List_of_installation_software>安装软件列表 - 维基百科,免费的百科全书 [ ^ ]。



3. 数字签名软件 [ ^ ]。


Sir, I have several doubts(especially in C/C++) in programming could you please help me.Here are my doubts,

Doubt 1:
Is there any way to store a data inside an executable on run time.
For example in C If I create a simple database which asks an employee to enter his details and can see his profile whenever he wants.

what I have did?
To my knowledge(at present) I would create a file for every employee and whenever he types his Id it can open the specific file and show the details using file handling.But how can I store the employee details within the executable.

Is there any function to use?

Doubt 2:
How to make my program get installed on the computer?
For example if I build a simple program it creates an executable(.exe). I copied all the imports of my executable using dependency walker and made my program to run on another computer or even the same computer in which I build the program.But in neither of this computer it does install.

What I have did?
1. Manually created a folder in program files folder but I cant find my program in the uninstall window of my control panel.
2. I did the same using program but of no use.

Doubt 3:

How to make my program certified?

For example when I manifest my program it prompts the user for administrator permission.In that I found "publisher: unknown" How can I give my name ?

what I have did?

I admit it. It is beyond my knowledge(at present).

Since my English is poor I could not find exactly what I want.

Kindly help me with this.

Thank you.

解决方案

  1. No way. It was possible in some obsolete OS, but hardly in some modern widely used OS. What is stored in an executable module can only be read-only. When any executable module is loaded for execution (any PE file; there is no difference between .EXE, .DLL and other kinds of PE files, it's all the same), its file is locked and cannot be modified by any means; this locking is not related to file system permissions or anything like that.

    You should understand that this is very important and fundamental safety feature.
  2. First thing to consider is to avoid installation. In most cases, you can deploy the product by copying the content of you output directory (excluding some files used for debugging, if any). Actually, this is the best way of deployment; later, even Microsoft started to encourage it. In modern culture, this kind of deployment is often called "portable", especially when installation option is required. It is portable, because one can always keep a copy on a USB drive or a SD card and use on any computer immediately, but can also be "deployed" by copying elsewhere.

    You really need installation only if you have to change something essential in system configuration. Installation is important only when the uninstallation is important to clean up the system from your product. For example, you may register some file types, modify system menu, create an exclusion in the local firewall, and so on.

    For development of installations, I strongly recommend open-source WiX:
    WiX - Wikipedia, the free encyclopedia[^],
    WiX Toolset[^].

    This is a first official Microsoft open-source project, the first one released on an external Web site; and this is really legitimate product, fully compliant with the official standard for MSBuild project type. It's Visual Studio integration is also very good.

    I would like you to warn about using many other installation tools, but first of all, the "Setup" project type bundled with older versions of Visual Studio. Microsoft phased it out from later version for some very good reasons. It works, but not really belongs to Visual Studio, from the point of view of standards and robustness.
  3. It depends on what you call "certification". It could be just bуреаurocracy, which I would not pay attention, or t could be the use of digital certificate based on public-key cryptography. In this case, this is an important feature of an installation which helps your user to identify your product as trusted. Technically speaking, you can easily generate a certificate by yourself and certify your installation (and some of your assemblies or other components as well). But how a user can know that this certification is not fake? In principle, some malicious artist can create a fake version of your software and use it for some malicious activity on the user's system, such as spying. To avoid such things, the user needs a way of checking up your certificate against some authority.

    That's why, if you really want a certificate used by general-public users, you have to purchase the certificate from certificate authority. You can read on this matter here:
    Public key certificate - Wikipedia, the free encyclopedia[^],
    Public key infrastructure - Wikipedia, the free encyclopedia[^],
    Public-key cryptography - Wikipedia, the free encyclopedia[^],
    Certificate authority - Wikipedia, the free encyclopedia[^].



—SA


Quote:

Doubt 1:
Is there any way to store a data inside an executable on run time.
For example in C If I create a simple database which asks an employee to enter his details and can see his profile whenever he wants.


No. Executables are locked while they are running. There is no way to write to the file while the code is running.

Also, the problem of writing data to the .EXE is hideously complex.

Quote:

what I have did?
To my knowledge(at present) I would create a file for every employee and whenever he types his Id it can open the specific file and show the details using file handling.But how can I store the employee details within the executable.


This makes no sense at all. I have no idea what the "types his ID it can open the specific file..." means. Types an ID where? In the application that is in this .EXE you're customizing?

Quote:

Doubt 3:

How to make my program certified?

For example when I manifest my program it prompts the user for administrator permission.In that I found "publisher: unknown" How can I give my name ?


Certified by who and for what purpose? The application apparently requires admin privileges to run, but what did you do to make that happen? Did you create a manifest in the project? Did you do something in the code, like try to write something to the HKEY_LOCAL_MACHINE registry? What does this app do?

Signing your code so that the publisher field is filled in does not mean that it won't ask for admin permissions.


1. No, bad idea, use a database, one single file that holds all the information in a form that is easy to search, sort, update etc.

2. List of installation software - Wikipedia, the free encyclopedia[^].

3. Digitally Signed Software[^].


这篇关于需要帮助解决我的疑虑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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