Click here to Skip to main content
15,900,724 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In the name of allah

have a good time

I'm working on a project and now i need help.

At first you look that am i understood a matter?
In the windows When we double click on a file (for example exe) the operation system will load the file's buffer (array of characters stored in the file) to RAM and then run it.
Now i want to do this.
In fact i'm going to load buffer of file in run time in the string variable(array of char) then delete the file and finally execute the file from buffer so that there is no more file in hard.

What I have tried:

I searched about portable exe and run from buffer,but i couldn't find code or got a code just for .net exe for csharp and basic.

Can you explain for me what's the solution?

Thanks in advance
Posted
Updated 1-Jul-16 21:43pm
Comments
[no name] 2-Jul-16 0:37am    
Why do you need to do this? The OS provides a SECURE way of running an application. Bypassing this is always malicious.
Mahdi Nejadsahebi 2-Jul-16 8:37am    
Well
I want to write an application like winrar but at here there a different, we put some files in a package like .rar and then open this archive by winrar, now we double click on a file, what happens? A file will extracted to hard disk then runs.
i need to do this but i don't want create any file ondisk(cause of security).

1 solution

Without writing a complet PE loader and address relocator you cannot do it. See LoadLibraryEx function (Windows)[^].
 
Share this answer
 
v2
Comments
Mahdi Nejadsahebi 19-Jul-16 3:34am    
thanks dear pal for your solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900