This commit is contained in:
Andrew 2013-07-24 17:57:58 -04:00
parent 58643abf49
commit 50ff629e28
3 changed files with 29 additions and 0 deletions

View File

@ -1,2 +1,3 @@
add_library(parser-library
buffer.cpp
parse.cpp)

15
parser-library/buffer.cpp Normal file
View File

@ -0,0 +1,15 @@
#include "parse.h"
using namespace boost;
bool readByte(bounded_buffer *b, ::uint32_t offset, ::uint8_t &out) {
return false;
}
bool readWord(bounded_buffer *b, ::uint32_t offset, ::uint16_t &out) {
return false;
}
bool readDword(bounded_buffer *b, ::uint32_t offset, ::uint32_t &out) {
return false;
}

View File

@ -7,6 +7,15 @@
typedef boost::uint32_t RVA;
typedef struct _bounded_buffer {
boost::uint8_t *bufBegin;
boost::uint32_t bufLen;
} bounded_buffer;
bool readByte(bounded_buffer *b, boost::uint32_t offset, boost::uint8_t &out);
bool readWord(bounded_buffer *b, boost::uint32_t offset, boost::uint16_t &out);
bool readDword(bounded_buffer *b, boost::uint32_t offset, boost::uint32_t &out);
typedef struct _parsed_pe {
std::string originalFilePath;
} parsed_pe;
@ -29,4 +38,8 @@ void IterRelocs(parsed_pe *pe, iterReloc cb, void *cbd);
typedef void (*iterRVA)(void *, RVA);
void IterExpRVA(parsed_pe *pe, iterRVA cb, void *cbd);
//iterate over sections
typedef void (*iterSec)(void *, RVA secBase, std::string &, bounded_buffer *b);
void IterSec(parsed_pe *pe, iterSec cb, void *cbd);
#endif