What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Tool to encrypt or decrypt log files

Pages: (9): « First [ 1 ] 2 3 4 5 » Last »
Tool to encrypt or decrypt log files
Author: Message:
solus
Junior Member
**


Posts: 16
– / Male / –
Joined: Dec 2005
O.P. Tool to encrypt or decrypt log files
Hello.

I just thought I'd post this up here incase it helps anyone. Attached is a tool to encrypt or decrypt log files, I'll bring out a tool which will encrypt/decrypt a whole directory when I have more time.

To decrypt Messenger Plus! log files (C++):


Fileformat of .ple files

First 10 bytes are the same for all log files.
const char standardHeader[] = {0x10,0x01,'M','P','L','E','1','<','<',0};

The next 4 bytes, I'm not sure what they are for, but in all log files I've seen they are
const char unknownbytes[] = {1,0,0,0};

After this is the length of the password check string (4 bytes). This is usually 13
Then comes the encrypted password check string. Ill talk about how to decrypt it later.


All that was the header. For the rest of the file, it is in multiple chunks of data.
Each of these chunks start with the 'signature' :
const char sig[] = {0xE9,0xFF,0xA3,0x00};
After this, there is the length of the following data (4 bytes).
Then there is the encrypted text.



To decrypt text :

Messenger Plus! uses the CryptoAPI to encrypt and decrypt text.
This is set up with the following call
CryptAcquireContextW(&hProv,L"MessengerPlusEncryptProvider",L"Microsoft Enhanced Cryptographic Provider v1.0",1,0);

I discovered that for some reason, the password is scrambled, and that the password is unicode (2 bytes).^o)
The algorithm for this in pseudo code is:

for i = 0 to length of password - 1
        newpassword [i] = password[i] + password [i + 1]
next i
newpassword[last letter] = password[last letter] + password[0]


The calls to continue setting up so that you can decrypt text are:

CryptCreateHash(hProv,0x8003,0,0,&hHash);
CryptHashData(hHash,newpassword,len,0);
CryptDeriveKey(hProv,0x6801,hHash,0x800000,&hKey);

This final call gives you a HCRYPTKEY which you can use in the CryptEncrypt and CryptDecrypt functions on the text :D

Sorry if this is all a bit confusing, I dont think i formatted it, or explained it very well :$

Solus


Edit - I replaced the file with one which has the VC runtime library statically linked, so it *should* work now

Edit 2 - Ok, so I converted it all to unicode, and made a few changes so it'll run on computers which haven't got Messenger Plus on.

.exe File Attachment: mpLogs.exe (56 KB)
This file has been downloaded 13518 time(s).

This post was edited on 01-18-2006 at 09:01 PM by solus.
01-09-2006 07:25 PM
Profile PM Find Quote Report
WDZ
Former Admin
*****

Avatar

Posts: 7106
Reputation: 107
– / Male / Flag
Joined: Mar 2002
RE: Tool to encrypt or decrypt log files
This thread was temporarily moved to a staff-only forum for a few days, pending approval from Patchou, who is busy coding.

He finally replied about an hour ago, and he doesn't seem to have a problem with this thread, so I have moved it back. :)
01-13-2006 09:44 PM
Profile PM Web Find Quote Report
Dane
Non-Elite Member
*****

Avatar
Dont ask to ask, just ASK!

Posts: 1621
Reputation: 52
35 / Male / Flag
Joined: Dec 2002
Status: Away
RE: Tool to encrypt or decrypt log files
Thanks for the tool, will come in handy
01-16-2006 08:03 AM
Profile PM Web Find Quote Report
ipab
Veteran Member
*****

Avatar
Design Evolved

Posts: 1017
Reputation: 32
34 / Male / Flag
Joined: May 2004
RE: Tool to encrypt or decrypt log files
seems like the file is corrupt :s
56656E692C 20566964692C 2056696369
01-16-2006 08:57 AM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Tool to encrypt or decrypt log files
quote:
Originally posted by WDZ
he doesn't seem to have a problem with this thread
:O:O:O:O
TBH, I was extremely surprised reading that...

