아래 문서에서는 WinAPI (advapi32.dll)를 사용하지 않고 레지스트리 파일을 분석하는 방법에 대해 설명합니다.
http://volatile-minds.blogspot.com/2011/01/analyzing-windows-nt-registry-without.html
using (FileStream fs = File.OpenRead (path)) {
var data = new byte[checked((int)fs.Length)];
int i = 0;
int read;
using (var ms = new MemoryStream (checked((int)fs.Length))) {
while ((read = fs.Read (data, 0, data.Length)) > 0) {
ms.Write (data, 0, read);
i += read;
}
byte[] hive = ms.ToArray();
char[] cList = new char[fs.Length];
i = 0;
foreach (byte b in hive)
cList[i++] = (char)b;
string d = new string (cList);
int all = 0;
foreach (Match mx in lf.Matches (d)) { //you can change out the regex you want here.
byte[] bb = new byte[mx.Value.Length];
char[] cb = new char[mx.Value.Length];
for (int k = 0; k < mx.Value.Length; k++) {
bb[k] = (byte)mx.Value[k];
cb[k] = (char)bb[k];
}
all++;
//Console.WriteLine (new string (cb));
}
Console.WriteLine (all.ToString());
all = 0;
}
}
위의 코드를 실제로 작성했습니다. 이것이 내 블로그입니다. 그 코드는 정말 오줌 싸다. 나는 그것을 사용하는 것을 권장하지 않는다. 나는 [Ruby에서 라이브러리를 읽는 실제 오프라인 레지스트리] (https://github.com/brandonprry/ntreg-ruby)를 작성했으며이를 사용하는 도구는 Metasploit 프레임 워크 (tools/reg.rb)에 있습니다. 결국 나는 C#에서도이 라이브러리를 구현할 예정이지만 곧 어느 때라도 사용할 수 없습니다. –
@ user1577946 : 4 년 후. 끝난? –