Fix linux.psscan to use kernel offset when finding symbol location

This commit is contained in:
Eve
2023-03-08 13:39:00 +00:00
parent 3791b21695
commit a34fb84976
@@ -111,7 +111,7 @@ class PsScan(interfaces.plugins.PluginInterface):
# find all sched_class names by searching by if they include '_sched_class', e.g. 'fair_sched_class'
if "_sched_class" in symbol:
# use canonicalize to set the appropriate sign extension for the addr
addr = kernel_layer.canonicalize(vmlinux.get_symbol(symbol).address)
addr = kernel_layer.canonicalize(vmlinux.get_symbol(symbol).address + vmlinux.offset)
# append to needles list the packed hex for searching
needles.append(struct.pack(pack_format, addr))