Você está na página 1de 11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

Dynamiclinklibrary
FromWikipedia,thefreeencyclopedia

ThisarticleisabouttheOS/2andWindowsimplementation.Fordynamiclinkingoflibrariesin
general,seeDynamiclinker.
NottobeconfusedwithDynamicallyloadedlibrary.
Dynamiclinklibrary(alsowrittenunhyphenated),or
DLL,isMicrosoft'simplementationofthesharedlibrary
conceptintheMicrosoftWindowsandOS/2operating
systems.Theselibrariesusuallyhavethefileextension
DLL,OCX(forlibrariescontainingActiveXcontrols),or
DRV(forlegacysystemdrivers).Thefileformatsfor
DLLsarethesameasforWindowsEXEfilesthatis,
PortableExecutable(PE)for32bitand64bitWindows,
andNewExecutable(NE)for16bitWindows.Aswith
EXEs,DLLscancontaincode,data,andresources,in
anycombination.

Dynamiclinklibrary

Filenameextension .dll
Internet
mediatype

application/xmsdownload

UniformType
Identifier(UTI)

com.microsoft.windows
dynamiclinklibrary

Magicnumber

MZ

DatafileswiththesamefileformatasaDLL,butwith
Developedby
Microsoft
differentfileextensionsandpossiblycontainingonly
Containerfor
sharedlibrary
resourcesections,canbecalledresourceDLLs.
ExamplesofsuchDLLsincludeiconlibraries,
sometimeshavingtheextensionICL,andfontfiles,havingtheextensionsFONandFOT.[1]

Contents
1BackgroundforDLL
2FeaturesofDLL
2.1Memorymanagement
2.2Importlibraries
2.3Symbolresolutionandbinding
2.4Explicitruntimelinking
2.5Delayedloading
3Compilerandlanguageconsiderations
3.1Delphi
3.2MicrosoftVisualBasic
3.3CandC++
4Programmingexamples
4.1CreatingDLLexports
4.2UsingDLLimports
4.3Usingexplicitruntimelinking
4.3.1MicrosoftVisualBasic
4.3.2Delphi
4.3.3C
4.3.4Python
5ComponentObjectModel
6DLLhijacking

https://en.wikipedia.org/wiki/Dynamiclink_library

1/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

6DLLhijacking
7Seealso
8Externallinks
9References

