Searching for a string across all memory
I need to search for a specific string in memory (all memory, not just that used by my app) and return both the location and data from around that location. Anyone any ideas?
|
Re: Searching for a string across all memory
Hm.
WinHex Memory Viewer? http://www.x-ways.net/winhex/index-m.html Taken from: http://www.infosecwriters.com/text_r..._In_Memory.pdf Could be difficult I imagine. Getting access violations and so on. Try to use APIs? Or let your programm occupy memory of the size of RAM available. The rest should be swapped to the swap-file, which you could read and analyze? Stupid method I guess. |
Re: Searching for a string across all memory
What OS? What language? Do you want to do it from the program or from outside?
I might try http://cpan.uwinnipeg.ca/htdocs/Win32-Process-Memory/ on Windows, or on Unix use /proc. |
Re: Searching for a string across all memory
Running on Linux. /proc was enough of a hint for me to find this on kerneltrap.org which appears as if it may do the trick.
Thanks queball, now to find out if what I want to do is even possible (I don't think so but hey, it's worth a shot). |
Re: Searching for a string across all memory
So WHAT do you want to do?
|
Re: Searching for a string across all memory
Quote:
The following perl script will dump a process's memory to files into the current directory. Embarassingly I wouldn't know how to search a large file using perl, but by dumping each memory mapped region you can use for example grep and hexdump. Code:
#!/usr/bin/perl |
Re: Searching for a string across all memory
/dev/mem seems to work fine for me
|
All times are GMT +1. The time now is 10:49. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2002 - 2018