Plugins: Normalize InvalidAddress exception handling

This commit is contained in:
Mike Auty
2020-07-18 16:38:49 +01:00
committed by ikelos
parent 43ae291815
commit a173f12fce
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -164,7 +164,7 @@ class PsList(interfaces.plugins.PluginInterface):
try:
proc = task.bsd_info.dereference().cast("proc")
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
continue
if kernel_layer.is_valid(proc.vol.offset, proc.vol.size) and not filter_func(proc):
@@ -205,7 +205,7 @@ class PsList(interfaces.plugins.PluginInterface):
# it is expected that many won't be initialized
try:
pgrp = proc_list.lh_first
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
continue
seen_pgrps = set()
@@ -217,7 +217,7 @@ class PsList(interfaces.plugins.PluginInterface):
# nothing can be done if this list pointer is invalid, so move on
try:
p = pgrp.pg_members.lh_first
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
break
seen_pg = set()
@@ -229,11 +229,11 @@ class PsList(interfaces.plugins.PluginInterface):
try:
p = p.p_pglist.le_next
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
break
try:
pgrp = pgrp.pg_hash.le_next
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
break
def run(self):
@@ -444,12 +444,12 @@ class ifnet(objects.StructType):
if self.has_member("if_lladdr"):
try:
val = self.if_lladdr.ifa_addr.dereference().cast("sockaddr_dl")
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
val = None
else:
try:
val = self.if_addrhead.tqh_first.ifa_addr.dereference().cast("sockaddr_dl")
except exceptions.PagedInvalidAddressException:
except exceptions.InvalidAddressException:
val = None
return val