内存加载动态库MemoryLoadLibrary有例子。
/**MemoryDLLloadingcode*Version0.0.3**Copyright(c)2004-2013byJoachimBauch/mail@joachim-bauch.de*http://www.joachim-bauch.de**ThecontentsofthisfilearesubjecttotheMozillaPublicLicenseVersion*2.0(the"License");youmaynotusethisfileexceptincompliancewith*theLicense.YoumayobtainacopyoftheLicenseat*http://www.mozilla.org/MPL/**SoftwaredistributedundertheLicenseisdistributedonan"ASIS"basis,*WITHOUTWARRANTYOFANYKIND,eitherexpressorimplied.SeetheLicense*forthespecificlanguagegoverningrightsandlimitationsunderthe*License.**TheOriginalCodeisMemoryModule.h**TheInitialDeveloperoftheOriginalCodeisJoachimBauch.**PortionscreatedbyJoachimBauchareCopyright(C)2004-2013*JoachimBauch.AllRightsReserved.**/#ifndef__MEMORY_MODULE_HEADER#define__MEMORY_MODULE_HEADER#includetypedefvoid*HMEMORYMODULE;typedefvoid*HMEMORYRSRC;typedefvoid*HCUSTOMMODULE;#ifdef__cplusplusextern"C"{#endiftypedefHCUSTOMMODULE(*CustomLoadLibraryFunc)(LPCSTR,void*);typedefFARPROC(*CustomGetProcAddressFunc)(HCUSTOMMODULE,LPCSTR,void*);typedefvoid(*CustomFreeLibraryFunc)(HCUSTOMMODULE,void*);/***LoadDLLfrommemorylocation.**AlldependenciesareresolvedusingdefaultLoadLibrary/GetProcAddress*callsthroughtheWindowsAPI.*/HMEMORYMODULEMemoryLoadLibrary(constvoid*);/***LoadDLLfrommemorylocationusingcustomdependencyresolvers.**Dependencieswillberesolvedusingpassedcallbackmethods.*/HMEMORYMODULEMemoryLoadLibraryEx(constvoid*,CustomLoadLibraryFunc,CustomGetProcAddressFunc,CustomFreeLibraryFunc,void*);/***Getaddressofexportedmethod.*/FARPROCMemoryGetProcAddress(HMEMORYMODULE,LPCSTR);/***FreepreviouslyloadedDLL.*/voidMemoryFreeLibrary(HMEMORYMODULE);/***Findthelocationof
1