I have a DLL file that I purchased (Without the Source Code) and I'm linking it to my application, simply by using "LoadLibrary("file.dll")", then it imports a function that gets an unique ID of the computer. Now let's say that our hacker detected the name of this function and now he's creating a new dll file, with the same name and the same function's name in it. His new DLL file will be replaced (simply by grabbing his dll to the directory and replacing with mine) and the function of the unique ID is available but returns nothing. So now my application gets a blank unique ID and the hacker got out of my hands.
Any ideas how to prevent it? my project is programmed on C++.
Thanks in advance.
You could ask the company from which you get the DLL to provide a LIB of this DLL. Then you could statically link to this LIB. When doing this, the code of the library would be part of your code and thus transparent to hooking!.