hoshimin / sig Goto Github PK
View Code? Open in Web Editor NEWThe most powerful and customizable binary pattern scanner
License: MIT License
The most powerful and customizable binary pattern scanner
License: MIT License
Hi, i tried your example code and sadly cant compile it on linux with g++ 11.1.0 which is the newest for my distro.
I tried the following code:
#include "Sig.hpp"
#include <cassert>
static const unsigned char g_arr[]{
'?', '?', '?', '?',
0x11, 0x22, 0x33, 0x44};
int main()
{
const void *const found1 = Sig::find<Sig::Dword<0x44332211>>(g_arr, sizeof(g_arr));
const void *const found2 = Sig::find<
Sig::Mask::Eq<'.'>,
Sig::Mask::Any<'?'>>(g_arr, sizeof(g_arr), "\x11\x22\x00\x44", "..?.");
const void *const found3 = Sig::find(g_arr, sizeof(g_arr), "11 22 ? 44");
assert(found1 == &g_arr[4]);
assert(found1 == found2);
assert(found2 == found3);
return 0;
}
and got these errors:
In file included from test.cpp:1:
Sig.hpp:297:15: error: explicit specialization in non-namespace scope ‘struct Sig’
297 | template <>
| ^
Sig.hpp:298:12: error: too few template-parameter-lists
298 | struct SetComparator<>
| ^~~~~~~~~~~~~~~
Sig.hpp:444:15: error: explicit specialization in non-namespace scope ‘struct Sig’
444 | template <>
| ^
Sig.hpp:445:12: error: too few template-parameter-lists
445 | struct Comparator<>
| ^~~~~~~~~~~~
Sig.hpp:822:15: error: explicit specialization in non-namespace scope ‘struct Sig’
822 | template <>
| ^
Sig.hpp:823:12: error: too few template-parameter-lists
823 | struct MaskComparator<>
| ^~~~~~~~~~~~~~~~
Sig.hpp: In instantiation of ‘static bool Sig::Comparator<Entry>::cmp(const void*) [with Entry = Sig::Holder<unsigned int, Sig::Cmp::Eq, 1144201745>]’:
Sig.hpp:464:60: required from ‘static const void* Sig::find(const void*, size_t) [with Entries = {Sig::Holder<unsigned int, Sig::Cmp::Eq, 1144201745>}; size_t = long unsigned int]’
test.cpp:11:65: required from here
Sig.hpp:403:45: error: no type named ‘cmp’ in ‘using Cmp = struct Sig::Cmp::Eq<unsigned int, 1144201745>’ {aka ‘struct Sig::Cmp::Eq<unsigned int, 1144201745>’}
403 | return typename Entry::Cmp::cmp(pos);
| ^~~~~~~~
Sig.hpp: In instantiation of ‘static bool Sig::MaskComparator<Entry, Entries ...>::cmp(char, char, char) [with Entry = Sig::Mask::Any<'?'>; Entries = {}]’:
Sig.hpp:794:55: required from ‘static bool Sig::MaskComparator<Entry, Entries ...>::cmp(char, char, char) [with Entry = Sig::Mask::Eq<'.'>; Entries = {Sig::Mask::Any<'?'>}]’
Sig.hpp:854:73: required from ‘static const void* Sig::find(const void*, size_t, const char*, const char*, size_t) [with Comparators = {Sig::Mask::Eq<'.'>, Sig::Mask::Any<'?'>}; size_t = long unsigned int]’
Sig.hpp:882:36: required from ‘static const void* Sig::find(const void*, size_t, const char*, const char*) [with Comparators = {Sig::Mask::Eq<'.'>, Sig::Mask::Any<'?'>}; size_t = long unsigned int]’
test.cpp:15:29: required from here
Sig.hpp:794:55: error: ‘cmp’ is not a member of ‘Sig::MaskComparator<>’
794 | return MaskComparator<Entries...>::cmp(data, pattern, mask);
Respected Developer,
I appreciate your work so far. But the scanner is not able to detect more matches after it finds the first match. So for example I have an array
{0x00,0x13,0x00,0x56,0x00,0x13,0x66,0x77}
The algorithm can find 00 13 first offset, but not the next one.
If there are multiple matches, the program should return offsets for all of those matches.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.