how dump a program which is running in memory

R

ruqiang826

hi
I have written a service running backgroud to do something in linux.
unfortunately$B!$(BI deleted the source code by mistake, and I can still
see the process running background using "ps aux" :

username 13820 0.0 0.0 60368 2964 ? S Aug20 0:33
python ./UpdateJobStatus.py


I wonder if there is some way to dump the programme
"UpdateJobStatus.py" and get the source code back?


Thanks a lot.
 
G

Gerhard Häring

ruqiang826 said:
hi
I have written a service running backgroud to do something in linux.
unfortunately,I deleted the source code by mistake, and I can still
see the process running background using "ps aux" :

username 13820 0.0 0.0 60368 2964 ? S Aug20 0:33
python ./UpdateJobStatus.py


I wonder if there is some way to dump the programme
"UpdateJobStatus.py" and get the source code back?

Often, there is a way by accessing /proc/{pid}/fd/

But I believe you're out of luck with this method because apparently the
Python interpreter closes the source file after parsing it.

You can still try to find an undeletion utility for your filesystem.
Avoid writing to disk in the meantime to not overwrite the deleted file
accidentally, of course. There's such a utility for ext2, but I don't
know if that works ok with ext3. For other filesystems, I have no idea.

-- Gerhard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top