[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Writing Memory to File

Stefan Wagner

3/8/2008 1:26:00 PM

Hi,

I'm trying to do some memory analyzing stuff, i wrote me a small .c so
far to dump the memory to a file for later analysis,
the analyzing part itself is python code.
I wonder if any of you has an idea how to dump the whole memory in
Linux/Windows from python ?
Using the .c for this somehow doesn't look right and comfy ;-)

Regards,
Stefan
2 Answers

Dennis Lee Bieber

3/8/2008 6:11:00 PM

0

On Sat, 8 Mar 2008 14:25:46 +0100, "Stefan Wagner"
<ffm.stefan@googlemail.com> declaimed the following in comp.lang.python:

> I wonder if any of you has an idea how to dump the whole memory in
> Linux/Windows from python ?
> Using the .c for this somehow doesn't look right and comfy ;-)

Are you sure you are getting "the whole memory" even from C? I'd
think you'd have to be running as root, and also dump the page/swap file
as some of the "memory" might have been swapped out...
--
Wulfraed Dennis Lee Bieber KD6MOG
wlfraed@ix.netcom.com wulfraed@bestiaria.com
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: web-asst@bestiaria.com)
HTTP://www.bestiaria.com/

Nick Craig-Wood

3/10/2008 2:30:00 PM

0

Stefan Wagner <ffm.stefan@googlemail.com> wrote:
> I'm trying to do some memory analyzing stuff, i wrote me a small .c so
> far to dump the memory to a file for later analysis,
> the analyzing part itself is python code.
> I wonder if any of you has an idea how to dump the whole memory in
> Linux/Windows from python ?
> Using the .c for this somehow doesn't look right and comfy ;-)

The whole memory of what?

Under linux :

If you want the whole physical memory of the system then
you can dump /dev/mem

You can dump the memory of an individual process using the ptrace
interface.

Both those things will require the relevant rights and neither is
quite as easy as you might hope for!

--
Nick Craig-Wood <nick@craig-wood.com> -- http://www.craig-woo...