layers: Fix up uses of is_valid.

This commit is contained in:
Mike Auty
2019-11-12 09:09:51 +00:00
committed by ikelos
parent 5b04492463
commit face38436e
11 changed files with 26 additions and 29 deletions
@@ -185,9 +185,7 @@ class Callbacks(interfaces.plugins.PluginInterface):
layer_name = layer_name)
for callback in callback_record.Entry:
try:
context.layers[layer_name].is_valid(callback.CallbackRoutine)
except exceptions.InvalidAddressException:
if not context.layers[layer_name].is_valid(callback.CallbackRoutine, 64):
continue
try:
@@ -228,9 +226,7 @@ class Callbacks(interfaces.plugins.PluginInterface):
for callback in callback_record.Entry:
try:
context.layers[layer_name].is_valid(callback.CallbackRoutine)
except exceptions.InvalidAddressException:
if not context.layers[layer_name].is_valid(callback.CallbackRoutine, 64):
continue
try:
@@ -298,7 +298,6 @@ class Handles(interfaces.plugins.PluginInterface):
for entry in self.handles(object_table):
try:
self.context.layers[self.config["primary"]].is_valid(entry.vol.offset)
obj_type = entry.get_object_type(type_map, cookie)
if obj_type is None:
continue
@@ -55,7 +55,7 @@ class Malfind(interfaces.plugins.PluginInterface):
while offset < vad_length:
next_addr = vad.get_start() + offset
if proc_layer.is_valid(next_addr) and proc_layer.read(next_addr, CHUNK_SIZE) != all_zero_page:
if proc_layer.is_valid(next_addr, CHUNK_SIZE) and proc_layer.read(next_addr, CHUNK_SIZE) != all_zero_page:
return False
offset += CHUNK_SIZE