This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Stumped on a module.

Old posts that have not been replied to for several years.
Locked
S
Stumped

Post by Stumped »

I am trying to make a module that will read a blowfish encrypted tcl script. However I am stumped on how. I know this is the type of module people dont release, however, is there one out there that someone made to help others? I have looked at woobie.mod and blowfish.mod. Can anyone help?

<font size=-1>[ This Message was edited by: Stumped on 2002-03-10 04:02 ]</font>
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

It depends what you want to do. For instance, if you just want a new tcl command like "source_encrypted" that you pass a filename and a decryption key, that's easy. If you want to make it load an encrypted config file, or maybe even compile the config file into the bot, that's entirely different.

Maybe ask a more specific question?
S
Stumped

Post by Stumped »

More specificly. The entire script would be in the scripts folder, but be encrypted. And the module decrypt it as the eggdrop loads it.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Basically, copy woobie.mod for the skeleton, and fill in parts from other modules that do something like what you want already.

You still haven't said how you want to load the script, so it's kind of hard to help more than that hehe.

Is it one that eggdrop loads automatically, like the config file?

Do you want a dcc command, like ".loadscript scripts/blah.tcl <password>"?

Do you want a new tcl command, like "mysource scripts/blah.tcl <password>"?

What sort of encryption are you using, eggdrop's builtin encryption, or your own?
S
Stumped

Post by Stumped »

I was going to use blowfish since that is already in the bot. The module would code in the key it used, and it would be loaded from the configuration file like all the others. Just with a special command in the conf file like sourceencrypt scripts/bah.tcl.
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

There's no builtin access to blowfish, since it's possible to load other encryption modules. The builtin functions simply access whatever encryption module is currently loaded. Eggdrop may be switching to AES (rijndael) in the next version, so if you use the builtin encryption and don't provide your own, then your encrypted scripts may become unusable.

Ok, so copy woobie.mod, copy some code to create a new tcl command called sourceencrypt, and then fill it in.

To create a new tcl command, look at an existing module for an example. For instance, the server module has its tcl functions in tclserv.c, and creates them with the add_tcl_commands() call in server_start().

The Tcl function should read in the file, decrypt it, and pass the result to Tcl_EvalGlobal. You can find plenty of examples of new Tcl functions in tclserv.c (already mentioned).
Locked