-
Loading a DLL from memory
Okay, so this issue is confusing me.
Does anybody know of a way to load an dll file from memory?
What I am trying to accomplish is storing the plugin for my server on the hard drive in an encrypted form. Then I could load the file where the encrypted data is stored into memory and decrypt it. That way the decrypt version would never exist on the disk.
I found something that does almost exactly what I want at http://www.joachim-bauch.de/tutorial...l-from-memory/
But it only works using FILE classes and is rather stick with winapi, not to mention it throws an error at the end.
Does anybody have any ideas or source?
-
What do you mean it only works using FILE classes?
From what i see, you can just read your encrypted dll to say a byte *(malloc'd or whatever you use) then decrypt it and pass it to MemoryLoadLibrary
pseudocode
Code:
HANDLE hFile = CreateFile(_T("yourfile.ext"),GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0);
DWORD dwSizeofFile = GetFileSize(hFile,NULL);
byte *lpMem = (byte *)malloc(dwSizeofFile);
ReadFile_To_ByteArray(lpMem);
Decrypt_Bytes(lpMem);
void *lpLibraryMem = MemoryLoadLibrary(lpMem);
/* do things with lpLibraryMem such as walk the EAT or call GetProcAddress, and free the mem once you are done with it*/
Last edited by mjrod5; 06-08-2010 at 19:10.
[img]http://www.photochopz.com/forum/images/smilies/fap.gif[/img]In The Oven (err in Development) : Pie [img]http://www.photochopz.com/forum/images/smilies/fap.gif[/img]
[QUOTE=uraskiddie;115188]What are you? Like 10 years old?
That's complete rubbish, you probably got your depictions of being a "hacker" from a prepubescent forum infested with homosexually-oriented pedophiles.[/QUOTE]
[QUOTE=Envy;136433]Russian?
Trusted.
Botnets are like our right hands.[/QUOTE]
[url]http://cognitivity.org/[/url]
-
You must spread some Reputation around before giving it to mjrod5 again.
i prefer backseat rather than storming the front.
sniper's way xD
-
-

Originally Posted by
Lost One
I gave reputation?
you make me lol everytime with your statements. xD
i prefer backseat rather than storming the front.
sniper's way xD
-
Executer, you are confusing me...
-

Originally Posted by
Lost One
Executer, you are confusing me...
What he said was the message the forum gave him when he tried giving me some rep
Did you ever try what i told you?
[img]http://www.photochopz.com/forum/images/smilies/fap.gif[/img]In The Oven (err in Development) : Pie [img]http://www.photochopz.com/forum/images/smilies/fap.gif[/img]
[QUOTE=uraskiddie;115188]What are you? Like 10 years old?
That's complete rubbish, you probably got your depictions of being a "hacker" from a prepubescent forum infested with homosexually-oriented pedophiles.[/QUOTE]
[QUOTE=Envy;136433]Russian?
Trusted.
Botnets are like our right hands.[/QUOTE]
[url]http://cognitivity.org/[/url]
-
Oh yeah lol. Sorry I forgot to reply.
It worked fine with you way. My problem was I tried to read the file to a char[] instead of a BYTE[] lol
-

Originally Posted by
Lost One
Oh yeah lol. Sorry I forgot to reply.
It worked fine with you way. My problem was I tried to read the file to a char[] instead of a BYTE[] lol
Lol glad it worked out 
btw get on msn more often
[img]http://www.photochopz.com/forum/images/smilies/fap.gif[/img]In The Oven (err in Development) : Pie [img]http://www.photochopz.com/forum/images/smilies/fap.gif[/img]
[QUOTE=uraskiddie;115188]What are you? Like 10 years old?
That's complete rubbish, you probably got your depictions of being a "hacker" from a prepubescent forum infested with homosexually-oriented pedophiles.[/QUOTE]
[QUOTE=Envy;136433]Russian?
Trusted.
Botnets are like our right hands.[/QUOTE]
[url]http://cognitivity.org/[/url]
-
I'm on almost every night. Be more nocturnal...
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
By Sav1or in forum Malware sources
Replies: 5
Last Post: 17-11-2011, 14:29
-
By guro in forum Delphi Help
Replies: 0
Last Post: 05-10-2008, 10:21
-
By drkdreams in forum Delphi Help
Replies: 5
Last Post: 10-10-2006, 21:09
-
By unreachableboy in forum General Programming Help
Replies: 0
Last Post: 03-11-2005, 19:30
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
All times are GMT +1. The time now is 21:37.
www.opensc.ws
Copyright ©2005 - 2012, OpenSC Forums
Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.