WinDbg|전체 프로세스 메모리에서 특정 패턴 스캔하기
http://voneinem-windbg.blogspot.kr/2007/06/scan-full-process-memory-for-pattern.html
전체 프로세스 메모리에서 특정 패턴 스캔하기
Scan the full process memory for a pattern
프로세스 메모리에서 특정 패턴을 스캔해야 할 때가 매우 많았다.
특정 포인터이거나 문자열일 수도 있고 무엇이라도 될 수 있다.
Very often I need to scan the process memory for a specific pattern.
This can be either a pointer or a string or whatever and I want to find out, which other memory references this pointer or pattern.
x32 아키텍쳐에선 이런 경우엔 간단하게 "s -d 0x00000000 L?0xffffffff ' 라고 명령어를 치면 된다.
Simply type ''s -d 0x00000000 L?0xffffffff ' to find a referenced pointer on a x32 architecture.
E.g.:
0:000> s -d 0x00000000 L?0xffffffff 30c5bf9c
0012b2b0 30c5bf9c 00000000 00000000 00000000 ...0............
0012b2f8 30c5bf9c 9955d404 0badf00d 3e4d1f74 ...0..U.....t.M>
0012b340 30c5bf9c 3e4d1f70 9955d450 0badf00d ...0p.M>P.U.....
0012b374 30c5bf9c 3e4d1f70 9955d49c 00000001 ...0p.M>..U.....
3e4d1f7c 30c5bf9c 00000000 00000000 00000001 ...0............
3e4d1f90 30c5bf9c 00000000 00000000 00000000 ...0............
3e4d1fd0 30c5bf9c 30c5bf9c 00000000 00000001 ...0...0........
3e4d1fd4 30c5bf9c 00000000 00000001 33522fc0 ...0........./R3
첫번째 컬럼은 패턴이 나오는 주소이다.
더 자세한 사항에 대해서 알고 싶으면, windbg 온라인 도움말의 s (Search Memory) 를 참조하라.
The first column lists the locations that matched the pattern.
For more information refer to windbg online help: s (Search Memory)
-- 댓글중에--
s -sa 0 0xFFFFFFFF
s -su 0 0xFFFFFFFF
명령으로 각각 모든 아스키 문자열과 유니코드 문자열을 찾을 수 있다.
그리고 특정패터은 다음과 같이 검색할 수 있다.
s -[1]a 0 0xFFFFFFFF "Composition"