Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Technique for iterating through variables and finding Instances of a specific Type

i want to iterate through variables in memory in my process (loaded through a plugin dynamically), and look for instances of a specific type.

Previously i can find the specific types (or all types in memory). I can create instances of types, i could get instances that were contained as fields in a different type, but i don't know anyway just to "search" for instances of a specific type.

like image 719
klumsy Avatar asked Apr 10 '12 19:04

klumsy


People also ask

What are the methods used with an iterator to iterate through a sequence?

__ier()__ and __next()__ methods are used with an iterator to iterate through the given sequence.

What is iterating variable?

The iterator (loop) variable is the variable which stores a portion of the iterable when the for loop is being executed. Each time the loop iterates, the value of the iterator variable will change to a different portion of the iterable.

What are the two types of iteration in Python?

There are two types of iteration: Definite iteration, in which the number of repetitions is specified explicitly in advance. Indefinite iteration, in which the code block executes until some condition is met.

What is iteration variable in Python?

We call the variable that changes each time the loop executes and controls when the loop finishes the iteration variable. If there is no iteration variable, the loop will repeat forever, resulting in an infinite loop.


1 Answers

One way would be to use windbg and sos. You can !dumpheap with a -type flag.

like image 193
Kenneth Ito Avatar answered Sep 20 '22 18:09

Kenneth Ito