0

okay, so i dont really know much about DLLs. but i need to edit some of them. ones that seem like archive files. such as: firefox's xul.dll, windows/twain_32.dll

when i tried to open them in .NET Reflector, it couldnt open them. and a really downvoted answer on here made me realize they can be opened with 7zip, and seem to have files inside. i can extract the files, but cant edit the dll, and i dont know how to create a dll like this. i dont have visual c++ or basic, and i dont know if i could do this with them.

thank you in advance, or how to say

1 Answers1

1

A dll file usually contains program code (that is: binary code you can not easily understand). Some dll files may also contain resources, which can be sometimes edited with a resource editor (such as ResourceHacker).

dll files are no archives and their primary usage does not include holding files. Resources normally are rather small data elements such as icons.

Edit: If you open a dll file in 7zip, you will see some virtual files (which are no real files but sections of the binary object file, see symbol table and relocation table in object file for example) along with a virtual folder .rscs (abbreviation for "resources") that contains the mentioned resources you can edit with a resource editor. Again, remember these are not files. 7zip only displays them in a way you may think of files.

The object code inside of .text, .data and .reloc contains binary program code and initialization data along with the reallocation table. It makes no sense to edit those information unless you use a disassembler, can understand the generated assembler code, know about the pitfalls of disassembling, make senseful changes and are able to reassemble the code.

Not that even if you did so, you'd apply the disassembler to the whole object file instead of single sections.

Community
  • 1
  • 1
urzeit
  • 2,863
  • 20
  • 36
  • i tried with resource hacker, but it can only edit files in the .rsrc folder inside the dlls if i didnt miss something. tried others like it and they do the same – Kovács János Mar 10 '15 at 16:27
  • As I said, dll files are no archives but program code. What type of data do you want to modify? – urzeit Mar 11 '15 at 06:55
  • i want to modify what looks like an individual file inside the dll when opened with 7zip for example. i can edit the dll using a hex editor, but i cant distinguish anything that way. and i cant open it with .NET reflector or such. – Kovács János Mar 11 '15 at 07:10
  • they can be extracted with 7zip though, even if they arent files.so if I could compile them back in a dll after removing from them, or editing them, they should work, right? and how to actually use a disassembler in these cases? as I wrote, they cant be opened with .NET reflector, ILSpy and similar programs. – Kovács János Mar 11 '15 at 11:00
  • If you don't know how to use a disassembler, you'll not be able to understand it's outputs. I don't so, either... sorry. – urzeit Mar 11 '15 at 11:29
  • but by disassembler you mean programs like i listed, right? they all wrtite its not a .NET module – Kovács János Mar 11 '15 at 12:00
  • The dll files you listed are no .NET libraries but PE binaries (while others are .NET libraries). You might have a look at PE Explorer. – urzeit Mar 11 '15 at 12:25
  • @KovácsJános: By the way: You need to check the licence/eula of the product containing that dlls. It might be prohibited to disassemble the code. – urzeit Mar 11 '15 at 12:31
  • how can i edit the dll with PE Explorer though? isnt there a way to decompile or decrypt the dll? – Kovács János Mar 12 '15 at 10:35
  • The program description says so (assuming you meant disassemble and not decompile). Didn't try it by myself. By the way, dlls are not *crypted*. – urzeit Mar 12 '15 at 10:37