Jump to content

connect to msn


karman
 Share

Recommended Posts

dirty code whipped it together some time ago.

Global $MSN_ADDRESS = "207.46.111.71"
Global $MSN_PORT = 1863
Global $RecvTimeout = 2000
Global $ConnectDelay = 500
Global $trID = 0
Global $RecvDelay = 200

Global $MSN_ACCOUNT = "account@msn.com"
Global $MSN_PASSWORD = "123"

TCPStartup()
Connect()



; *************************************************************
$RECV = ''
While (1)
    $RECV = TCPRecv($MSN_SOCKET, 2048)
    Select
        Case @error
            MsgBox(0, "ERROR", "Socket has disconnected, exit!")
            Exit
        Case $RECV
            FileWriteLine("RECV.txt", "RECV > " & $RECV)
    EndSelect
    Sleep(10)
WEnd
; *************************************************************



Func Connect()
MsgBox(0, "INFO", "Connecting to: " & $MSN_ADDRESS &":"&$MSN_PORT)
$MSN_SOCKET = TCPConnect($MSN_ADDRESS, $MSN_PORT)
if $MSN_SOCKET = -1 Then
    MsgBox(0, "ERROR", "Unable to connect")
    Exit
EndIf
Sleep($ConnectDelay)
TCPSend($MSN_SOCKET, "VER " & $trID & " MSNP8 CVR0")
$tRID = $trID + 1
RECV($MSN_SOCKET)
TCPSend($MSN_SOCKET, "CVR " & $trID & " 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS " & $MSN_ACCOUNT)
$tRID = $trID + 1
RECV($MSN_SOCKET)
TCPSend($MSN_SOCKET, "USR " & $trID & " TWN I " & $MSN_ACCOUNT)
$tRID = $trID + 1
RECV($MSN_SOCKET)
$params = StringSplit($RECV, " ")
$auth = $params[5] ;challenge string
MsgBox(0, "INFO", "Got the challenge string!")
; get ticket
$oHttp.Open("GET", "https://nexus.passport.com/rdr/pprdr.asp",false)
$oHttp.Send()
$status = $oHttp.Status
$txt = $oHttp.GetAllResponseHeaders
$LoginServer = _StringBetween($txt, "DALogin=", ",DA")
$oHttp.Open("GET", "https://" & $LoginServer[0],false)
$MSN_ACC = StringReplace($MSN_ACCOUNT, "@", "%40")
$oHttp.SetRequestHeader("Authorization", "Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=" & $MSN_ACC & ",pwd=" & $MSN_PASSWORD &"," & $auth & @CRLF)
$oHttp.Send()
$txt = $oHttp.GetAllResponseHeaders
$ticket = _StringBetween($txt, "'", "'")
MsgBox(0, "INFO", "Got the ClientTicket!")
TCPSend($MSN_SOCKET, "USR " & $trID & " TWN S " & $ticket[0])
$tRID = $trID + 1
RECV($MSN_SOCKET)
Sleep($ConnectDelay)
TCPSend($MSN_SOCKET, "SYN " & $trID & " 422")
$triD = $trid + 1
TCPSend($MSN_SOCKET, "CHG " & $trID & " NLN 0") ; change to Online status
$tRID = $trID + 1
RECV($MSN_SOCKET)
TCPSend($MSN_SOCKET, "PNG")
RECV($MSN_SOCKET)
sleep(2500)
do 
    $recv = tcprecv($MSN_SOCKET,500)
    sleep(10)
until $recv = ''
MsgBox(0, "INFO", "Connected!")
Set($EDIT, "******************************************************" & @CRLF & @CRLF)
Return 1
EndFunc

Func RECV($S)
    $recvTimer = TimerInit()
    While(1)
    $RECV = TCPRecv($S, 24000)
    If $RECV Then
        FileWriteLine("RECV.txt", "RECV > " & $RECV)
        Return 1
    EndIf
    If TimerDiff($recvTimer) > $recvTimeout Then
        MsgBox(0, "ERROR", "Unable to RECV")
        Return 0
    EndIf
    Sleep($RecvDelay)
    WEnd
EndFunc

Func _StringBetween($sString, $sStart, $sEnd) ; modified
        Local $sHold = '', $sSnSStart = '', $sSnSEnd = ''
        While StringLen($sString) > 0
            $sSnSStart = StringInStr($sString, $sStart)
            If Not $sSnSStart Then ExitLoop
            $sString = StringTrimLeft($sString, ($sSnSStart + StringLen($sStart)) - 1)
            $sSnSEnd = StringInStr($sString, $sEnd)
            If Not $sSnSEnd Then ExitLoop
            $sHold &= StringLeft($sString, $sSnSEnd - 1) & Chr(1)
            $sString = StringTrimLeft($sString, $sSnSEnd)
        WEnd
        If Not $sHold Then Return SetError(1, 0, 0)
        $sHold = StringSplit(StringTrimRight($sHold, 1), Chr(1))
        Local $avArray[UBound($sHold) - 1]
        For $iCC = 1 To UBound($sHold) - 1
            $avArray[$iCC - 1] = $sHold[$iCC]
        Next
        Return $avArray
