mirror of
https://github.com/vivisect/vivisect
synced 2026-06-08 18:04:23 +00:00
80de840881
A lot of cleanup things in prep for a python 3 transition. Getting rid of the old exception syntax, converting prints over to logging, cutting random scraps of code to be proper unit tests, cut away some older bits of code, etc. This still works in python2. It's just a lot of tidying up. There are no major functionality changes.
27 lines
907 B
Python
27 lines
907 B
Python
"""
|
|
generic workspace analysis module to seek through the undiscovered
|
|
country looking for pointers to interesting things.
|
|
|
|
in a previous life, this analysis code lived inside VivWorkspace.analyze()
|
|
This will *actually* make pointers!
|
|
"""
|
|
import logging
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def analyze(vw):
|
|
|
|
logger.debug('...analyzing pointers.')
|
|
|
|
# Now, lets find likely free-hanging pointers
|
|
for addr, pval in vw.findPointers():
|
|
try:
|
|
vw.followPointer(pval)
|
|
if vw.getLocation(addr) is None:
|
|
# RP we need to make pointers out of what we find...
|
|
# otherwise we miss a ton of functions because we mark sections exec
|
|
# when subsystem < win7
|
|
vw.makePointer(addr)
|
|
except Exception as e:
|
|
logger.warning("followPointer() failed for 0x%.8x (pval: 0x%.8x) (Error: %s)", addr, pval, e)
|