BackgroundforDLL
ThefirstversionsofMicrosoftWindowsranprogramstogetherinasingleaddressspace.Everyprogram
wasmeanttocooperatebyyieldingtheCPUtootherprogramssothatthegraphicaluserinterface(GUI)
couldmultitaskandbemaximallyresponsive.Alloperatingsystemleveloperationswereprovidedbythe
underlyingoperatingsystem:MSDOS.AllhigherlevelserviceswereprovidedbyWindowsLibraries
"DynamicLinkLibrary".TheDrawingAPI,GDI,wasimplementedinaDLLcalledGDI.EXE,theuser
interfaceinUSER.EXE.TheseextralayersontopofDOShadtobesharedacrossallrunningWindows
programs,notjusttoenableWindowstoworkinamachinewithlessthanamegabyteofRAM,butto
enabletheprogramstocooperatewitheachother.TheGraphicsDeviceInterfacecodeinGDIneededto
translatedrawingcommandstooperationsonspecificdevices.Onthedisplay,ithadtomanipulatepixelsin
theframebuffer.Whendrawingtoaprinter,theAPIcallshadtobetransformedintorequeststoaprinter.
Althoughitcouldhavebeenpossibletoprovidehardcodedsupportforalimitedsetofdevices(likethe
ColorGraphicsAdapterdisplay,theHPLaserJetPrinterCommandLanguage),Microsoftchoseadifferent
approach.GDIwouldworkbyloadingdifferentpiecesofcode,called"devicedrivers",toworkwith
differentoutputdevices.
ThesamearchitecturalconceptthatallowedGDItoloaddifferentdevicedriversisthatwhichallowedthe
WindowsshelltoloaddifferentWindowsprograms,andfortheseprogramstoinvokeAPIcallsfromthe
sharedUSERandGDIlibraries.Thatconceptwas"dynamiclinking".
Inaconventionalnonshared"static"library,sectionsofcodearesimplyaddedtothecallingprogramwhen
itsexecutableisbuiltatthe"linking"phaseiftwoprogramscallthesameroutine,theroutineisincludedin
boththeprogramsduringthelinkingstageofthetwo.Withdynamiclinking,sharedcodeisplacedintoa
single,separatefile.Theprogramsthatcallthisfileareconnectedtoitatruntime,withtheoperating
system(or,inthecaseofearlyversionsofWindows,theOSextension),performingthebinding.
ForthoseearlyversionsofWindows(1.0to3.11),theDLLswerethefoundationfortheentireGUI.As
such,displaydriversweremerelyDLLswitha.DRVextensionthatprovidedcustomimplementationsof
thesamedrawingAPIthroughaunifieddevicedriverinterface(DDI),andtheDrawing(GDI)andGUI
(USER)APIsweremerelythefunctioncallsexportedbytheGDIandUSER,systemDLLswith.EXE
extension.
Thisnotionofbuildinguptheoperatingsystemfromacollectionofdynamicallyloadedlibrariesisacore
conceptofWindowsthatpersistsasof2015.DLLsprovidethestandardbenefitsofsharedlibraries,suchas
modularity.ModularityallowschangestobemadetocodeanddatainasingleselfcontainedDLLshared
byseveralapplicationswithoutanychangetotheapplicationsthemselves.
Anotherbenefitofmodularityistheuseofgenericinterfacesforplugins.Asingleinterfacemaybe
developedwhichallowsoldaswellasnewmodulestobeintegratedseamlesslyatruntimeintopre
existingapplications,withoutanymodificationtotheapplicationitself.Thisconceptofdynamic
extensibilityistakentotheextremewiththeComponentObjectModel,theunderpinningsofActiveX.
https://en.wikipedia.org/wiki/Dynamiclink_library

2/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

InWindows1.x,2.xand3.x,allWindowsapplicationssharedthesameaddressspaceaswellasthesame
memory.ADLLwasonlyloadedonceintothisaddressspacefromthenon,allprogramsusingthelibrary
accessedit.Thelibrary'sdatawassharedacrossalltheprograms.Thiscouldbeusedasanindirectformof
interprocesscommunication,oritcouldaccidentallycorruptthedifferentprograms.Withtheintroduction
of32bitlibrariesinWindows95everyprocessrunsinitsownaddressspace.WhiletheDLLcodemaybe
shared,thedataisprivateexceptwhereshareddataisexplicitlyrequestedbythelibrary.Thatsaid,large
swathesofWindows95,Windows98andWindowsMewerebuiltfrom16bitlibraries,whichlimitedthe
performanceofthePentiumPromicroprocessorwhenlaunched,andultimatelylimitedthestabilityand
scalabilityoftheDOSbasedversionsofWindows.
AlthoughDLLsarethecoreoftheWindowsarchitecture,theyhaveseveraldrawbacks,collectivelycalled
"DLLhell".[2]Asof2015Microsoftpromotes.NETFrameworkasonesolutiontotheproblemsofDLL
hell,althoughtheynowpromotevirtualizationbasedsolutionssuchasMicrosoftVirtualPCandMicrosoft
ApplicationVirtualization,becausetheyoffersuperiorisolationbetweenapplications.Analternative
mitigatingsolutiontoDLLhellhasbeenimplementingsidebysideassembly.