EndFunc


Func OnAutoItExit()
;PluginClose($plH)
TCPCloseSocket($MSN_SOCKET)
TCPShutdown()
EndFunc

To test it you need a working msn account

if any questions just pm me or post here

Edited by karman
Link to comment
Share on other sites

dirty code whipped it together some time ago.

Global $MSN_ADDRESS = "207.46.111.71"
Global $MSN_PORT = 1863
Global $RecvTimeout = 2000
Global $ConnectDelay = 500
Global $trID = 0
Global $RecvDelay = 200

Global $MSN_ACCOUNT = "account@msn.com"
Global $MSN_PASSWORD = "123"

TCPStartup()
Connect()
; *************************************************************
$RECV = ''
While (1)
    $RECV = TCPRecv($MSN_SOCKET, 2048)
    Select
        Case @error
            MsgBox(0, "ERROR", "Socket has disconnected, exit!")
            Exit
        Case $RECV
            FileWriteLine("RECV.txt", "RECV > " & $RECV)
    EndSelect
    Sleep(10)
WEnd
; *************************************************************
Func Connect()
MsgBox(0, "INFO", "Connecting to: " & $MSN_ADDRESS &":"&$MSN_PORT)
$MSN_SOCKET = TCPConnect($MSN_ADDRESS, $MSN_PORT)
if $MSN_SOCKET = -1 Then
    MsgBox(0, "ERROR", "Unable to connect")
    Exit
EndIf
Sleep($ConnectDelay)
TCPSend($MSN_SOCKET, "VER " & $trID & " MSNP8 CVR0")
$tRID = $trID + 1
RECV($MSN_SOCKET)
TCPSend($MSN_SOCKET, "CVR " & $trID & " 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS " & $MSN_ACCOUNT)
$tRID = $trID + 1
RECV($MSN_SOCKET)
TCPSend($MSN_SOCKET, "USR " & $trID & " TWN I " & $MSN_ACCOUNT)
$tRID = $trID + 1
RECV($MSN_SOCKET)
$params = StringSplit($RECV, " ")
$auth = $params[5] ;challenge string
MsgBox(0, "INFO", "Got the challenge string!")
; get ticket
$oHttp.Open("GET", "https://nexus.passport.com/rdr/pprdr.asp",false)
$oHttp.Send()
$status = $oHttp.Status
$txt = $oHttp.GetAllResponseHeaders
$LoginServer = _StringBetween($txt, "DALogin=", ",DA")
$oHttp.Open("GET", "https://" & $LoginServer[0],false)
$MSN_ACC = StringReplace($MSN_ACCOUNT, "@", "%40")
$oHttp.SetRequestHeader("Authorization", "Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=" & $MSN_ACC & ",pwd=" & $MSN_PASSWORD &"," & $auth & @CRLF)
$oHttp.Send()
$txt = $oHttp.GetAllResponseHeaders
$ticket = _StringBetween($txt, "'", "'")
MsgBox(0, "INFO", "Got the ClientTicket!")
TCPSend($MSN_SOCKET, "USR " & $trID & " TWN S " & $ticket[0])
$tRID = $trID + 1
RECV($MSN_SOCKET)
Sleep($ConnectDelay)
TCPSend($MSN_SOCKET, "SYN " & $trID & " 422")
$triD = $trid + 1
TCPSend($MSN_SOCKET, "CHG " & $trID & " NLN 0") ; change to Online status
$tRID = $trID + 1
RECV($MSN_SOCKET)
TCPSend($MSN_SOCKET, "PNG")
RECV($MSN_SOCKET)
sleep(2500)
do 
    $recv = tcprecv($MSN_SOCKET,500)
    sleep(10)
until $recv = ''
MsgBox(0, "INFO", "Connected!")
Set($EDIT, "******************************************************" & @CRLF & @CRLF)
Return 1
EndFunc

Func RECV($S)
    $recvTimer = TimerInit()
    While(1)
    $RECV = TCPRecv($S, 24000)
    If $RECV Then
        FileWriteLine("RECV.txt", "RECV > " & $RECV)
        Return 1
    EndIf
    If TimerDiff($recvTimer) > $recvTimeout Then
        MsgBox(0, "ERROR", "Unable to RECV")
        Return 0
    EndIf
    Sleep($RecvDelay)
    WEnd
EndFunc

