diff --git a/README.md b/README.md index 6e23b49..77a5d51 100644 --- a/README.md +++ b/README.md @@ -14,3 +14,7 @@ pe-parse supports these use cases via a minimal API that provides methods for The interface is defined in `parser-library/parse.h`. The program in `dump-prog/dump.cpp` is an example of using the parser-library API to dump information about a PE file. Internally, the parser-library uses a bounded buffer abstraction to access information stored in the PE file. This should help in constructing a sane parser that allows for detection of the use of bogus values in the PE that would result in out of bounds accesses of the input buffer. Once data is read from the file it is sanitized and placed in C++ STL containers of internal types. + +Building +======== +pe-parse is built using cmake and depends on boost. Once your platforms CMake knows how to find boost, build pe-parse through cmake . && make diff --git a/parser-library/parse.cpp b/parser-library/parse.cpp index 2b018ba..22a254b 100644 --- a/parser-library/parse.cpp +++ b/parser-library/parse.cpp @@ -25,7 +25,7 @@ THE SOFTWARE. #include #include "parse.h" #include "nt-headers.h" -#include +#include "to_string.h" using namespace std; using namespace boost; diff --git a/parser-library/to_string.h b/parser-library/to_string.h new file mode 100644 index 0000000..1e96f01 --- /dev/null +++ b/parser-library/to_string.h @@ -0,0 +1,12 @@ +#ifndef _TO_STRING_H +#define _TO_STRING_H +#include + +template +static +std::string to_string(T t, std::ios_base & (*f)(std::ios_base&)) { + std::ostringstream oss; + oss << f << t; + return oss.str(); +} +#endif