FeaturesofDLL
SinceDLLsareessentiallythesameasEXEs,thechoiceofwhichtoproduceaspartofthelinkingprocess
isforclarity,sinceitispossibletoexportfunctionsanddatafromeither.
ItisnotpossibletodirectlyexecuteaDLL,sinceitrequiresanEXEfortheoperatingsystemtoloadit
throughanentrypoint,hencetheexistenceofutilitieslikeRUNDLL.EXEorRUNDLL32.EXEwhich
providetheentrypointandminimalframeworkforDLLsthatcontainenoughfunctionalitytoexecute
withoutmuchsupport.
DLLsprovideamechanismforsharedcodeanddata,allowingadeveloperofsharedcode/datatoupgrade
functionalitywithoutrequiringapplicationstoberelinkedorrecompiled.Fromtheapplication
developmentpointofviewWindowsandOS/2canbethoughtofasacollectionofDLLsthatareupgraded,
allowingapplicationsforoneversionoftheOStoworkinalaterone,providedthattheOSvendorhas
ensuredthattheinterfacesandfunctionalityarecompatible.
DLLsexecuteinthememoryspaceofthecallingprocessandwiththesameaccesspermissionswhich
meansthereislittleoverheadintheirusebutalsothatthereisnoprotectionforthecallingEXEiftheDLL
hasanysortofbug.

Memorymanagement
InWindowsAPI,theDLLfilesareorganizedintosections.Eachsectionhasitsownsetofattributes,such
asbeingwritableorreadonly,executable(forcode)ornonexecutable(fordata),andsoon.
ThecodeinaDLLisusuallysharedamongalltheprocessesthatusetheDLLthatis,theyoccupyasingle
placeinphysicalmemory,anddonottakeupspaceinthepagefile.Ifthephysicalmemoryoccupiedbya
codesectionistobereclaimed,itscontentsarediscarded,andlaterreloadeddirectlyfromtheDLLfileas
necessary.

https://en.wikipedia.org/wiki/Dynamiclink_library

3/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

Incontrasttocodesections,thedatasectionsofaDLLareusuallyprivatethatis,eachprocessusingthe
DLLhasitsowncopyofalltheDLL'sdata.Optionally,datasectionscanbemadeshared,allowinginter
processcommunicationviathissharedmemoryarea.However,becauseuserrestrictionsdonotapplytothe
useofsharedDLLmemory,thiscreatesasecurityholenamely,oneprocesscancorrupttheshareddata,
whichwilllikelycauseallothersharingprocessestobehaveundesirably.Forexample,aprocessrunning
underaguestaccountcaninthiswaycorruptanotherprocessrunningunderaprivilegedaccount.Thisisan
importantreasontoavoidtheuseofsharedsectionsinDLLs.
IfaDLLiscompressedbycertainexecutablepackers(e.g.UPX),allofitscodesectionsaremarkedasread
andwrite,andwillbeunshared.Readandwritecodesections,muchlikeprivatedatasections,areprivate
toeachprocess.ThusDLLswithshareddatasectionsshouldnotbecompressediftheyareintendedtobe
usedsimultaneouslybymultipleprograms,sinceeachprograminstancewouldhavetocarryitsowncopy
oftheDLL,resultinginincreasedmemoryconsumption.

Importlibraries
Likestaticlibraries,importlibrariesforDLLsarenotedbythe.libfileextension.Forexample,
kernel32.dll,theprimarydynamiclibraryforWindows'basefunctionssuchasfilecreationandmemory
management,islinkedviakernel32.lib.
Linkingtodynamiclibrariesisusuallyhandledbylinkingtoanimportlibrarywhenbuildingorlinkingto
createanexecutablefile.Thecreatedexecutablethencontainsanimportaddresstable(IAT)bywhichall
DLLfunctioncallsarereferenced(eachreferencedDLLfunctioncontainsitsownentryintheIAT).At
runtime,theIATisfilledwithappropriateaddressesthatpointdirectlytoafunctionintheseparately
loadedDLL.