Func _StringBetween($sString, $sStart, $sEnd) ; modified
        Local $sHold = '', $sSnSStart = '', $sSnSEnd = ''
        While StringLen($sString) > 0
            $sSnSStart = StringInStr($sString, $sStart)
            If Not $sSnSStart Then ExitLoop
            $sString = StringTrimLeft($sString, ($sSnSStart + StringLen($sStart)) - 1)
            $sSnSEnd = StringInStr($sString, $sEnd)
            If Not $sSnSEnd Then ExitLoop
            $sHold &= StringLeft($sString, $sSnSEnd - 1) & Chr(1)
            $sString = StringTrimLeft($sString, $sSnSEnd)
        WEnd
        If Not $sHold Then Return SetError(1, 0, 0)
        $sHold = StringSplit(StringTrimRight($sHold, 1), Chr(1))
        Local $avArray[UBound($sHold) - 1]
        For $iCC = 1 To UBound($sHold) - 1
            $avArray[$iCC - 1] = $sHold[$iCC]
        Next
        Return $avArray
EndFunc
Func OnAutoItExit()
;PluginClose($plH)
TCPCloseSocket($MSN_SOCKET)
TCPShutdown()
EndFunc

To test it you need a working msn account

if any questions just pm me or post here

an example would come in handy u know.

Link to comment
Share on other sites

It looks good... Pity I can't get it to fully work. Otherwise this would be great! Maybe you should create a UDF with _MSN_Connect (), _MSN_RECEIVE and so on... <_<

And Ashley... Before you decide to edit your post or what not... "Cut the CRAP" If you bothered to even read the first post, you would have noticed one thing. It is an example!

Edited by Bert
Link to comment
Share on other sites

yeah.. the code iposted will connect to the msn server.. after that u can connect to the switchboard (conversations etc)

also you will need to respond to the ping/challenge.. like this

$clientID = "Q1P7W2E4J9R8U3S5"

If StringLeft($RECV, 3) == "CHL" Then
                        $trID =+ 1
            $Challenge = StringSplit($recv, " ") ; get the params
            $Challenge = StringStripWS($Challenge[3], 8) ; param3 = challenge
            $hash = StringLower(MD5Hash($challenge & $clientID, 2, True))
            $response = "QRY " & $trID & " msmsgs@msnmsgr.com 32" & @CRLF & $hash
            TCPSend($MSN_SOCKET, $response)

you need to use md5 hash plugin, it's posted in forums.

Link to comment
Share on other sites

Do you reckon you can fix up your code enough to make it work? I'd really like to see this working... Its a great example. <_<

I edited this (BETA!)

#include <GUIConstants.au3>
#Include <GuiEdit.au3>
Global $MSN_ADDRESS = "207.46.111.71" 
Global $MSN_PORT = 1863
Global $RecvTimeout = 2000
Global $ConnectDelay = 500
Global $trID = 0
Global $RecvDelay = 200
Global $MSN_ACCOUNT = "" 
Global $MSN_PASSWORD = "" 
Global $MSN_SOCKET
Global $oHttp = ObjCreate("InternetExplorer.Application.1")
TCPStartup()
$HWND = GUICreate("MSN CONNECT TEST", 300, 200)
$EDIT = GUICtrlCreateEdit("", 0, 0, 300, 200)
GUISetState(@SW_SHOW)
Connect()

; *************************************************************
$RECV = ''
While (1)
    $MSG = GUIGetMsg()
    $RECV = TCPRecv($MSN_SOCKET, 2048)
    Select
        Case $MSG = $GUI_EVENT_CLOSE
            Exit
        Case @error
            _GUICtrlEdit_AppendText ($EDIT, "Socket has disconnected, exit!")
            Exit
        Case $RECV
            _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"[" & @Hour & ":" & @MIN & ":" & @SEC & "] " & $RECV)
    EndSelect
    Sleep(10)
WEnd
; *************************************************************



