Skip to content

Commit

Permalink
Optimize imports and start referencing pypanda
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Jul 9, 2024
1 parent e455d80 commit e9200db
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 72 deletions.
24 changes: 5 additions & 19 deletions scripts/competition.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
#!/usr/bin/python

import argparse
import atexit
import datetime
import json
import lockfile
import os
import pipes
import re
import shlex
import random
import shutil
import signal
import string
import stat
import subprocess
import sys
import time
import random

from math import sqrt
from os.path import basename, dirname, join, abspath, exists
from os.path import basename, join

from vars import parse_vars
from lava import LavaDatabase, Bug, Build, DuaBytes, Run, \
run_cmd, run_cmd_notimeout, mutfile, inject_bugs, LavaPaths, \
validate_bugs, run_modified_program, unfuzzed_input_for_bug, \
fuzzed_input_for_bug, get_trigger_line, AttackPoint, Bug, \
from lava import LavaDatabase, run_cmd, run_cmd_notimeout, inject_bugs, LavaPaths, \
validate_bugs, fuzzed_input_for_bug, AttackPoint, Bug, \
get_allowed_bugtype_num, limit_atp_reuse
from vars import parse_vars

# from pycparser.diversifier.diversify import diversify
# from process_compile_commands import get_c_files
Expand Down
46 changes: 20 additions & 26 deletions scripts/lava.py
Original file line number Diff line number Diff line change
@@ -1,49 +1,43 @@
from __future__ import print_function

import math
import os
import random
import re
import sys
import math
import shlex
import struct
import random
import subprocess

from os.path import join
from os.path import dirname
import sys
from os.path import abspath
from os.path import basename
from os.path import dirname
from os.path import join
from subprocess import PIPE
from subprocess import check_call

from sqlalchemy import Table
from sqlalchemy import Column
from sqlalchemy import ForeignKey
from sqlalchemy import Table
from sqlalchemy import create_engine
from sqlalchemy.types import Text
from sqlalchemy.types import Float
from sqlalchemy.types import Integer
from sqlalchemy.types import Boolean
from sqlalchemy.types import BigInteger
from sqlalchemy.dialects import postgresql
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import load_only
from sqlalchemy.orm import relationship
from sqlalchemy.orm import sessionmaker
from sqlalchemy.dialects import postgresql
from sqlalchemy.sql.expression import func
from sqlalchemy.ext.declarative import declarative_base

# from multiprocessing import cpu_count
# from multiprocessing.pool import ThreadPool

from time import sleep

from subprocess import PIPE
from subprocess import check_call
from sqlalchemy.types import BigInteger
from sqlalchemy.types import Boolean
from sqlalchemy.types import Float
from sqlalchemy.types import Integer
from sqlalchemy.types import Text

from composite import Composite

from test_crash import process_crash

from process_compile_commands import get_c_files
from process_compile_commands import process_compile_commands
from test_crash import process_crash

# from multiprocessing import cpu_count
# from multiprocessing.pool import ThreadPool

Base = declarative_base()

Expand Down Expand Up @@ -386,7 +380,7 @@ def run_cmd(cmd, envv=None, timeout=30, cwd=None, rr=False, shell=False):
env_string = ""
if envv:
env_string = " ".join(["{}='{}'".format(k, v)
for k, v in envv.iteritems()])
for k, v in envv.items()])
if type(cmd) == list:
print("run_cmd(" + env_string + " " +
subprocess.list2cmdline(cmd) + ")")
Expand Down
2 changes: 1 addition & 1 deletion scripts/manual_lava.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# ok this is gross
sys.path.append("/home/tleek/git/panda-leet/panda/scripts")

from plog_reader import PLogReader
from pandare.plog_reader import PLogReader

#
# manual_lava.py
Expand Down
26 changes: 0 additions & 26 deletions scripts/patch-sources.py

This file was deleted.

0 comments on commit e9200db

Please sign in to comment.