-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiunknown_rcw.js
43 lines (40 loc) · 1.31 KB
/
iunknown_rcw.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
function all_rcws() {
var obs = exec("!DumpHeap -short -type System.__ComObject")
for (i of obs) {
var cstr = "!do -nofields " + i
foo = exec(cstr)
for (j of foo) {
if (j.includes("RCW") == true) {
blah = exec("!DumpRCW " + j.substr(j.lastIndexOf(" ") + 1))
for (k of blah) {
if (k.includes("IUnknown pointer") == true) {
log("ComObject: " + i + " " + j + " " + k)
}
}
}
}
}
}
function find_rcw(iuknown) {
var obs = exec("!DumpHeap -short -type System.__ComObject")
for (i of obs) {
var cstr = "!do -nofields " + i
foo = exec(cstr)
for (j of foo) {
if (j.includes("RCW") == true) {
blah = exec("!DumpRCW " + j.substr(j.lastIndexOf(" ") + 1))
for (k of blah) {
if ((k.includes("IUnknown pointer") == true) && k.includes(iuknown)) {
log("ComObject: " + i + " " + k)
}
}
}
}
}
}
function log(x) {
host.diagnostics.debugLog(x + "\n")
}
function exec(cmdstr) {
return host.namespace.Debugger.Utility.Control.ExecuteCommand(cmdstr);
}