Func Connect()
    _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"Connecting to: " & $MSN_ADDRESS & ":" & $MSN_PORT & @CRLF)
    $MSN_SOCKET = TCPConnect($MSN_ADDRESS, $MSN_PORT)
    If $MSN_SOCKET = -1 Then
        _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"Unable to connect" & @CRLF)
        Exit
    EndIf
    Sleep($ConnectDelay)
    TCPSend($MSN_SOCKET, "VER " & $trID & " MSNP8 CVR0")
    $trID = $trID + 1
    RECV($MSN_SOCKET)
    TCPSend($MSN_SOCKET, "CVR " & $trID & " 0x0409 win 4.10 i386 MSNMSGR 5.0.0544 MSMSGS " & $MSN_ACCOUNT)
    $trID = $trID + 1
    RECV($MSN_SOCKET)
    TCPSend($MSN_SOCKET, "USR " & $trID & " TWN I " & $MSN_ACCOUNT)
    $trID = $trID + 1
    RECV($MSN_SOCKET)
    $params = StringSplit($RECV, " ")
    $auth = $params[5] ;challenge string
    _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"Got the challenge string!" & @CRLF)
    ; get ticket
    $oHttp.Open ("GET", "https://nexus.passport.com/rdr/pprdr.asp", False)
    $oHttp.Send()
    $status = $oHttp.Status
    $txt = $oHttp.GetAllResponseHeaders
    $LoginServer = _StringBetween($txt, "DALogin=", ",DA")
    $oHttp.Open ("GET", "https://" & $LoginServer[0], False)
    $MSN_ACC = StringReplace($MSN_ACCOUNT, "@", "%40")
    $oHttp.SetRequestHeader ("Authorization", "Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in=" & $MSN_ACC & ",pwd=" & $MSN_PASSWORD & "," & $auth & @CRLF)
    $oHttp.Send()
    $txt = $oHttp.GetAllResponseHeaders
    $ticket = _StringBetween($txt, "'", "'")
    _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"Got the ClientTicket!")
    TCPSend($MSN_SOCKET, "USR " & $trID & " TWN S " & $ticket[0])
    $trID = $trID + 1
    RECV($MSN_SOCKET)
    Sleep($ConnectDelay)
    TCPSend($MSN_SOCKET, "SYN " & $trID & " 422")
    $trID = $trID + 1
    TCPSend($MSN_SOCKET, "CHG " & $trID & " NLN 0") ; change to Online status
    $trID = $trID + 1
    RECV($MSN_SOCKET)
    TCPSend($MSN_SOCKET, "PNG")
    RECV($MSN_SOCKET)
    Sleep(2500)
    Do
        $RECV = TCPRecv($MSN_SOCKET, 500)
        Sleep(10)
    Until $RECV = ''
    _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " & "Connected!" & @CRLF)
    _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " & "******************************************************" & @CRLF & @CRLF)
    Return 1
EndFunc   ;==>Connect

Func RECV($S)
    $recvTimer = TimerInit()
    While (1)
        $RECV = TCPRecv($S, 24000)
        If $RECV Then
            _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"[" & @Hour & ":" & @MIN & ":" & @SEC & "] " & $RECV & @CRLF)
            Return 1
        EndIf
        If TimerDiff($recvTimer) > $RecvTimeout Then
            _GUICtrlEdit_AppendText($EDIT, "[" & @Hour & ":" & @MIN & ":" & @SEC & "] " &"[" & @Hour & ":" & @MIN & ":" & @SEC & "] " & "Unable to RECV" & @CRLF)
            Return 0
        EndIf
        Sleep($RecvDelay)
    WEnd
EndFunc   ;==>RECV

Func _StringBetween($sString, $sStart, $sEnd) ; modified
    Local $sHold = '', $sSnSStart = '', $sSnSEnd = ''
    While StringLen($sString) > 0
        $sSnSStart = StringInStr($sString, $sStart)
        If Not $sSnSStart Then ExitLoop
        $sString = StringTrimLeft($sString, ($sSnSStart + StringLen($sStart)) - 1)
        $sSnSEnd = StringInStr($sString, $sEnd)
        If Not $sSnSEnd Then ExitLoop
        $sHold &= StringLeft($sString, $sSnSEnd - 1) & Chr(1)
        $sString = StringTrimLeft($sString, $sSnSEnd)
    WEnd
    If Not $sHold Then Return SetError(1, 0, 0)
    $sHold = StringSplit(StringTrimRight($sHold, 1), Chr(1))
    Local $avArray[UBound($sHold) - 1]
    For $iCC = 1 To UBound($sHold) - 1
        $avArray[$iCC - 1] = $sHold[$iCC]
    Next
    Return $avArray
EndFunc   ;==>_StringBetween


Func OnAutoItExit()
    ;PluginClose($plH)
    TCPCloseSocket($MSN_SOCKET)
    TCPShutdown()
EndFunc   ;==>OnAutoItExit
Edited by Bert
Link to comment
Share on other sites

  • 3 months later...

so say i want to send a message to someone, how would i do that?

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

so say i want to send a message to someone, how would i do that?

This is Example scripts, not General Help and Support.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Link to comment
Share on other sites

yes this is example scripts. i am asking how to use the example script. as the people who use it obviously know. so once again.. with the working, consol like example, ow would i send a message to someone.

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

yes this is example scripts. i am asking how to use the example script. as the people who use it obviously know. so once again.. with the working, consol like example, ow would i send a message to someone.

look at the example. i think it as in there...

Actually... I lie. lol. Did you have a look at the link I said in one of your many msn related topics?

