From c9cbeced5b3f2bdd7407e29c0811e65954132540 Mon Sep 17 00:00:00 2001 From: Root THC Date: Tue, 24 Feb 2026 12:42:47 +0000 Subject: initial --- other/Kermit/src/findsym.cpp | 74 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 other/Kermit/src/findsym.cpp (limited to 'other/Kermit/src/findsym.cpp') diff --git a/other/Kermit/src/findsym.cpp b/other/Kermit/src/findsym.cpp new file mode 100644 index 0000000..cceefab --- /dev/null +++ b/other/Kermit/src/findsym.cpp @@ -0,0 +1,74 @@ +/* + * findsym.cpp: + * written by palmers / teso + */ +#include +#include +#include + + +#define PROGRAM "findsym" +#define AUTHOR "palmers / teso" +#define VERSION "0.0.2" + + +void usage (char *s) +{ + cout << PROGRAM << VERSION << " by " << AUTHOR << endl; + cout << "Usage: " << s << " [Options] name0 [name1 ... nameN]" << endl; + cout << "Options:" << endl; + cout << "\t-s:\t\t silent mode" << endl; + cout << "\t-f :\t set config file to " << endl; + cout << endl; + exit (0); +} + + +int main (int argc, char **argv) +{ + bool silent = false; + int x = 1; + DevMemPatt *a = new DevMemPatt (); + SymbolFingp *b = new SymbolFingp (); + + if (argc < 2) + usage (argv[0]); + + cout.setf (ios::hex, ios::basefield); + while (x < argc) + { + if (argv[x][0] == '-') + { + switch (argv[x][1]) + { + case 's': + if (silent == false) + silent = true; + else + silent = false; + break; + case 'f': + if (b != NULL) + delete b; + b = new SymbolFingp (string (argv[++x])); + break; + default: + cerr << "Illegal option!" << endl; + usage (argv[0]); + break; + } + } + else + { + if (silent) + cout << a->find_patt (b->getFinger (string (argv[x]))) << endl; + else + cout << argv[x] << '\t' << a->find_patt (b->getFinger (string (argv[x]))) << endl; + } + x++; + } + + delete a; + delete b; + return 0; +} -- cgit v1.3