views:

452

answers:

3

I have a third party dll that I want to change the symbol names. Is this possible? I dont want the competition to know what component my product uses. I don't have the source for the dll.

A: 

Not without modifying the binary, and if the DLL is signed then this would invalidate the signature.

Even if it isn't signed it would probably violate the license agreement that governs the use of the DLL.

Rob Walker
do you know any program that does this? The license doesn't say anything and I doubt they care. I paid for the license. Changing a few names is harmless.
Memb
I doubt there are any programs available to do this. The 'easiest' way would likely be to edit the export table of the dll with a hex editor and replace the names with strings of the same length. You'll have to also adjust the export lib you are linking against as well. All tool like http://texe.codeplex.com/ might help out.
Rob Walker
Thanks. I'll try the hex editor.
Memb
The license doesn't *have* to say anything, Memb. The default is "all rights reserved." The license *relaxes* the default restrictions, so if the license doesn't grant permission to do something, and the copyright law in your country doesn't grant it, then you're not allowed to do it. Whether you paid money for it is irrelevant. You're not in a position to judge whether the license granter cares. Have you asked?
Rob Kennedy
Rob, not everyone must share your value system. Maybe Memb does not care about some copyright law issues? I also think that changing names in symbol table would not harm anyone. He will brake the license however, but I think in such case it's not worse than saying f***ck or photographing random person without a permission
doc
+1  A: 

Symbol table is required for binding executable with dll during linking and runtime. It usually contains decorated function names and ordinals. It is possible to use ordinals only. If you are building library you can define .def file to have a control over symbol tables. But if this is pre-built 3rd party library, it may be very hard way to go. Of course everything is possible but I doubt it is worth your efforts.

If you are desparate, I would try altering a letter in decorated function name in hex editor, lookup this function ordinal value and then try using GetProcAddress with ordinal of this function.

doc
+1  A: 

You might look at PE Explorer. I'm not sure it will do what you want, but maybe.

Steve Fallows