Skip to content

Commit 5cfd55e

Browse files
committed
ordering fix
1 parent ed7e013 commit 5cfd55e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

volatility3/framework/symbols/linux/utilities/module_extract.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,11 @@ def _fix_sym_table(
240240
st_other = struct.pack("B", sym.st_other)
241241
st_size = struct.pack(st_fmt, sym.st_size)
242242

243-
# The order as in the ELF specification
244-
sym_data = st_name + st_info + st_other + st_shndx + st_value + st_size
243+
# The order as in the ELF specification. The order is not the same between 32 and 64 bit symbols
244+
if st_fmt == "<I":
245+
sym_data = st_name + st_value + st_size + st_info + st_other + st_shndx
246+
else:
247+
sym_data = st_name + st_info + st_other + st_shndx + st_value + st_size
245248

246249
# This should never happen regardless of smear or other issues in the data. We build the structure to spec.
247250
if len(sym_data) != sym_type.size:

0 commit comments

Comments
 (0)