diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /other/Kermit/test/test_devmempatt.cpp | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'other/Kermit/test/test_devmempatt.cpp')
| -rw-r--r-- | other/Kermit/test/test_devmempatt.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/other/Kermit/test/test_devmempatt.cpp b/other/Kermit/test/test_devmempatt.cpp new file mode 100644 index 0000000..25b34ce --- /dev/null +++ b/other/Kermit/test/test_devmempatt.cpp | |||
| @@ -0,0 +1,50 @@ | |||
| 1 | #include <DevMemPatt.hpp> | ||
| 2 | #include <SymbolFingp.hpp> | ||
| 3 | #include <iostream> | ||
| 4 | |||
| 5 | |||
| 6 | #define PROGRAM "findsym" | ||
| 7 | #define AUTHOR "palmers / teso" | ||
| 8 | #define VERSION "0.0.2" | ||
| 9 | |||
| 10 | |||
| 11 | void usage (char *s) | ||
| 12 | { | ||
| 13 | cout << PROGRAM << VERSION << " by " << AUTHOR << endl; | ||
| 14 | cout << "Usage: " << s << " [Options] name1 [name2 ... nameN]" << endl; | ||
| 15 | cout << "Options:" << endl; | ||
| 16 | cout << endl; | ||
| 17 | exit (0); | ||
| 18 | } | ||
| 19 | |||
| 20 | |||
| 21 | int main (int argc, char **argv) | ||
| 22 | { | ||
| 23 | int x = 1; | ||
| 24 | DevMemPatt *a = new DevMemPatt (); | ||
| 25 | SymbolFingp *b = new SymbolFingp (); | ||
| 26 | |||
| 27 | if (argc < 2) | ||
| 28 | usage (argv[0]); | ||
| 29 | |||
| 30 | cout.setf (ios::hex, ios::basefield); | ||
| 31 | while (x < argc) | ||
| 32 | { | ||
| 33 | if (argv[x][0] == '-') | ||
| 34 | { | ||
| 35 | switch (argv[x][1]) | ||
| 36 | { | ||
| 37 | default: | ||
| 38 | cerr << "Illegal option!" << endl; | ||
| 39 | usage (argv[0]); | ||
| 40 | } | ||
| 41 | } | ||
| 42 | else | ||
| 43 | { | ||
| 44 | cout << argv[x] << '\t' << a->find_patt (b->getFinger (string (argv[x]))) << endl; | ||
| 45 | } | ||
| 46 | x++; | ||
| 47 | } | ||
| 48 | |||
| 49 | return 0; | ||
| 50 | } | ||
