Files
Jurriaan Bremer 00f1b410ef move lnk parsing from office files to yara/extractor
Instead of having special .lnk parsing in our Office analyzer it's much
easier to separate this logic using Yara rules & Extractor plugins. This
way we support other file formats such as, apparently, PE files, too.
2017-12-02 11:09:33 +01:00

17 lines
561 B
Python

# Copyright (C) 2017 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - https://cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os.path
import sys
if __name__ == "__main__":
if len(sys.argv) != 2:
print "Usage: python %s <filepath>" % sys.argv[0]
exit(1)
# Takes the file, reverses its contents, and writes it to tests/files/.
content = open(sys.argv[1], "rb").read()
filepath = os.path.join("tests", "files", os.path.basename(sys.argv[1]))
open(filepath, "wb").write(content[::-1])