Symbolresolutionandbinding
EachfunctionexportedbyaDLLisidentifiedbyanumericordinalandoptionallyaname.Likewise,
functionscanbeimportedfromaDLLeitherbyordinalorbyname.Theordinalrepresentsthepositionof
thefunction'saddresspointerintheDLLExportAddresstable.Itiscommonforinternalfunctionstobe
exportedbyordinalonly.FormostWindowsAPIfunctionsonlythenamesarepreservedacrossdifferent
Windowsreleasestheordinalsaresubjecttochange.Thus,onecannotreliablyimportWindowsAPI
functionsbytheirordinals.
Importingfunctionsbyordinalprovidesonlyslightlybetterperformancethanimportingthembyname:
exporttablesofDLLsareorderedbyname,soabinarysearchcanbeusedtofindafunction.Theindexof
thefoundnameisthenusedtolookuptheordinalintheExportOrdinaltable.In16bitWindows,thename
tablewasnotsorted,sothenamelookupoverheadwasmuchmorenoticeable.
ItisalsopossibletobindanexecutabletoaspecificversionofaDLL,thatis,toresolvetheaddressesof
importedfunctionsatcompiletime.Forboundimports,thelinkersavesthetimestampandchecksumofthe
DLLtowhichtheimportisbound.AtruntimeWindowscheckstoseeifthesameversionoflibraryis
beingused,andifso,Windowsbypassesprocessingtheimports.Otherwise,ifthelibraryisdifferentfrom
theonewhichwasboundto,Windowsprocessestheimportsinanormalway.

https://en.wikipedia.org/wiki/Dynamiclink_library

4/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

Boundexecutablesloadsomewhatfasteriftheyareruninthesameenvironmentthattheywerecompiled
for,andexactlythesametimeiftheyareruninadifferentenvironment,sothere'snodrawbackforbinding
theimports.Forexample,allthestandardWindowsapplicationsareboundtothesystemDLLsoftheir
respectiveWindowsrelease.Agoodopportunitytobindanapplication'simportstoitstargetenvironment
isduringtheapplication'sinstallation.Thiskeepsthelibraries'bound'untilthenextOSupdate.Itdoes,
however,changethechecksumoftheexecutable,soitisnotsomethingthatcanbedonewithsigned
programs,orprogramsthataremanagedbyaconfigurationmanagementtoolthatuseschecksums(suchas
MD5checksums)tomanagefileversions.AsmorerecentWindowsversionshavemovedawayfrom
havingfixedaddressesforeveryloadedlibrary(forsecurityreasons),theopportunityandvalueofbinding
anexecutableisdecreasing.

Explicitruntimelinking
DLLfilesmaybeexplicitlyloadedatruntime,aprocessreferredtosimplyasruntimedynamiclinkingby
Microsoft,byusingtheLoadLibrary(orLoadLibraryEx)APIfunction.TheGetProcAddressAPIfunctionis
usedtolookupexportedsymbolsbyname,andFreeLibrarytounloadtheDLL.Thesefunctionsare
analogoustodlopen,dlsym,anddlcloseinthePOSIXstandardAPI.
/*LSPaperdrawusingOLE2functionifavailableonclient*/
HINSTANCEole;
ole=LoadLibrary("OLE2.DLL");
if(ole!=NULL){
FARPROColedraw=GetProcAddress(ole,"OleDraw");
if(oledraw!=NULL)
(*oledraw)(pUnknown,dwAspect,hdcDraw,lprcBounds);
FreeLibrary(ole);
}

Theprocedureforexplicitruntimelinkingisthesameinanylanguagethatsupportspointerstofunctions,
sinceitdependsontheWindowsAPIratherthanlanguageconstructs.

Delayedloading
Normally,anapplicationthatwaslinkedagainstaDLLsimportlibrarywillfailtostartiftheDLLcannot
befound,becauseWindowswillnotruntheapplicationunlessitcanfindalloftheDLLsthatthe
applicationmayneed.Howeveranapplicationmaybelinkedagainstanimportlibrarytoallowdelayed
loadingofthedynamiclibrary.[3]InthiscasetheoperatingsystemwillnottrytofindorloadtheDLLwhen
theapplicationstartsinstead,astubisincludedintheapplicationbythelinkerwhichwilltrytofindand
loadtheDLLthroughLoadLibraryandGetProcAddresswhenoneofitsfunctionsiscalled.IftheDLL
cannotbefoundorloaded,orthecalledfunctiondoesnotexist,theapplicationwillgenerateanexception,
whichmaybecaughtandhandledappropriately.Iftheapplicationdoesnothandletheexception,itwillbe
caughtbytheoperatingsystem,whichwillterminatetheprogramwithanerrormessage.
Thedelayloadingmechanismalsoprovidesnotificationhooks,allowingtheapplicationtoperform
additionalprocessingorerrorhandlingwhentheDLLisloadedand/oranyDLLfunctioniscalled.

