1
/******************************************************************************
3
* This example demonstrates how to change the cipher key of a module
4
* The change is only in effect for this run. This DOES NOT change the
5
* cipherkey in the module's .conf file.
11
int main(int argc, char **argv) {
14
fprintf(stderr, "usage: %s <modName>\n", *argv);
18
SWMgr manager; // create a default manager that looks in the current directory for mods.conf
20
it = manager.Modules.find(argv[1]);
22
if (it == manager.Modules.end()) {
23
fprintf(stderr, "%s: couldn't find module: %s\n", *argv, argv[1]);
27
SWModule *module = (*it).second;
30
cout << "\nPress [CTRL-C] to end\n\n";
32
cout << "\nModule text:\n";
33
module->setKey("1jn 1:9");
34
cout << "[ " << module->KeyText() << " ]\n";
35
cout << (const char *)*module;
36
cout << "\n\nEnter new cipher key: ";
38
cout << "\nSetting key to: " << key;
39
manager.setCipherKey(argv[1], (unsigned char *)key.c_str());