MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / CustomAddressIterator

Function CustomAddressIterator

pydevd_attach_to_process/winappdbg/util.py:472–494  ·  view source on GitHub ↗

Generator function that iterates through a memory map, filtering memory region blocks by any given condition. @type memory_map: list( L{win32.MemoryBasicInformation} ) @param memory_map: List of memory region information objects. Returned by L{Process.get_memory_map}.

(memory_map, condition)

Source from the content-addressed store, hash-verified

470
471
472def CustomAddressIterator(memory_map, condition):
473 """
474 Generator function that iterates through a memory map, filtering memory
475 region blocks by any given condition.
476
477 @type memory_map: list( L{win32.MemoryBasicInformation} )
478 @param memory_map: List of memory region information objects.
479 Returned by L{Process.get_memory_map}.
480
481 @type condition: function
482 @param condition: Callback function that returns C{True} if the memory
483 block should be returned, or C{False} if it should be filtered.
484
485 @rtype: generator of L{win32.MemoryBasicInformation}
486 @return: Generator object to iterate memory blocks.
487 """
488 for mbi in memory_map:
489 if condition(mbi):
490 address = mbi.BaseAddress
491 max_addr = address + mbi.RegionSize
492 while address < max_addr:
493 yield address
494 address = address + 1
495
496
497def DataAddressIterator(memory_map):

Callers 7

DataAddressIteratorFunction · 0.85
ImageAddressIteratorFunction · 0.85
MappedAddressIteratorFunction · 0.85
ReadableAddressIteratorFunction · 0.85
WriteableAddressIteratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected