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

x
?
Solved

Avoid DLL Load

Posted on 2011-03-18
6
Medium Priority
?
367 Views
Last Modified: 2012-05-11
Hello,

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?

Regards
0
Comment
Question by:cebasso
[X]
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
6 Comments
 
LVL 32

Accepted Solution

by:
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
0
 
LVL 4

Author Comment

by:cebasso
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?
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35168392

Correct, check when attaching process
0
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

by:jimyX
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;
begin
  if Not Param2 = 'Allow' then // you can have list
    begin
      Result := 'Access to DLL not authorized';
      exit;
    end;

  //Authorized access continues
  ...
end;

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.
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 35168581

@jimyx
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.
0
 
LVL 4

Author Closing Comment

by:cebasso
ID: 35180479
Thank you!
0

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