Compilerandlanguageconsiderations
https://en.wikipedia.org/wiki/Dynamiclink_library

5/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

Delphi
Intheheadingofasourcefile,thekeywordlibraryisusedinsteadofprogram.Attheendofthefile,the
functionstobeexportedarelistedinexportsclause.
DelphidoesnotneedLIBfilestoimportfunctionsfromDLLstolinktoaDLL,theexternalkeywordis
usedinthefunctiondeclarationtosignaltheDLLname,followedbynametonamethesymbol(ifdifferent)
orindextoidentifytheindex.

MicrosoftVisualBasic
InVisualBasic(VB),onlyruntimelinkingissupportedbutinadditiontousingLoadLibraryand
GetProcAddressAPIfunctions,declarationsofimportedfunctionsareallowed.
WhenimportingDLLfunctionsthroughdeclarations,VBwillgeneratearuntimeerroriftheDLLfile
cannotbefound.Thedevelopercancatchtheerrorandhandleitappropriately.
WhencreatingDLLsinVB,theIDEwillonlyallowyoutocreateActiveXDLLs,howevermethodshave
beencreated[4]toallowtheusertoexplicitlytellthelinkertoincludea.DEFfilewhichdefinestheordinal
positionandnameofeachexportedfunction.ThisallowstheusertocreateastandardWindowsDLLusing
VisualBasic(Version6orlower)whichcanbereferencedthrougha"Declare"statement.

CandC++
MicrosoftVisualC++(MSVC)providesseveralextensionstostandardC++whichallowfunctionstobe
specifiedasimportedorexporteddirectlyintheC++codethesehavebeenadoptedbyotherWindowsC
andC++compilers,includingWindowsversionsofGCC.Theseextensionsusetheattribute__declspec
beforeafunctiondeclaration.NotethatwhenCfunctionsareaccessedfromC++,theymustalsobe
declaredasextern"C"inC++code,toinformthecompilerthattheClinkageshouldbeused.[5]
Besidesspecifyingimportedorexportedfunctionsusing__declspecattributes,theymaybelistedin
IMPORTorEXPORTSsectionoftheDEFfileusedbytheproject.TheDEFfileisprocessedbythelinker,
ratherthanthecompiler,andthusitisnotspecifictoC++.
DLLcompilationwillproducebothDLLandLIBfiles.TheLIBfileisusedtolinkagainstaDLLatcompile
timeitisnotnecessaryforruntimelinking.UnlessyourDLLisaComponentObjectModel(COM)
server,theDLLfilemustbeplacedinoneofthedirectorieslistedinthePATHenvironmentvariable,inthe
defaultsystemdirectory,orinthesamedirectoryastheprogramusingit.COMserverDLLsareregistered
usingregsvr32.exe,whichplacestheDLL'slocationanditsgloballyuniqueID(GUID)intheregistry.
ProgramscanthenusetheDLLbylookingupitsGUIDintheregistrytofinditslocation.

Programmingexamples
CreatingDLLexports
ThefollowingexamplesshowlanguagespecificbindingsforexportingsymbolsfromDLLs.
https://en.wikipedia.org/wiki/Dynamiclink_library

6/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

Delphi
libraryExample;
//functionthataddstwonumbers
functionAddNumbers(a,b:Double):Double;cdecl;
begin
Result:=a+b;
end;
//exportthisfunction
exportsAddNumbers;
//DLLinitializationcode:nospecialhandlingneeded
begin
end.

C
#include<windows.h>
//DLLentryfunction(calledonload,unload,...)
BOOLAPIENTRYDllMain(HANDLEhModule,DWORDdwReason,LPVOIDlpReserved)
{
returnTRUE;
}
//Exportedfunctionaddstwonumbers
extern"C"__declspec(dllexport)doubleAddNumbers(doublea,doubleb)
{
returna+b;
}

