Ejemplo n.º 1
0
/**
 * Classify the given malware reports
 */
static void malheur_classify()
{
    assign_t *as;
    farray_t *fa, *pr, *re;

    /* Check for prototype file */
    if (access(mcfg.proto_file, R_OK))
        fatal("No prototype file for classifcation available");

    /* Load data */
    fa = malheur_load();

    /* Load prototypes */
    pr = farray_load_file(mcfg.proto_file);

    /* Apply classification */
    as = class_assign(fa, pr);

    /* Save rejected feature vectors */
    re = class_get_rejected(as, fa);
    if (save)
        farray_save_file(re, mcfg.reject_file);
    farray_destroy(re);

    /* Export classification */
    export_class(pr, fa, as, output_file);

    /* Clean up */
    assign_destroy(as);
    farray_destroy(pr);
    farray_destroy(fa);
}
Ejemplo n.º 2
0
const easy_lua* easy_lua::export_class(
    const MetaTableArray& metatable_data,
    std::vector<LuaCFunc> functions ) const
{
    return export_class( metatable_data[ 0 ], metatable_data[ 1 ], std::move( functions ) );
}