Skip to content

Commit e5d3134

Browse files
authored
Merge pull request #1025 from Abyss-W4tcher/remote_isf
Core: Remote ISF - correct sql query and strip identifier
2 parents 11ddafd + c20baf9 commit e5d3134

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

volatility3/framework/automagic/symbol_cache.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ def update(self, progress_callback=None):
429429
progress_callback(0, "Reading remote ISF list")
430430
cursor = self._database.cursor()
431431
cursor.execute(
432-
f"SELECT cached FROM cache WHERE local = 0 and cached < datetime('now', {self.cache_period})"
432+
f"SELECT cached FROM cache WHERE local = 0 and cached < datetime('now', '{self.cache_period}')"
433433
)
434434
remote_identifiers = RemoteIdentifierFormat(constants.REMOTE_ISF_URL)
435435
progress_callback(50, "Reading remote ISF list")
@@ -438,9 +438,13 @@ def update(self, progress_callback=None):
438438
{}, operating_system=operating_system
439439
)
440440
for identifier, location in identifiers:
441+
identifier = identifier.rstrip()
442+
identifier = (
443+
identifier[:-1] if identifier.endswith(b"\x00") else identifier
444+
) # Linux banners dumped by dwarf2json end with "\x00\n". If not stripped, the banner cannot match.
441445
cursor.execute(
442446
"INSERT OR REPLACE INTO cache(identifier, location, operating_system, local, cached) VALUES (?, ?, ?, ?, datetime('now'))",
443-
(location, identifier, operating_system, False),
447+
(identifier, location, operating_system, False),
444448
)
445449
progress_callback(100, "Reading remote ISF list")
446450
self._database.commit()

0 commit comments

Comments
 (0)