UsingDLLimports
Thefollowingexamplesshowhowtouselanguagespecificbindingstoimportsymbolsforlinkingagainst
aDLLatcompiletime.
Delphi
{$APPTYPECONSOLE}
programExample;
//importfunctionthataddstwonumbers
functionAddNumbers(a,b:Double):Double;cdecl;external'Example.dll';
//mainprogram
var
R:Double;
begin
R:=AddNumbers(1,2);
Writeln('Theresultwas:',R);
end.

C
https://en.wikipedia.org/wiki/Dynamiclink_library

7/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

MakesureyouincludeExample.libfile(assumingthatExample.dllisgenerated)intheproject(Add
ExistingItemoptionforProject!)beforestaticlinking.ThefileExample.libisautomaticallygeneratedby
thecompilerwhencompilingtheDLL.Notexecutingtheabovestatementwouldcauselinkingerrorasthe
linkerwouldnotknowwheretofindthedefinitionofAddNumbers.YoualsoneedtocopytheDLL
Example.dlltothelocationwherethe.exefilewouldbegeneratedbythefollowingcode.
#include<windows.h>
#include<stdio.h>
//Importfunctionthataddstwonumbers
extern"C"__declspec(dllimport)doubleAddNumbers(doublea,doubleb);
intmain(intargc,char*argv[])
{
doubleresult=AddNumbers(1,2);
printf("Theresultwas:%f\n",result);
return0;
}

Usingexplicitruntimelinking
Thefollowingexamplesshowhowtousetheruntimeloadingandlinkingfacilitiesusinglanguagespecific
WindowsAPIbindings.
MicrosoftVisualBasic
OptionExplicit
DeclareFunctionAddNumbersLib"Example.dll"_
(ByValaAsDouble,ByValbAsDouble)AsDouble
SubMain()

DimResultAsDouble

Result=AddNumbers(1,2)

Debug.Print"Theresultwas:"&Result
EndSub

Delphi
programExample;
{$APPTYPECONSOLE}
usesWindows;
var
AddNumbers:function(a,b:integer):Double;cdecl;
LibHandle:HMODULE;
begin
LibHandle:=LoadLibrary('example.dll');
ifLibHandle<>0then
AddNumbers:=GetProcAddress(LibHandle,'AddNumbers');
ifAssigned(AddNumbers)then
Writeln('1+2=',AddNumbers(1,2));
Readln;
end.

C
https://en.wikipedia.org/wiki/Dynamiclink_library

8/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

