Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Avoid DLL Load

Posted on 2011-03-18
Medium Priority
Last Modified: 2012-05-11

In my app, i have some DLLs that is used as a SDK... i mean, my app has a SDK where others programmers can use it...

Anyway, some DLLs has functions where can be used outside my app, like copying it and using in another app...

What is the best way to avoid it? some idea like, link each DLL example

DLLA linked with DLLB and DLLB with DLLC etc

so, trying to load just one will show that msg like "DLLC not found"

some idea?

Question by:cebasso
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 32

Accepted Solution

Ephraim Wangoya earned 2000 total points
ID: 35168345

Statically linking them is just a headache even for you. Suppose you only wanted to distribute one DLL. That would be very limiting.

You can add code to the DLL that checks what application initiated them (Get the handle of the calling application and check for an identifier). if it is not your application, then show an error message and kill the process

Author Comment

ID: 35168367
hmm nice, like a Mutex?
the same way from prevent multiples app instance right?

ok but, in that DLL i add the code over DLL_PROCESS_ATTACH?
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35168392

Correct, check when attaching process
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

LVL 24

Expert Comment

ID: 35168452
I am sure there are many better ways but how about creating key (or list of passwords) that you store and check whenever the function is called from the DLL:

function AddIntegers(Param1 :integer; Param2 :string): string; stdcall;
  if Not Param2 = 'Allow' then // you can have list
      Result := 'Access to DLL not authorized';

  //Authorized access continues

Open in new window

That was just a simple example you can make it difficult by having internal encryption/decryption functions to make it more complicated.
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35168581

And you check the passwords against what?
It does not matter whether you encrypt a password that you store in your application, its still in the application which means its accessible any time.

Author Closing Comment

ID: 35180479
Thank you!

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question