.DLL:如何修改动态链接库(.dll)文件?

发布于 2024-12-10 08:40:31 字数 329 浏览 0 评论 0原文

我已经能够在 Visual Studio 2010 中打开 Windows 8 shsxs.dll 文件。

但它受到写保护。

现在,在 Visual Studio 中,我想知道如何修改现有图像或添加新图像 png 格式转换为 shsxs.dll

另外,我也使用 7-zip 来解压/解压它。

那么,如何将解压后的.dll 文件重新打包回.dll 文件呢?

PS:我是 Visual Studio 的新手,因此问题或标签可能看起来无关紧要。请纠正我&尽快帮我解决。

I have been able to open a Windows 8 shsxs.dll file in Visual Studio 2010.

But it's write protected.

Now, while in Visual Studio, I want to know how to modify an existing image or add a new image in
png format to shsxs.dll
.

Also, I have been a to unpack/extract it too using 7-zip.

Thus, how can I repack the unpacked .dll file back to a .dll file?

PS: I'm new to Visual Studio, so question or tag may seem irrelevant. Please correct me & help me out asap.

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

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

发布评论

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

评论(1

少钕鈤記 2024-12-17 08:40:31

前言:我还没有机会使用 Windows 8,因此此答案中的信息可能略有偏差。或者完全没用。

我认为写保护你的意思是只读。这很容易纠正。找到您的 shsxs.dll 并右键单击它。选择“属性”并取消选中“属性”部分中的“只读”复选框(如果已选中)。然后转到“安全”选项卡,然后单击“编辑”。选择您的用户名(或用户Everyone,如果存在的话)并勾选允许列中的完全访问复选框。单击“确定”。再次单击“确定”。

接下来您想知道如何修改现有图像添加 png 格式的新图像。这是两件不同的事情。

让我们首先解决修改问题。

7-Zip 无法做到这一点。你只能用它来查看DLL的内容,但不能修改它。您需要一个专门的工具来完成这项工作,我推荐 XN 资源编辑器,它基本上是一个更好的资源黑客,它曾经是程序已经编辑编译的资源。不过,我不确定它们是否适用于 Windows 8 模块。如果没有,请链接到评论中的替代方案,或者如果可以的话编辑此答案。

安装 XN 资源编辑器后,启动它并打开 shsxs.dll。左侧有资源树。展开位图子树。您应该看到一堆数字,每个数字代表 DLL 中的一个资源。展开每个子树,直到找到所需的图像。

找到图像后,您可以使用 XN Resource Editor 的内置图片编辑器对其进行内联修改。您还可以记住资源的编号,右键单击图像并选择删除资源,然后转到资源菜单并选择导入图像资源 >,找到您想要的图像。然后在 XN 资源编辑器中右键单击新导入的图像,选择“属性”并输入旧资源的编号(您还记得,对吧?),然后按“确定”。

添加新图像并没有什么不同。

这很简单,只需转到“资源”菜单并选择“导入图像资源”,找到所需的图像并单击“确定”。 完成


编辑:由于该文件来自 System32,因此我添加了有关如何授予用户对该文件的完全访问权限的说明,此外还删除了只读标志。

Preface: I haven't got a chance to work with Windows 8 yet, so the information in this answer might be slightly off. Or completely useless.

I think by write protected you mean read-only. That's easily corrected. Locate your shsxs.dll and right-click on it. Select Properties and uncheck the Read-Only checkbox in the Attributes section, if it is checked. Then go to the Security tab, and click edit. Select your username (or the user Everyone if it's there) and tick the Full access checkbox in the Allow column. Click OK. Click OK again.

Next you want to know how to modify an existing image or add a new image in png format. These are two different things.

Let's tackle the modifying first.

You can't do that with 7-Zip. You can only use it to look at the DLL's content, but you can't modify it. You need a specialized tool for the job, I recommend the XN Resource Editor, which is basically a better Resource Hacker, which used to be the program to edit already compiled resources. I'm not sure whether they work with Windows 8 modules, though. If they don't, please link to an alternative which can in the comments, or edit this answer if you can.

After you install the XN Resource Editor, start it, and open your shsxs.dll. On the left side you have the resource tree. Expand the Bitmap subtree. You should see a bunch of numbers, each one represents one resource in the DLL. Expand each subtree until you find the desired image.

Once you find your image, you can modify it inline using XN Resource Editor's built-in picture editor. You can also remember the resource's number, right-click on the Image and select Delete Resource, then go to the Resource menu and select Import Image Resource, find your desired image. Then right-click on the newly imported image in XN Resource Editor, select Properties and enter the old resource's number (you remembered it, right?) and press OK.

Adding a new Image is not that different.

It's easy, simply go to the Resource menu and select Import Image Resource, find your desired image and click OK. DONE.


Edit: Since the file came from System32, I added instructions on how to grant the user full access to the file, additionally to removing the read-only flag.

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