Edited by Bert
Link to comment
Share on other sites

i did but i still dont understand, im a little confused.

Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

Hi all!

for those who have problems with the UNDEFINED FUNCTION!

That Dll didnt work for me, I search a lot on how to make it work but I got no clues. I found a workaround.

try this:

1- Swap that line for this one:

Line 51:

$hash = StringLower(MD5($Challenge & $clientID))oÝ÷ Û`vØb±Êy«mç§víë®*mjëh×6;*******************************************************************************
; MD5 (FUNCTION)
;
; PARAMETERS:
; (In/Out) - sMessage - String - String to be digested
;
; RETURN VALUE:
; String - The MD5 digest
;
; DESCRIPTION:
; This function takes a string message and generates an MD5 digest for it.
; sMessage can be up to the VB string length limit of 2^31 (approx. 2 billion)
; characters.
;
; NOTE: Due to the way in which the string is processed the routine assumes a
; single byte character set. VB passes unicode (2-byte) character strings, the
; ConvertToWordArray function uses on the first byte for each character. This
; has been done this way for ease of use, to make the routine truely portable
; you could accept a byte array instead, it would then be up to the calling
; routine to make sure that the byte array is generated from their string in
; a manner consistent with the string type.
;*******************************************************************************
Func MD5($sMessage)
    
    Const $S11  = 7
    Const $S12  = 12
    Const $S13  = 17
    Const $S14  = 22
    Const $S21  = 5
    Const $S22  = 9
    Const $S23  = 14
    Const $S24  = 20
    Const $S31  = 4
    Const $S32  = 11
    Const $S33  = 16
    Const $S34  = 23
    Const $S41  = 6
    Const $S42  = 10
    Const $S43  = 15
    Const $S44  = 21

    Class_Initialize()
    
    ; Steps 1 and 2.  Append padding bits and length and convert to words
    $x = ConvertToWordArray($sMessage)
    
    ; Step 3.  Initialise
    $a = 0x67452301
    $b = 0xEFCDAB89
    $c = 0x98BADCFE
    $d = 0x10325476

    ; Step 4.  Process the message in 16-word blocks
    For $k = 0 To UBound($x)-1 Step 16
        $AA = $a
        $BB = $b
        $CC = $c
        $DD = $d
        
        ; The hex number on the end of each of the following procedure calls is
        ; an element from the 64 element table constructed with
        ; T(i) = Int(4294967296 * Abs(Sin(i))) where i is 1 to 64.
        ;
        ; However, for speed we don't want to calculate the value every time.
        FF( $a, $b, $c, $d, $x[$k + 0], $S11, 0xD76AA478 )
        FF( $d, $a, $b, $c, $x[$k + 1], $S12, 0xE8C7B756 )
        FF( $c, $d, $a, $b, $x[$k + 2], $S13, 0x242070DB )
        FF( $b, $c, $d, $a, $x[$k + 3], $S14, 0xC1BDCEEE )
        FF( $a, $b, $c, $d, $x[$k + 4], $S11, 0xF57C0FAF )
        FF( $d, $a, $b, $c, $x[$k + 5], $S12, 0x4787C62A )
        FF( $c, $d, $a, $b, $x[$k + 6], $S13, 0xA8304613 )
        FF( $b, $c, $d, $a, $x[$k + 7], $S14, 0xFD469501 )
        FF( $a, $b, $c, $d, $x[$k + 8], $S11, 0x698098D8 )
        FF( $d, $a, $b, $c, $x[$k + 9], $S12, 0x8B44F7AF )
        FF( $c, $d, $a, $b, $x[$k + 10], $S13, 0xFFFF5BB1)
        FF( $b, $c, $d, $a, $x[$k + 11], $S14, 0x895CD7BE)
        FF( $a, $b, $c, $d, $x[$k + 12], $S11, 0x6B901122)
        FF( $d, $a, $b, $c, $x[$k + 13], $S12, 0xFD987193)
        FF( $c, $d, $a, $b, $x[$k + 14], $S13, 0xA679438E)
        FF( $b, $c, $d, $a, $x[$k + 15], $S14, 0x49B40821)
    
        GG( $a, $b, $c, $d, $x[$k + 1], $S21, 0xF61E2562 )
        GG( $d, $a, $b, $c, $x[$k + 6], $S22, 0xC040B340 )
        GG( $c, $d, $a, $b, $x[$k + 11], $S23, 0x265E5A51)
        GG( $b, $c, $d, $a, $x[$k + 0], $S24, 0xE9B6C7AA )
        GG( $a, $b, $c, $d, $x[$k + 5], $S21, 0xD62F105D )
        GG( $d, $a, $b, $c, $x[$k + 10], $S22, 0x2441453 )
        GG( $c, $d, $a, $b, $x[$k + 15], $S23, 0xD8A1E681)
        GG( $b, $c, $d, $a, $x[$k + 4], $S24, 0xE7D3FBC8 )
        GG( $a, $b, $c, $d, $x[$k + 9], $S21, 0x21E1CDE6 )
        GG( $d, $a, $b, $c, $x[$k + 14], $S22, 0xC33707D6)
        GG( $c, $d, $a, $b, $x[$k + 3], $S23, 0xF4D50D87 )
        GG( $b, $c, $d, $a, $x[$k + 8], $S24, 0x455A14ED )
        GG( $a, $b, $c, $d, $x[$k + 13], $S21, 0xA9E3E905)
        GG( $d, $a, $b, $c, $x[$k + 2], $S22, 0xFCEFA3F8 )
        GG( $c, $d, $a, $b, $x[$k + 7], $S23, 0x676F02D9 )
        GG( $b, $c, $d, $a, $x[$k + 12], $S24, 0x8D2A4C8A)
            
        HH( $a, $b, $c, $d, $x[$k + 5], $S31, 0xFFFA3942 )
        HH( $d, $a, $b, $c, $x[$k + 8], $S32, 0x8771F681 )
        HH( $c, $d, $a, $b, $x[$k + 11], $S33, 0x6D9D6122)
        HH( $b, $c, $d, $a, $x[$k + 14], $S34, 0xFDE5380C)
        HH( $a, $b, $c, $d, $x[$k + 1], $S31, 0xA4BEEA44 )
        HH( $d, $a, $b, $c, $x[$k + 4], $S32, 0x4BDECFA9 )
        HH( $c, $d, $a, $b, $x[$k + 7], $S33, 0xF6BB4B60 )
        HH( $b, $c, $d, $a, $x[$k + 10], $S34, 0xBEBFBC70)
        HH( $a, $b, $c, $d, $x[$k + 13], $S31, 0x289B7EC6)
        HH( $d, $a, $b, $c, $x[$k + 0], $S32, 0xEAA127FA )
        HH( $c, $d, $a, $b, $x[$k + 3], $S33, 0xD4EF3085 )
        HH( $b, $c, $d, $a, $x[$k + 6], $S34, 0x4881D05  )
        HH( $a, $b, $c, $d, $x[$k + 9], $S31, 0xD9D4D039 )
        HH( $d, $a, $b, $c, $x[$k + 12], $S32, 0xE6DB99E5)
        HH( $c, $d, $a, $b, $x[$k + 15], $S33, 0x1FA27CF8)
        HH( $b, $c, $d, $a, $x[$k + 2], $S34, 0xC4AC5665 )
    
        II( $a, $b, $c, $d, $x[$k + 0], $S41, 0xF4292244 )
        II( $d, $a, $b, $c, $x[$k + 7], $S42, 0x432AFF97 )
        II( $c, $d, $a, $b, $x[$k + 14], $S43, 0xAB9423A7)
        II( $b, $c, $d, $a, $x[$k + 5], $S44, 0xFC93A039 )
        II( $a, $b, $c, $d, $x[$k + 12], $S41, 0x655B59C3)
        II( $d, $a, $b, $c, $x[$k + 3], $S42, 0x8F0CCC92 )
        II( $c, $d, $a, $b, $x[$k + 10], $S43, 0xFFEFF47D)
        II( $b, $c, $d, $a, $x[$k + 1], $S44, 0x85845DD1 )
        II( $a, $b, $c, $d, $x[$k + 8], $S41, 0x6FA87E4F )
        II( $d, $a, $b, $c, $x[$k + 15], $S42, 0xFE2CE6E0)
        II( $c, $d, $a, $b, $x[$k + 6], $S43, 0xA3014314 )
        II( $b, $c, $d, $a, $x[$k + 13], $S44, 0x4E0811A1)
        II( $a, $b, $c, $d, $x[$k + 4], $S41, 0xF7537E82 )
        II( $d, $a, $b, $c, $x[$k + 11], $S42, 0xBD3AF235)
        II( $c, $d, $a, $b, $x[$k + 2], $S43, 0x2AD7D2BB )
        II( $b, $c, $d, $a, $x[$k + 9], $S44, 0xEB86D391 )
    
        $a = AddUnsigned($a, $AA)
        $b = AddUnsigned($b, $BB)
        $c = AddUnsigned($c, $CC)
        $d = AddUnsigned($d, $DD)
    Next
    
    ; Step 5.  Output the 128 bit digest
   Return StringLower(WordToHex($a) & WordToHex($B) & WordToHex($c) & WordToHex($d))
EndFunc
You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
Link to comment
Share on other sites

Hi all!

for those who have problems with the UNDEFINED FUNCTION!

That Dll didnt work for me, I search a lot on how to make it work but I got no clues. I found a workaround.

try this:

1- Swap that line for this one:

Line 51:

$hash = StringLower(MD5($Challenge & $clientID))oÝ÷ Û`vØb±Êy«mç§víë®*mjëh×6;*******************************************************************************
; MD5 (FUNCTION)
;
; PARAMETERS:
; (In/Out) - sMessage - String - String to be digested
;
; RETURN VALUE:
; String - The MD5 digest
;
; DESCRIPTION:
; This function takes a string message and generates an MD5 digest for it.
; sMessage can be up to the VB string length limit of 2^31 (approx. 2 billion)
; characters.
;
; NOTE: Due to the way in which the string is processed the routine assumes a
; single byte character set. VB passes unicode (2-byte) character strings, the
; ConvertToWordArray function uses on the first byte for each character. This
; has been done this way for ease of use, to make the routine truely portable
; you could accept a byte array instead, it would then be up to the calling
; routine to make sure that the byte array is generated from their string in
; a manner consistent with the string type.
;*******************************************************************************
Func MD5($sMessage)
    
    Const $S11  = 7
    Const $S12  = 12
    Const $S13  = 17
    Const $S14  = 22
    Const $S21  = 5
    Const $S22  = 9
    Const $S23  = 14
    Const $S24  = 20
    Const $S31  = 4
    Const $S32  = 11
    Const $S33  = 16
    Const $S34  = 23
    Const $S41  = 6
    Const $S42  = 10
    Const $S43  = 15
    Const $S44  = 21

    Class_Initialize()
    
    ; Steps 1 and 2.  Append padding bits and length and convert to words
    $x = ConvertToWordArray($sMessage)
    
    ; Step 3.  Initialise
    $a = 0x67452301
    $b = 0xEFCDAB89
    $c = 0x98BADCFE
    $d = 0x10325476

    ; Step 4.  Process the message in 16-word blocks
    For $k = 0 To UBound($x)-1 Step 16
        $AA = $a
        $BB = $b
        $CC = $c
        $DD = $d
        
        ; The hex number on the end of each of the following procedure calls is
        ; an element from the 64 element table constructed with
        ; T(i) = Int(4294967296 * Abs(Sin(i))) where i is 1 to 64.
        ;
        ; However, for speed we don't want to calculate the value every time.
        FF( $a, $b, $c, $d, $x[$k + 0], $S11, 0xD76AA478 )
        FF( $d, $a, $b, $c, $x[$k + 1], $S12, 0xE8C7B756 )
        FF( $c, $d, $a, $b, $x[$k + 2], $S13, 0x242070DB )
        FF( $b, $c, $d, $a, $x[$k + 3], $S14, 0xC1BDCEEE )
        FF( $a, $b, $c, $d, $x[$k + 4], $S11, 0xF57C0FAF )
        FF( $d, $a, $b, $c, $x[$k + 5], $S12, 0x4787C62A )
        FF( $c, $d, $a, $b, $x[$k + 6], $S13, 0xA8304613 )
        FF( $b, $c, $d, $a, $x[$k + 7], $S14, 0xFD469501 )
        FF( $a, $b, $c, $d, $x[$k + 8], $S11, 0x698098D8 )
        FF( $d, $a, $b, $c, $x[$k + 9], $S12, 0x8B44F7AF )
        FF( $c, $d, $a, $b, $x[$k + 10], $S13, 0xFFFF5BB1)
        FF( $b, $c, $d, $a, $x[$k + 11], $S14, 0x895CD7BE)
        FF( $a, $b, $c, $d, $x[$k + 12], $S11, 0x6B901122)
        FF( $d, $a, $b, $c, $x[$k + 13], $S12, 0xFD987193)
        FF( $c, $d, $a, $b, $x[$k + 14], $S13, 0xA679438E)
        FF( $b, $c, $d, $a, $x[$k + 15], $S14, 0x49B40821)
    
        GG( $a, $b, $c, $d, $x[$k + 1], $S21, 0xF61E2562 )
        GG( $d, $a, $b, $c, $x[$k + 6], $S22, 0xC040B340 )
        GG( $c, $d, $a, $b, $x[$k + 11], $S23, 0x265E5A51)
        GG( $b, $c, $d, $a, $x[$k + 0], $S24, 0xE9B6C7AA )
        GG( $a, $b, $c, $d, $x[$k + 5], $S21, 0xD62F105D )
        GG( $d, $a, $b, $c, $x[$k + 10], $S22, 0x2441453 )
        GG( $c, $d, $a, $b, $x[$k + 15], $S23, 0xD8A1E681)
        GG( $b, $c, $d, $a, $x[$k + 4], $S24, 0xE7D3FBC8 )
        GG( $a, $b, $c, $d, $x[$k + 9], $S21, 0x21E1CDE6 )
        GG( $d, $a, $b, $c, $x[$k + 14], $S22, 0xC33707D6)
        GG( $c, $d, $a, $b, $x[$k + 3], $S23, 0xF4D50D87 )
        GG( $b, $c, $d, $a, $x[$k + 8], $S24, 0x455A14ED )
        GG( $a, $b, $c, $d, $x[$k + 13], $S21, 0xA9E3E905)
        GG( $d, $a, $b, $c, $x[$k + 2], $S22, 0xFCEFA3F8 )
        GG( $c, $d, $a, $b, $x[$k + 7], $S23, 0x676F02D9 )
        GG( $b, $c, $d, $a, $x[$k + 12], $S24, 0x8D2A4C8A)
            
        HH( $a, $b, $c, $d, $x[$k + 5], $S31, 0xFFFA3942 )
        HH( $d, $a, $b, $c, $x[$k + 8], $S32, 0x8771F681 )
        HH( $c, $d, $a, $b, $x[$k + 11], $S33, 0x6D9D6122)
        HH( $b, $c, $d, $a, $x[$k + 14], $S34, 0xFDE5380C)
        HH( $a, $b, $c, $d, $x[$k + 1], $S31, 0xA4BEEA44 )
        HH( $d, $a, $b, $c, $x[$k + 4], $S32, 0x4BDECFA9 )
        HH( $c, $d, $a, $b, $x[$k + 7], $S33, 0xF6BB4B60 )
        HH( $b, $c, $d, $a, $x[$k + 10], $S34, 0xBEBFBC70)
        HH( $a, $b, $c, $d, $x[$k + 13], $S31, 0x289B7EC6)
        HH( $d, $a, $b, $c, $x[$k + 0], $S32, 0xEAA127FA )
        HH( $c, $d, $a, $b, $x[$k + 3], $S33, 0xD4EF3085 )
        HH( $b, $c, $d, $a, $x[$k + 6], $S34, 0x4881D05  )
        HH( $a, $b, $c, $d, $x[$k + 9], $S31, 0xD9D4D039 )
        HH( $d, $a, $b, $c, $x[$k + 12], $S32, 0xE6DB99E5)
        HH( $c, $d, $a, $b, $x[$k + 15], $S33, 0x1FA27CF8)
        HH( $b, $c, $d, $a, $x[$k + 2], $S34, 0xC4AC5665 )
    
        II( $a, $b, $c, $d, $x[$k + 0], $S41, 0xF4292244 )
        II( $d, $a, $b, $c, $x[$k + 7], $S42, 0x432AFF97 )
        II( $c, $d, $a, $b, $x[$k + 14], $S43, 0xAB9423A7)
        II( $b, $c, $d, $a, $x[$k + 5], $S44, 0xFC93A039 )
        II( $a, $b, $c, $d, $x[$k + 12], $S41, 0x655B59C3)
        II( $d, $a, $b, $c, $x[$k + 3], $S42, 0x8F0CCC92 )
        II( $c, $d, $a, $b, $x[$k + 10], $S43, 0xFFEFF47D)
        II( $b, $c, $d, $a, $x[$k + 1], $S44, 0x85845DD1 )
        II( $a, $b, $c, $d, $x[$k + 8], $S41, 0x6FA87E4F )
        II( $d, $a, $b, $c, $x[$k + 15], $S42, 0xFE2CE6E0)
        II( $c, $d, $a, $b, $x[$k + 6], $S43, 0xA3014314 )
        II( $b, $c, $d, $a, $x[$k + 13], $S44, 0x4E0811A1)
        II( $a, $b, $c, $d, $x[$k + 4], $S41, 0xF7537E82 )
        II( $d, $a, $b, $c, $x[$k + 11], $S42, 0xBD3AF235)
        II( $c, $d, $a, $b, $x[$k + 2], $S43, 0x2AD7D2BB )
        II( $b, $c, $d, $a, $x[$k + 9], $S44, 0xEB86D391 )
    
        $a = AddUnsigned($a, $AA)
        $b = AddUnsigned($b, $BB)
        $c = AddUnsigned($c, $CC)
        $d = AddUnsigned($d, $DD)
    Next
    
    ; Step 5.  Output the 128 bit digest
   Return StringLower(WordToHex($a) & WordToHex($B) & WordToHex($c) & WordToHex($d))
EndFunc
Nice, but all you needed was to have your dll in the script dir, and then a simple matter of adding this at the top...

#AutoIt3Wrapper_plugin_funcs = MD5Hash

and then

$plH = PluginOpen(@ScriptDir & "\MD5Hash.dll")

if it isn't already in the script.

Not that hard... All you would need to do is to look in the thread that had the MD5 dll...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...