-
September 3rd, 2011, 02:19 AM
#1
C# DLL loaded from memory during run-time
I'm developing an application that requires high levels of security and needs to hide certain libraries so that they cannot be detected from file scanning and such.
It isn't a virus or anything malicious but it does need to contain code that is undetectable so to speak.
I thought up a way to do this but am unsure how to complete the final step. For instance, I compiled a DLL, converted the DLL file to a base 64 Encoded String, Encrypted the String and Saved it inside of a new project as a String variable.
Now, when I compile my main application hypothetically it should Decrypt the String to base 64 encoding, decode base 64 into byte array and load the byte array as a library inside of the executable. All of this should be done in memory without file IO during run-time.
The final step of loading the library during run time from raw memory is the step where I am confused. I'm sure this has to be possible. I know that DLLImport command allows external libraries to be loaded but what about libraries built in memory. Could I cast the byte array to an interface and access the code that way?
By the way, an obfuscation program is not what I'm interested in. I already have one and it doesn't work very well. The others are way too expensive.
-
September 3rd, 2011, 11:27 AM
#2
Re: C# DLL loaded from memory during run-time
Rather than DllImport, can you make the dll a managed assembly and call LoadAssembly?
-
September 5th, 2011, 02:54 AM
#3
Re: C# DLL loaded from memory during run-time
If the dll is a common .net assembly, convert the base64 string into byte array and call Assembly.Load(byte[]) with it. It should work.
- Make it run.
- Make it right.
- Make it fast.
Don't hesitate to rate my post.
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
|
Click Here to Expand Forum to Full Width
|