|
|
@ -33,8 +33,7 @@ class SegmentFinder
|
|
|
|
template < class needleType, class hayType, typename comparator >
|
|
|
|
template < class needleType, class hayType, typename comparator >
|
|
|
|
uint64_t FindInRange (needleType needle, comparator oper, uint64_t start, uint64_t length)
|
|
|
|
uint64_t FindInRange (needleType needle, comparator oper, uint64_t start, uint64_t length)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mr_.buffer + start - mr_.start;
|
|
|
|
uint64_t stopper = min((mr_.end - mr_.start) - sizeof(hayType), (start - mr_.start) - sizeof(hayType) + length);
|
|
|
|
uint64_t stopper = min((mr_.end - mr_.start) - sizeof(hayType), (start - mr_.start) - sizeof(hayType));
|
|
|
|
|
|
|
|
//loop
|
|
|
|
//loop
|
|
|
|
for(uint64_t offset = start - mr_.start; offset < stopper; offset +=1)
|
|
|
|
for(uint64_t offset = start - mr_.start; offset < stopper; offset +=1)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -287,6 +286,19 @@ bool vectorAll (SegmentedFinder* s, vecTriplet *x, int )
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct Bytestream
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
uint32_t length;
|
|
|
|
|
|
|
|
void * object;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool findBytestream (SegmentedFinder* s, uint32_t *addr, Bytestream * compare )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if(memcmp(addr, compare->object, compare->length) == 0)
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool findString (SegmentedFinder* s, uint32_t *addr, const char * compare )
|
|
|
|
bool findString (SegmentedFinder* s, uint32_t *addr, const char * compare )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// read string pointer, translate to local scheme
|
|
|
|
// read string pointer, translate to local scheme
|
|
|
|