Ensure we test None using is rather than ==.

This commit is contained in:
Mike Auty
2019-11-03 22:46:20 +00:00
parent 9d453ff916
commit 73aa73f30e
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ class Bash(plugins.PluginInterface, timeliner.TimeLinerInterface):
continue
proc_layer_name = task.add_process_layer()
if proc_layer_name == None:
if proc_layer_name is None:
continue
proc_layer = self.context.layers[proc_layer_name]
@@ -84,7 +84,7 @@ class Handles(interfaces.plugins.PluginInterface):
magic = self.find_sar_value()
# is this the right thing to raise here?
if magic == None:
if magic is None:
raise AttributeError(
"Unable to find the SAR value for decoding handle table pointers (Is capstone installed?)")
@@ -121,7 +121,7 @@ class Handles(interfaces.plugins.PluginInterface):
return None
data = self.context.layers.read(virtual_layer_name, kvo + func_addr, 0x200)
if data == None:
if data is None:
return None
md = capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_64)
@@ -252,7 +252,7 @@ class Handles(interfaces.plugins.PluginInterface):
item = self._get_item(entry, handle_value)
if item == None:
if item is None:
continue
try:
@@ -300,7 +300,7 @@ class Handles(interfaces.plugins.PluginInterface):
try:
self.context.layers[self.config["primary"]].is_valid(entry.vol.offset)
obj_type = entry.get_object_type(type_map, cookie)
if obj_type == None:
if obj_type is None:
continue
if obj_type == "File":
item = entry.Body.cast("_FILE_OBJECT")
@@ -240,7 +240,7 @@ class MMVAD_SHORT(objects.StructType):
vollog.log(constants.LOGLEVEL_VVV, "Vad tree is too deep, something went wrong!")
raise RuntimeError("Vad tree is too deep")
if visited == None:
if visited is None:
visited = set()
vad_address = self.vol.offset
@@ -624,7 +624,7 @@ class OBJECT_HEADER(objects.StructType):
layer = self._context.layers[self.vol.native_layer_name]
kvo = layer.config.get("kernel_virtual_offset", None)
if kvo == None:
if kvo is None:
raise AttributeError("Could not find kernel_virtual_offset for layer: {}".format(self.vol.layer_name))
ntkrnlmp = self._context.module(symbol_table_name, layer_name = self.vol.layer_name, offset = kvo)
@@ -110,7 +110,7 @@ class CM_KEY_BODY(objects.StructType):
output = []
kcb = self.KeyControlBlock
while kcb.ParentKcb:
if kcb.NameBlock.Name == None:
if kcb.NameBlock.Name is None:
break
if self._skip_key_hive_entry_path(kcb.Flags):