AutoHotkey Community

It is currently May 26th, 2012, 3:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: March 13th, 2009, 6:58 am 
Offline

Joined: January 10th, 2009, 6:40 pm
Posts: 32
GroupMsg 1.1.1

Download the compiled exe: http://www.autohotkey.net/~gahks/GroupMsg.exe
Download the source: http://www.autohotkey.net/~gahks/GroupMsg.ahk

The settings file (optional)
http://www.autohotkey.net/~gahks/GroupMsg-Settings.ini

Scripts needed for compiling:
httpQuery: http://www.autohotkey.net/~gahks/httpQuery.ahk (http://www.autohotkey.com/forum/viewtopic.php?t=33506)
RC4: http://www.autohotkey.net/~gahks/rc4.ahk (http://www.autohotkey.com/forum/topic6804.html)
Dynamic code execution: http://www.autohotkey.net/~gahks/dynamic.ahk (http://www.autohotkey.com/forum/topic3332.html)

Screenshots
Main window | Mode selection | Showing the messages | Sending a message

What's this?
- A messenger app: a mix of the concepts of encrypted instant messaging, text messaging, mailing lists and message boards.
- A simple, portable, standalone remote control client and server

What's it for?
With this script you can:
- Remotely control your PC (by remotely executing AHK commands, full scripts even)
- Send fast text messages to a person or a large group of people in a secure and simple way without using anything but this script.
- Read messages sent by others to you or to your group

Features
- Sending encrypted text messages to a person or a group
- Receiving and reading messages from a person or a group
- Remote control (with AHK commands)
- Customizable settings with ini
- Multilanguage support (English and Hungarian translations so far)
- Optional message cache

How does it work?
The messenger mode:
You give a copy of this script, a login (group) name and a password to the people you want to send messages to and receive messages from. By doing this, you create a group. With the group name and password you gave them, they can send messages to the people using the same login name and password.
In practice?
When the app starts it asks for a login (group) name and a passsword. With these data it can access to the messages sent to this group and encrypted with this password.
Click on the "Send a message" button to submit a message to a person or a group. When sending a message you can specify a deletion password and the Author of the message. Both are optional. The deletion password is only needed if you wouéd like to able to delete the messages you sent. The messages are automatically deleted 6 months after you send them.
More specifically:
The messages are encrypted with Laszlo's RC4txttohex function on your PC before sending. After encryption the app places the encrypted message on openpaste.org and locks it. The openpaste "author" string is generated from the group name and the password for "locking" is generated from the specified password.
When you launch the app, it lists the last 50 (you can specify a larger number) messages sent to the current group. When clicking on one of the items in the list it downloads the clicked message, decrypts it, and displays it.

