循环遍历即可
import Evtx.Evtx as evtx
# 定义要读取的.evtx文件路径
evtx_file = "path/to/file.evtx"
# 打开.evtx文件
with evtx.Evtx(evtx_file) as log:
# 获取.evtx文件的全部记录
records = log.records()
# 倒序迭代记录,并输出每条记录
for record in reversed(records):
# 输出记录的XML表示
print(record.xml())
(备注:path/to/file.evtx 只是我随机命名的路径,需要替换为你实际的.evtx文件路径)