Files
gists/tools/forensics/extractfolder.py
tobias 619b0bc432 Restructure repository: organize tools by purpose, create what search tool
- Move single-file tools to tools/ organized by category (security, forensics, data, etc.)
- Move multi-file projects to projects/ (go-tools, puzzlebox, timesketch, rust-tools)
- Move system scripts to scripts/ (proxy, display, setup, windows)
- Organize config files in config/ (shell, visidata, applications)
- Move experimental tools to archive/experimental
- Create 'what' fuzzy search tool with progressive enhancement (ollama->fzf->grep)
- Add initial metadata database for intelligent tool discovery
- Preserve git history using 'git mv' commands
2026-02-21 23:20:42 +01:00

24 lines
533 B
Python

import subprocess
import sys
image=sys.argv[1]
inode=sys.argv[2]
output = subprocess.check_output(f"fls -F {image} {inode}", shell=True)
output=output.decode()
result = {}
for row in output.split('\n'):
if ':' in row:
key, value = row.split(':')
idx = key.split(" ")[-1]
fsid = idx.split("-")[0]
result[fsid] = value.strip()
for fsid in result:
print(f"Writing Inode {fsid} -> {result[fsid]} ")
outfile=open(result[fsid],'w')
subprocess.run(["icat", image, fsid],stdout=outfile)