The remote control mode:
You launch a copy of this script in "remote control server mode" on your PC, and with another copy you can control it remotely from another PC by sending AHK commands or even full AHK scripts.
In practice?
On your PC (or on the PC you want to control) you launch the app, and select "remote control server" mode. (Make sure the PC has a living internet connection.) After you've done that, the PC is ready to be controlled. You grap another copy of the script, and launch it on the PC from which you want to control your PC. You select "group messenger/remote control client" mode and click the Submit a message button. You specify the same deletion password as you did on you PC, and type your commands in the message field. For the syntax of the commands, see the part below about command syntaxes.
More specifically:
When in "remote control server" mode the script checks and downloads every message sent to the specified group name. If the message contains commands, it executes it. There are two types of commands: Single line and Multiline commands. The main difference between them is, that with Multiline command mode you can send full AHK scripts, as they are executed with AutoHotKey.exe (It's embedded but if you prefer you can use your own copy for more details see the part about ini and settings).
When in "group messenger/remote control client" mode you can send commands to the PC you want to control remotely, just like when you send a message to a person or a group.
You don't need to open ports for the script as it's wonn't actually listen to any port, it connects to openpaste directly in certain time intervals.

You can save a message to the hd by right clicking it in the list and clicking "Save this message...".
You can delete a message by right clicking it in the list, clicking "Delete this message..." and giving the right Deletion password.
You can change between group messenger and remote control server modes in the tray menu.

Command syntax:
Single line commands:
When sending one or more Single line commands the first line of the message must be "|Single|" without quotation marks. The other rows can contain regular AHK commands, with the following three differences: 1./ You have to use pipe "|" characters as delimiters. 2./ When omitting a parameter, instead of leaving its place blank you have to type a "_" character (without quotation marks). 3./ If the AHK command requiers an output variable, leave it out from the command, because the script automatically assigns one to the command. Since single line commands are executed internally you cannot send certain commands because they might cause the script to stop. For example: MsgBox, InputBox, Pause, Sleep, etc. Also they with single line commands you cannot set variables, cannot launch subroutines, etc.To do these things you'll have to send a Multiline command For Single line command examples see the Examples section below.
Multiline commands:
When sending Multiline commands, the first line of the message must be "|Multi|" without quotation marks. Below that comes the AHK script you want to execute. It can be a full script with variables, functions, labels, subroutines, commands, everything a normal AHK script might contain. For example see the Examples section below.

Customizing the settings with an ini file:
Download the GroupMsg-settings.ini from the downloads section above, open the ini file in a text editor and changethe values of the keys, as described below (and in the ini file).
mode=
If you don't want to select every time the app starts between operation modes you can set the default here. 1 for remote control server mode, 0 for messenger mode.

message_lifetime=
You can set the lifetime of commands here. You have to specify the time interval in minutes.
E.g.: If you want the script to skip the messages that are older than 2 hours, set it to 120

ahk_path=
To execute multiline commands the script needs a copy of AutoHotKey.exe. By default it's embedded in the app and when it receives a multiline command, it extracts the exe to the script dir. If you have an AutoHotkey.exe on your PC and you want the script to use that instead, you can set this value to it's full path.

multimode_off=
If you don't want the script to execute multiline commands, set this to 1 otherwise leave it blank or delete this line.

enable_cache=
1 if you want to enable message cache, otherwhise 0 or delete the line. When message cache is enabled: When viewing messages with the wrong password the script will display them as gibberish text instead of displaying the "Wrong password..." line.

language=
Set its value to the name of your custom language,
which must be the same as the section's name that contains the language strings So far there are English (embedded) and Hungarian languages available.

default_group_name=
default_group_password=
default_deletion_password=
Default group name, password and deletion password settings

Examples
An ini file with all the possible things configured may look like this:
Code:
[Default]
mode=1
message_lifetime=1
ahk_path=c:\AutoHotKey\AutoHotKey.exe
multimode_off=
enable_cache=1
language=German
[German]
;Here come the translated language strings

A message containing six single line commands:
Code:
|Single|
Run|C:\someapp.exe|_|Hide
WinKill|SomeTitle|_|_|SomeExcludeTitle
Send|{PrintScreen}
FileCreateDir|c:\somedir
FileCopy|c:\someapp.exe|c:\somedir
Shutdown|1

A message containing a multiline script:
Code:
|Multi|
Loop, 3
 var%a_index% := a_index

var2 := var2-1
If var2 = 3
   Goto, Three
Else if var2 = 2
   Goto, Two
Else
   Goto, One
One:
MsgBox, One
return
Two:
MsgBox, Two
return
Three:
MsgBox, Three
return

About
I was looking for a simple way to send plain text messages securely to a person or a group of people; a method that's faster than email, more secure than a public message board, lasts longer than a message sent with an instant messenger and more portable than a web browser or an email client.
I've come up with this half-assed solution. I thought, I'd share.
The basic idea is to store the messages encrypted and password-locked on a web server, so only those who know the name under which it's stored and the password can access them.
Not having an own web server to work with, for the storage I used openpaste.org where you can store text based stuff.
The script stores the messages this way: When it's launched, you can specify a group name and a password. It takes the message you want to send, encrypts it on the PC with the given password, encrypts the password with itself as a passphrase, the group name likewise, and places the encrypted message via HTTP on openpaste.org with the string generated from the group name as Author and locks it with the string generated from the password. As for the security: to read the message it has to be found, unlocked, downloaded and decrypted first, it's done automatically by the script.
For encryption method it uses Laszlo's RC4txttohex function, for the http queries it uses httpQuery by Heresy & derRaphael and for internally executing the received single line commands in remote control server mode it uses a trimmed version of the dynamic code execution function by Jonny.
For the multiline commands it uses embedded Autohotkey.exe.
The messages when cached are stored encrypted.
Obviously this stuff's not for replacing an instant messenger, e-mailing or a vnc app, but it's small and it can come in useful.

Tested on XP Pro SP2 and Vista Home Basic

I hope you'll find it useful.
All suggestions and corrections (concerning my AHK code or my English) are welcome:)
Cheers,
Gahks


Last edited by gahks on August 13th, 2009, 11:59 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: UPDATE: GroupMsg v1.1
PostPosted: March 22nd, 2009, 3:05 pm 
Offline

Joined: January 10th, 2009, 6:40 pm
Posts: 32
GroupMsg v1.1
New:
- Optional message cache
- Multilanguage support (translatable GUI)

Both features can be enabled by editing GroupMsg-Settings.ini (Download).
To enable message cache add the key "enable_cache" to the Default section of GroupMsg-Settings.ini, and set its value to 1.
To change the language of the GUI, download the sample ini file with the English language strings, translate them, rename the English section to the new language's name. (E.g. for German translation change [English] to [German]). Add the key "language" to the Default section and set its value to the new language's name. There is a Hungarian translation available, it's in the sample ini file.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 24th, 2009, 4:46 pm 
Offline

Joined: May 28th, 2007, 4:09 pm
Posts: 8
gahks

I havent' tried the script. But I would like to say that this is a very creative and interesting solution. I enjoyed reading your post which explains the script. Very creative use of openpaste.org as a "data store" . Thank you for sharing -Basi


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 13th, 2009, 9:19 pm 
Offline

Joined: January 10th, 2009, 6:40 pm
Posts: 32
@Basi: Thanks for your comment, glad you liked it.

Unfortunately due to some structural changes in the html at openpaste.org the script doesn't work properly anymore. If anyone feels like going through the code and correcting it and posting the working script, go right ahead! ;)

If I'll have some time to do it though, I will do it myself.

Cheers

gahks


Report this post
Top
 Profile  
Reply with quote  
 Post subject: UPDATE: GroupMsg 1.1.1
PostPosted: August 13th, 2009, 11:59 pm 
Offline

Joined: January 10th, 2009, 6:40 pm
Posts: 32
I took a quick look at the code and fixing it was as simple as directiing the http requests from www.openpaste.org to openpaste.org.
It's working again, I updated all the links and stuff. The fixed version is 1.1.1.

Cheers,

gahks


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 18 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group