OCSE - Ockham Criteria Sites Extractor
=============================

OCSE is a program to extract sites from NIST SAMATE test cases.
It is written in Python.

OCSE will iterate through a directory tree parsing all .c files it finds on the way, generating a object array with sites for each of the CWEs listed below:

-CWE476_NULL_Pointer_Dereference
-CWE457_Use_of_Uninitialized_Variable
-CWE369_Divide_by_Zero
-CWE190_Integer_Overflow
-CWE191_Integer_Underflow
-CWE121 Stack-based Buffer Overflow
-CWE122 Heap-based Buffer Overflow
-CWE124 Buffer Underwrite
-CWE126 Buffer Over-read
-CWE127 Buffer Under-read
-CWE123 Write What Where

requirements:
  -python 2.7
  -pycparser

In order to use OCSE you should install it
  -python setup.py install

Import site and extractor modules from ocse package;
Create a new Extractor("folder/path/here") from module extractor;

You can get your sites in a object list using the following methods for your extractor object:
  -variable_access_sites();
  -div_by_zero_sites();
  -null_ptr_deref_sites();
  -int_overflow_sites();
  -buffer_write_sites();
  -buffer_read_sites();
  -write_what_where_sites();

Each of these returns a list with the sites for the CWE with same name.

The Extractor class has a class method to_xml(site_list) to generate a xml file with your sites. The new output file is 'xml_sites_list' in the same folder as you ran the script.

