Page 1 of 2
					
				MemoryModule x86 and x64 (static lib, import and example)
				Posted: Mon Oct 25, 2010 7:30 pm
				by ts-soft
				MemoryModule is to load DLL from Memory!
This Version works with x86 and x64 in ASCII or Unicode.
Download 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Mon Oct 25, 2010 8:10 pm
				by cas
				Thanks for sharing, works great, especially x64 version  

 .
 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Mon Oct 25, 2010 8:17 pm
				by ts-soft
				you are welcome  

 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 2:29 am
				by Mistrel
				No source?  

 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 3:01 am
				by IdeasVacuum
				....source is in the source folder
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 3:14 am
				by Mistrel
				MemoryModule static lib, import and example
I thought it was just the static library. I should have looked.
Thanks, ts-soft!
 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 8:09 am
				by Rings
				thx Thomas for the port....
also some infos available at:
http://www.joachim-bauch.de/tutorials/l ... om-memory/ 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 2:11 pm
				by cas
				Looks like it is not stable, with this code i get ~23500 loads and unloads of dll, it fails with invalid memory access (read error at address 68) on MemoryLoadLibrary(). Shouldn't it return 0 if it fails to load dll? Maybe it is some kind of memory leak, with bigger dll's i get invalid memory access sooner.
Code: Select all
XIncludeFile "MemoryModule.pbi"
DataSection
  DLL: IncludeBinary "test.dll"
EndDataSection
For k=0 To 40000
  Debug k
  Define hDLL = MemoryLoadLibrary(?DLL)
  If hDLL
    MemoryFreeLibrary(hDLL)
  EndIf
Next
 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 5:05 pm
				by ts-soft
				cas wrote:Looks like it is not stable, with this code i get ~23500 loads and unloads of dll, it fails with invalid memory access (read error at address 68) on MemoryLoadLibrary(). Shouldn't it return 0 if it fails to load dll? Maybe it is some kind of memory leak, with bigger dll's i get invalid memory access sooner.
This is a problem with some 32-bit dll's, but i can't help. The same problem with
PBOSL_LoadDLLMemory and PurePROCS by gnozal.
greetings
Thomas
 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Tue Oct 26, 2010 11:35 pm
				by netmaestro
				Thanks, ts-soft, it's quite well done. I particulary appreciate the release format of static library, impervious to future changes in PB and as usual from you, source all in. The small price is a little .pbi for the imports, well worth it. Thanks again 

 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Wed Nov 10, 2010 2:35 pm
				by Mistrel
				I overlooked the first line 'Import "oldnames.lib" : EndImport' and received a linker error. Replacing this line fixed it. But what is oldnames.lib?
A very accurate but also very unhelpful result as the first hit on google:
"What the hell is OLDNAMES.LIB?"
http://social.msdn.microsoft.com/forums ... db157c6d08
Most of the other results are just people looking for it. Would you care to share your wisdom?
 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Wed Nov 10, 2010 3:05 pm
				by ts-soft
				the c-source uses stricmp, this is an old function, removed from actuell libs. oldnames.lib is to wrap
the old function to new.
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Thu Nov 11, 2010 1:10 am
				by Mistrel
				But isn't stricmp also in msvcrt.lib?
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Thu Nov 11, 2010 7:40 am
				by ts-soft
				Mistrel wrote:But isn't stricmp also in msvcrt.lib?
only in old versions.
 
			 
			
					
				Re: MemoryModule x86 and x64 (static lib, import and example
				Posted: Wed Aug 01, 2012 4:03 pm
				by ts-soft
				Update:
Recompiled from Source-Version 0.03