-
Copy to RAM - HELP
Hello,
I'm pretty new at C programming and i made a goal to make my learning more complex.... So
I would like to copy an .exe file directly into RAM memory from flash, execute that file, and after computer restart, file should be gone... (deleted)
Can anyone help where to start?
Thanks
Back2tec
-
This is handled automatically by almost all operating systems. To do it manually by yourself, you don't only need to know the EXE format and how to load it but also somehow alter the addresses used by the program to cope with it not being loaded inside its own, isolated memory space. This can be really, really hard! Are you sure you want to do this?
-
hello GReaper, thanks for comment...
I hope i explained myself good for the first time, but I will try it again...
SO....
I want to copy and execute my .exe file only to RAM memory from USB, not on a hard drive.
Basically, exe file will be copied, run in RAM memory, do the job and then gone, after restart...
Can you help?
Oh yes, and all that i would like to write in C language....
It can also be in other way....
write a script or some other .exe file which would be on USB also, after executing, the this file, it will copy our first file directly in RAM and execute it... In that case we will have two exe files, but it is good for me
-
Is the operating system already running, and if so, which one?
Or are you aiming to plug your USB into a machine, switch it on, and run your program?
I'm curious as to what this "delete file after execute" is all about.
-
ok this is how i imagine this will work:
Operating system is running (in my case Windows 7)
1. I plug in USB with exe file(files)
2. I execute the exe file (on USB)
3. file copies itself to RAM memory and runs
Second scenario:
we have two exe files:
File(1) is file which will be copied to RAM
File(2) is file which is copying File(1) into RAM after executing it (File(2)) on USB
The later procedure is the same.
And about delete.... well as long as I know everything is deleted from RAM after reboot.. that's all
-
Oh, you mean gone from RAM, not deleted from the file system on the USB.
Well that's simple - just read up on auto-run.
But most people with any sense turn that off because it's such a security hole.
As for the reboot thing, from a functional point of view, the rebooting OS cares nothing about what RAM contains.
Forensically, DRAM isn't instantaneously forgetful when power is removed. If you rebooted forensic s/w for example, it may be possible to find scraps of information from the previous live system.
Don't forget that Windows could have stored copies of various parts of your program in the swap file.
-
well.... auto run is not going to work for me, just because of what you have said.
Maybe the second case which I've described is better,
so any ideas on how to?
-
> well.... auto run is not going to work for me, just because of what you have said.
Surely you're not suggesting you want to run a .exe file from USB with absolutely no user involvement or permission.
-
I'm not saying that this is true, but this smells like a possible example of some sort of Malware.
Would the OP please explain further what this .exe file is, what it will do when executed, and why he wants to do it?