示例#1
0
def extract_feature(f):
    oid = oxide.import_file(f)[0]
    if not oid:
        print " - Not able to import the file %s" % f
        return None

    print " - Processing %s %s" % (f, oid)
    delays = oxide.get_field("pe_parse", oid, "delay_import_table")
    return delays
def extract_ordinal(f):
    oid = oxide.import_file(f)[0]
    if not oid:
        print " - Not able to import the file %s" % f
        return None

    print " - Processing %s %s" % (f, oid)
    exports = oxide.get_field("pe_parse", oid, "exports_table")
    if not exports:
        print "    ... No exports, skipping"
        return None

    file_data = oxide.get_field("files", oid, "data")
    ordinals = {}

    for name in exports["export_names"]:
        ordinals[exports["export_names"][name]['ord']] = name

    return ordinals
示例#3
0
 def test_import_file(self):
     """ Assert that a file can be imported """
     f = os.path.join(oxide.config.dir_datasets, "sample_dataset", "bash")
     fail_msg = "Not able to import file", f
     self.assertNotEqual(oxide.import_file(f), (None, False), fail_msg)