#include<windows.h>
#include<stdio.h>
//DLLfunctionsignature
typedefdouble(*importFunction)(double,double);
intmain(intargc,char**argv)
{

importFunctionaddNumbers;

doubleresult;
HINSTANCEhinstLib;

//LoadDLLfile
hinstLib=LoadLibrary(TEXT("Example.dll"));
if(hinstLib==NULL){

printf("ERROR:unabletoloadDLL\n");

return1;
}

//Getfunctionpointer
addNumbers=(importFunction)GetProcAddress(hinstLib,"AddNumbers");
if(addNumbers==NULL){

printf("ERROR:unabletofindDLLfunction\n");

FreeLibrary(hinstLib);

return1;
}

//Callfunction.
result=addNumbers(1,2);

//UnloadDLLfile
FreeLibrary(hinstLib);

//Displayresult
printf("Theresultwas:%f\n",result);

return0;

Python
importctypes
my_dll=ctypes.cdll.LoadLibrary("Example.dll")
#Thefollowing"restype"methodspecificationisneededtomake
#Pythonunderstandwhattypeisreturnedbythefunction.
my_dll.AddNumbers.restype=ctypes.c_double
p=my_dll.AddNumbers(ctypes.c_double(1.0),ctypes.c_double(2.0))
print"Theresultwas:",p

ComponentObjectModel
TheComponentObjectModel(COM)definesabinarystandardtohosttheimplementationofobjectsin
DLLandEXEfiles.Itprovidesmechanismstolocateandversionthosefilesaswellasalanguage
independentandmachinereadabledescriptionoftheinterface.HostingCOMobjectsinaDLLismore

https://en.wikipedia.org/wiki/Dynamiclink_library

9/11

9/22/2015

DynamiclinklibraryWikipedia,thefreeencyclopedia

lightweightandallowsthemtoshareresourceswiththeclientprocess.ThisallowsCOMobjectsto
implementpowerfulbackendstosimpleGUIfrontendssuchasVisualBasicandASP.Theycanalsobe
programmedfromscriptinglanguages.

DLLhijacking
DuetoavulnerabilitycommonlyknownasDLLhijacking,manyprogramswillloadandexecutea
maliciousDLLcontainedinthesamefolderasafileonaremotesystem.Thevulnerabilitywasdiscovered
byHDMoore,whohaspublishedanexploitfortheopensourcebasedpenetrationtestingsoftware,
Metasploit.[6]

Seealso
DependencyWalker,autilitywhichdisplaysexportedandimportedfunctionsofDLLandEXEfiles
Dynamiclibrary
Library(computing)
Linker(computing)
Loader(computing)
Objectfile
Sharedlibrary
Staticlibrary
DLLHell

Externallinks
dllexport,dllimport(http://msdn.microsoft.com/library/default.asp?url=/library/en
us/vclang/html/_pluslang_the_dllexport_and_dllimport_attributes.asp)onMSDN
DynamicLinkLibraries(http://msdn2.microsoft.com/enus/library/ms682589.aspx)onMSDN
WhatisaDLL?(http://support.microsoft.com/kb/815065)onMicrosoftsupportsite
DynamicLinkLibraryFunctions(http://msdn2.microsoft.com/enus/library/ms682599.aspx)on
MSDN
MicrosoftPortableExecutableandCommonObjectFileFormatSpecification
(http://www.microsoft.com/whdc/system/platform/firmware/PECOFF.mspx)
Microsoftspecificationfordllfiles(http://download.microsoft.com/download/9/c/5/9c5b21678017
4bae9fded599bac8184a/pecoff_v8.docx)

References
Hart,Johnson.WindowsSystemProgrammingThirdEdition.AddisonWesley,2005.ISBN0321
256190
Rector,Brentetal.Win32Programming.AddisonWesleyDevelopersPress,1997.ISBN0201
634929.
1. MicrosoftCorporation."CreatingaResourceOnlyDLL"(http://msdn.microsoft.com/en
US/library/24b2tcy0(v=VS.80).aspx).MicrosoftDeveloperNetworkLibrary.
2. "TheEndofDLLHell"(http://web.archive.org/web/20080506103746/http://msdn.microsoft.com/en
us/library/ms811694.aspx).MicrosoftCorporation.Archivedfromtheoriginal(http://msdn.microsoft.com/en
https://en.wikipedia.org/wiki/Dynamiclink_library

10/11

9/22/2015

3.
4.
5.
6.

DynamiclinklibraryWikipedia,thefreeencyclopedia

us/library/ms811694.aspx)on20080506.Retrieved20090711.
"LinkerSupportforDelayLoadedDLLs"(http://msdn.microsoft.com/enus/library/151kt790.aspx).Microsoft
Corporation.Retrieved20090711.
Petrusha,Ron(20050426)."CreatingaWindowsDLLwithVisualBasic"
(http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/create_dll.html?page=1).O'ReillyMedia.
Retrieved20090711.
MSDN(http://msdn.microsoft.com/enus/library/0603949d%28VS.80%29.aspx),UsingexterntoSpecify
Linkage
TechWorld:HackingtoolkitpublishesDLLhijackingexploit
(http://www.techworld.com.au/article/358035/hacking_toolkit_publishes_dll_hijacking_exploit)

Retrievedfrom"https://en.wikipedia.org/w/index.php?title=Dynamiclink_library&oldid=680189169"
Categories: Computerlibraries Windowsadministration Computerfileformats
Thispagewaslastmodifiedon9September2015,at08:23.
TextisavailableundertheCreativeCommonsAttributionShareAlikeLicenseadditionaltermsmay
apply.Byusingthissite,youagreetotheTermsofUseandPrivacyPolicy.Wikipediaisa
registeredtrademarkoftheWikimediaFoundation,Inc.,anonprofitorganization.

https://en.wikipedia.org/wiki/Dynamiclink_library

11/11

Você também pode gostar