Viral Jain
Viral Jain

Reputation: 1014

.DLL:How to modify a Dynamic Link Library (.dll) file?

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.

Upvotes: 0

Views: 26606

Answers (1)

Raphael R.
Raphael R.

Reputation: 24274

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.

Upvotes: 4

Related Questions