quote:
Originally posted by solus
Attached is a tool to encrypt or decrypt log files
Your tool does not work!; it doesn't start...

[Image: attachment.php?pid=591415]


--------

PS: The explanations are indeed a bit confussing, but I'm not going to explain it in a better way to keep this somewhat away from "script kiddies" though :D

Though:
quote:
Originally posted by solus
This is usually 13
It is always 13. Though, nothing says this could be changed in the futur. Although I doubt it for backward compatibility reasons.

quote:
Originally posted by solus
I discovered that for some reason, the password is scrambled, and that the password is unicode (2 bytes).^o)
The password is "scrambled" for better security (so the API isn't called with the text password in plain sight). Although that didn't kept you from discovering it though, hehehe :p

But more importantly, the password is unicode because you can enter unicode characters. Remember that this also has implications of how the password is scrambled. Your pseudo-code is correct (appart from "0 to length" which should be "length-1") although lacks the big notice that all characters must be interpreted as unicode characters, as that is what they are, not as ascii characters.

(and this is also where one of those bugs were in old Plus! versions in regards to the "changing password")

PS2: And don't forget to destroy the handles of the key, hash and crypto provider.

.gif File Attachment: error.gif (2.04 KB)
This file has been downloaded 24644 time(s).

This post was edited on 01-16-2006 at 09:44 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
01-16-2006 09:11 AM
Profile PM Find Quote Report
solus
Junior Member
**


Posts: 16
– / Male / –
Joined: Dec 2005
O.P. RE: Tool to encrypt or decrypt log files
I'm not sure what the problem is. I just tried downloading it and it works fine on my computer....

Maybe it requires a DLL file you havent got?
Have you got MSVCR80.DLL?

Thanks for moving it back WDZ :D
01-16-2006 07:19 PM
Profile PM Find Quote Report
dotNorma
Veteran Member
*****

Avatar

Posts: 1745
Reputation: 17
32 / Male / –
Joined: May 2003
RE: Tool to encrypt or decrypt log files
quote:
Originally posted by solus
I'm not sure what the problem is. I just tried downloading it and it works fine on my computer....

Maybe it requires a DLL file you havent got?
Have you got MSVCR80.DLL?

Thanks for moving it back WDZ :D

I get the same error and a system search did not turn up the dll.
01-16-2006 07:26 PM
Profile PM Web Find Quote Report
solus
Junior Member
**


Posts: 16
– / Male / –
Joined: Dec 2005
O.P. RE: Tool to encrypt or decrypt log files
Try putting this DLL in the same folder as the exe.

If that doesn't  work, install the C++ runtime maybe? I don't know...*-)

.zip File Attachment: dllfile.zip (309.04 KB)
This file has been downloaded 2107 time(s).
01-16-2006 07:31 PM
Profile PM Find Quote Report
dotNorma
Veteran Member
*****

Avatar

Posts: 1745
Reputation: 17
32 / Male / –
Joined: May 2003
RE: Tool to encrypt or decrypt log files
quote:
Originally posted by solus
Try putting this DLL in the same folder as the exe.

If that doesn't  work, install the C++ runtime maybe? I don't know...*-)

I put the dll in the same directory as the exe, as well as in C:/Windows/System but I still get the same error message.

As for installing the C++ Runtimes, I dont actually have a use for this tool at the moment so I dont feel like going through the trouble.

Very good job deciphering the logs though!
01-16-2006 08:19 PM
Profile PM Web Find Quote Report
solus
Junior Member
**


Posts: 16
– / Male / –
Joined: Dec 2005
O.P. RE: RE: Tool to encrypt or decrypt log files
quote:
Originally posted by .Norma

I put the dll in the same directory as the exe, as well as in C:/Windows/System but I still get the same error message.


Ok, I'll test it out a bit more and see if I can find the problem

quote:
Originally posted by .Norma

Very good job deciphering the logs though!


Thanks :)
01-16-2006 08:32 PM
Profile PM Find Quote Report
Pages: (9): « First [ 1 ] 2 3 4 5 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On