- Clone LineVul
- Download model like explained in their Repo
- Place classify.py in the LineVul/linevul folder
- Run it for example with:
python3 classify.py \
--input test.c --model_name=12heads_linevul_model.bin \
import pandas as pd | |
import sqlite3 as lite | |
from sqlite3 import Error | |
from pathlib import Path | |
from datetime import date | |
import numpy as np | |
import requests | |
import difflib as diff | |
import re | |
import csv |
import argparse | |
import torch | |
import transformers | |
C_SAMPLE = """#include <iostream> | |
using namespace std; | |
#define MAXSIZE 40 |
<html> | |
<input id="fileupload" name="fileupload" type="file" value="" /> | |
</html> | |
async function uploadFile() { | |
let formData = new FormData(); | |
formData.append("file", fileupload.files[0]); | |
const response = await fetch('https://antivir.securewoof.com', { | |
method: "POST", | |
body: formData | |
}); |
import os | |
import glob | |
from pydriller import Repository, Git | |
from unidiff import PatchSet | |
import subprocess | |
REPOS = {"Augeas": "https://github.com/hercules-team/augeas", "BitlBee": "https://github.com/bitlbee/bitlbee", "Cantata": "https://github.com/CDrummond/cantata", "ImageMagick": "https://github.com/ImageMagick/ImageMagick" | |
,"JPEGSnoop": "https://github.com/ImpulseAdventure/JPEGsnoop", "JasPer": "https://github.com/jasper-software/jasper", "LibRaw": "https://github.com/LibRaw/LibRaw", "PHP": "https://github.com/php/php-src", "WavPack": "https://github.com/dbry/WavPack", | |
"Ceph": "https://github.com/ceph/ceph", "FFmpeg": "https://github.com/FFmpeg/FFmpeg", "file":"https://github.com/file/file", "freetype2":"https://github.com/aseprite/freetype2", "libgd": "https://github.com/libgd/libgd", "libpng": "https://github.com/glennrp/libpng", | |
"libsndfile": "https://github.com/libsndfile/libsndfile", "libtiff":"https://github.com/libsdl-org/libtiff", "libxml2": "https://github.com/GNOME/li |
python3 classify.py \
--input test.c --model_name=12heads_linevul_model.bin \
/* | |
* [The "BSD license"] | |
* Copyright (c) 2010 Terence Parr | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* 1. Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. |
3.1.0 ffmpeg_methods 5464 4968 430486 | |
51 739f8d28d0e9a704facec711e2d657c7 dd2dcf7e52ce4abd23d61fd00e0002d4 503269070ce19d5ef2745ee631fad56e ca49f824f4f7356fddabfe1387440889 dcd8f9f23dce88503db2b74bc301a87c 9acffd7039df24f65e1bc9b958ea3c4c | |
52 4d17d5a83da10b30717f5338d2e3a130 e705b1ea92b73b8e44f5dc9c62cc70f5 1b8f8cf3f6c2c52853585549715822c6 5a27eba6e90dde02ab5864d9054f549a 79430fb9fa76a713409a83abb3511da2 | |
53 54430577d8c851d4a778fb5bb5ab8520 2e22b5863119dccdb0f287612aab9e1d b59c5b4e7730fe195ee9382d02a0470b c5f47843d04fd1347a88fbe8379a45ae e8550cbca4db2e176c2d648f6d26e5a2 b32dad21d28c571220ab20d743faba10 2938c04c3dbf26aa6a40cdb07b0484a1 3d3636bd248babd6f3c354a215e14283 | |
54 d5bc865db50d1b29072451ce329724f3 | |
55 c0cb251c993c2e6606db74819b4eb827 de74247435c851921c7e30e9546fe6ee 8b309398e3a44610b111044ca9890a0f a83b6ff0d5935b9fb95daafff7154ffb 3b89b058d66bbe64a1aac3af67d1ee63 7bbb07c5b9dcabbf96cbd733d739bfc1 62a75c100fc4f276430aea1243223687 f88746e6248000b0dbac08cf40c5cc28 | |
56 90390873e1aebda042ac0b7f32efe3e2 e9226c |
#include <stdio.h> | |
#define f(f, g) \ | |
{ \ | |
z e = 0; \ | |
for (; e < f; e++) \ | |
g; \ | |
} | |
#define i(f, g) \ | |
static z f(z a) { return g; } | |
#define j(f, g) \ |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# Overxfl0w13 - 2015 - https://github.com/overxfl0w - # | |
# For anything -> https://github.com/overxfl0w/CObfuscator # | |
import re | |
import sys | |
from random import randint |