TruxtonFileIO newartifact

From truxwiki.com
Revision as of 09:52, 21 May 2020 by Sam (talk | contribs) (Created page with "This create an artifact object from a file in Truxton. It automatically associates the file and media identifiers used in the entity table. =Syntax= <synta...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This create an artifact object from a file in Truxton. It automatically associates the file and media identifiers used in the entity table.

Syntax

object newartifact();

Return value

An Entity object

Sample

import truxton

def main():
  t = truxton.create()
  file = t.getfileid("5ec2a123-74d6-5da7-0653-4e6800000000")

  artifact = file.newartifact()

  artifact.type = truxton.ENTITY_TYPE_PASSWORD
  artifact.value = "password"
  artifact.datatype = truxton.DATA_TYPE_ASCII
  artifact.length = 8
  artifact.offset = 0
  artifact.save()

if __name__ == "__main__":
  main()