Thatsgreat2345 Posted February 26, 2006 Share Posted February 26, 2006 ok i cant figure this out i keep getting the errors C:\Program Files\AutoIt3\Include\String.au3(16,59) : ERROR: $strHex already declared as parameter Local $strChar, $aryHex, $i, $iDec, $Char, $file, $strHex, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Program Files\AutoIt3\Include\String.au3(60,112) : ERROR: $i_EncryptLevel already declared as parameter If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then Local $i_EncryptLevel = 1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~^ J:\Craap\Attacker\eeeblah.au3(59,104) : ERROR: _INetGetSource(): undefined function. Global $source = _INetGetSource('http://www.racezoneonline.com/rz/rz_files/race_ladder.php?type=global') and i cant figure it out it was working one time then quick qorking, and i have to use the dlls i cant just make an com activex and then shell it cuz with the dll it uses the current session for the game expandcollapse popup#include <GuiConstants.au3> #Include <Misc.au3> #include <INet.au3> #include <File.au3> #include <String.au3> Hotkeyset("{esc}", "exit1") func exit1() Exit endfunc $gui = GUICreate("EBLAH", @DesktopWidth, @DesktopHeight, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_OVERLAPPEDWINDOW + $WS_MAXIMIZE) $back = GUICtrlCreateButton("Attack", 10, 20, 40, 30, $BS_BITMAP) $b2 = GUICtrlCreateButton("Attack1", 12, 21, 1, 1, $BS_BITMAP) $b3 = GUICtrlCreateButton("Attack2", 13, 21, 1, 1, $BS_BITMAP) $b4 = GUICtrlCreateButton("Attack3", 14, 21, 1, 1, $BS_BITMAP) $b5 = GUICtrlCreateButton("Attack4", 15, 21, 1, 1, $BS_BITMAP) $b6 = GUICtrlCreateButton("Attack5", 16, 21, 1, 1, $BS_BITMAP) $forward = GUICtrlCreateButton("Forward", 55, 20, 40, 30, $BS_BITMAP) $refresh = GUICtrlCreateButton("Refresh", 100, 20, 40, 30, $BS_BITMAP) $GO = GUICtrlCreateButton("GO", 810, 20, 50, 30, $BS_BITMAP) $Combo_5 = GUICtrlCreateInput("http://www.google.com", 150, 25, 640, 21) $Progress_6 = GUICtrlCreateProgress(840, 670, 70, 15) $Date_8 = GUICtrlCreateDate("Date7", 20, 670, 200, 20) $pic = GUICtrlCreatePic("images\troyzilla.jpg", 890, 5, 85, 53) GUICtrlSetImage ( $back, "images\back.bmp") GUICtrlSetImage ( $Forward, "images\forward.bmp") GUICtrlSetImage ( $refresh, "images\refresh.bmp") GUICtrlSetImage ( $GO, "images\go.bmp") GUISetState() ;creates the child gui that the dll will be held in. $internetgui = GUICreate("", 1000, 600, 10, 60, $WS_CHILD + $WS_BORDER, "", $gui) GUISetState() ;opens dll then calls it. $dll = DllOpen("cwebpage.dll") DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $internetgui) DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", "http://www.google.com") ;DLLCall($dll,"none","ResizeBrowser","hwnd", $gui ,"int", 800, "int", 500 ) GuiSetState() Do $msg = GUIGetMsg () Select Case $msg = $forward DLLCall($dll,"none","DoPageAction","hwnd",$internetgui,"int", 1) Case $msg = $refresh DLLCall($dll,"none","DoPageAction","hwnd",$internetgui,"int", 4) Case $msg = $GUI_EVENT_CLOSE; states that if the close button is it hte script will exit ExitLoop Case $msg = $GO;gets the message of the button DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)); tells the dll to go to the web page thats in the combobox Case $msg = $back _filecreate(@desktopdir & "/source.txt") filedelete(@desktopdir & "/source.txt") _filecreate(@desktopdir & "/source.txt") $file = (@desktopdir & "/source.txt") Global $source = _INetGetSource('http://www.racezoneonline.com/rz/rz_files/race_ladder.php?type=global') filewrite($file, $source) ;;;;;;;;;;;;;;;; source $read = Filereadline($file,"45") $strip2 = _StringReverse($read) $result5 = stringtrimleft($strip2, 11) $result6 = stringinstr($result5, "[") $result7 = stringleft($result5, $result6 - 1) $result8 = _StringReverse($result7) If $result8 = "99.99%" Then $read2 = Filereadline($file,"42") $string = $read2 $strip = _StringReverse($string) $result = stringtrimleft($strip, 8) $result1 = stringinstr($result, ">") $result2 = stringleft($result, $result1 - 1) $result4 = _StringReverse($result2) Guictrlsetdata($Combo_5,"") Guictrlsetdata($Combo_5,"http://www.racezoneonline.com/rz/processes/race_engine.php?opponent=" & $result4 & "&tid=3&type=global") DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)) ControlClick($gui, '', $back) If $result8 = "00.00%" Then ;;;;;;nextracer $read1 = Filereadline($file,"68") $strip3 = _StringReverse($read1) $result9 = stringtrimleft($strip3, 11) $result10 = stringinstr($result9, "[") $result11 = stringleft($result9, $result10 - 1) $result12 = _StringReverse($result11) ControlClick($gui, '', $b2) EndIf endif Case $msg = $b2 ;;;;;;;;;;;;;;;;;;;;;;;;;;; race1111111 If $result12 = "99.99%" Then ;raceeeeeeeeeeeeeeeeeeeeeeeeeee $read3 = Filereadline($file,"65") $string1 = $read3 $strip4 = _StringReverse($string1) $result13 = stringtrimleft($strip4, 8) $result14 = stringinstr($result13, ">") $result15 = stringleft($result13, $result14 - 1) $result16 = _StringReverse($result15) Guictrlsetdata($Combo_5,"") Guictrlsetdata($Combo_5,"http://www.racezoneonline.com/rz/processes/race_engine.php?opponent=" & $result16 & "&tid=3&type=global") DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)) ControlClick($gui, '', $back) if $result12 = "00.00%" Then $read4 = Filereadline($file,"91") $strip5 = _StringReverse($read4) $result17 = stringtrimleft($strip5, 11) $result18 = stringinstr($result17, "[") $result19 = stringleft($result17, $result18 - 1) $result20 = _StringReverse($result19) ControlClick($gui, '', $b3) EndIf EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;race 222222222222222 case $msg = $b3 If $result20 = "99.99%" Then $read5 = Filereadline($file,"88") $string2 = $read5 $strip6 = _StringReverse($string2) $result21 = stringtrimleft($strip6, 8) $result22 = stringinstr($result21, ">") $result23 = stringleft($result21, $result22 - 1) $result24 = _StringReverse($result23) Guictrlsetdata($Combo_5,"") Guictrlsetdata($Combo_5,"http://www.racezoneonline.com/rz/processes/race_engine.php?opponent=" & $result24 & "&tid=3&type=global") DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)) ControlClick($gui, '', $back) if $result20 = "00.00%" Then $read6 = Filereadline($file,"113") $strip7 = _StringReverse($read6) $result25 = stringtrimleft($strip7, 11) $result26 = stringinstr($result25, "[") $result27 = stringleft($result25, $result26 - 1) $result28 = _StringReverse($result27) ControlClick($gui, '', $b4) EndIf Endif ;;;;;;;;;;;;;;;;;;;;;;;;;;; race333333333333333 Case $msg = $b4 If $result28 = "99.99%" Then $read7 = Filereadline($file,"110") $string3 = $read7 $strip7 = _StringReverse($string3) $result29 = stringtrimleft($strip7, 8) $result30 = stringinstr($result29, ">") $result31 = stringleft($result29, $result30 - 1) $result32 = _StringReverse($result31) Guictrlsetdata($Combo_5,"") Guictrlsetdata($Combo_5,"http://www.racezoneonline.com/rz/processes/race_engine.php?opponent=" & $result32 & "&tid=3&type=global") DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)) ControlClick($gui, '', $back) If $result28 = "00.00%" Then $read8 = Filereadline($file,"136") $strip8 = _StringReverse($read8) $result33 = stringtrimleft($strip8, 11) $result34 = stringinstr($result33, "[") $result35 = stringleft($result33, $result34 - 1) $result36 = _StringReverse($result35) ControlClick($gui, '', $b5) EndIf EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;race444444444444444444444444444444 Case $msg = $b5 If $result36 = "99.99%" Then $read9 = Filereadline($file,"133") $string4 = $read9 $strip9 = _StringReverse($string4) $result36 = stringtrimleft($strip9, 8) $result37 = stringinstr($result36, ">") $result38 = stringleft($result36, $result37 - 1) $result39 = _StringReverse($result38) Guictrlsetdata($Combo_5,"") Guictrlsetdata($Combo_5,"http://www.racezoneonline.com/rz/processes/race_engine.php?opponent=" & $result39 & "&tid=3&type=global") DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)) ControlClick($gui, '', $back) If $result36 = "00.00%" Then $read10 = Filereadline($file,"159") $strip10 = _StringReverse($read10) $result40 = stringtrimleft($strip10, 11) $result41 = stringinstr($result40, "[") $result42 = stringleft($result40, $result41 - 1) $result43 = _StringReverse($result42) ControlClick($gui, '', $b6) EndIf EndIf ;;;;;;;;;;;;;;;;;;;;;;;race555555555555555555555 Case $msg = $b6 If $result43 = "99.99%" Then $read11 = Filereadline($file,"156") $string5 = $read11 $strip10 = _StringReverse($string5) $result44 = stringtrimleft($strip10, 8) $result45 = stringinstr($result44, ">") $result46 = stringleft($result44, $result45 - 1) $result47 = _StringReverse($result46) Guictrlsetdata($Combo_5,"") Guictrlsetdata($Combo_5,"http://www.racezoneonline.com/rz/processes/race_engine.php?opponent=" & $result47 & "&tid=3&type=global") DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $internetgui, "str", GUICtrlRead($Combo_5)) if $result43 = "00.00%" Then msgbox(0,"Done","They are all 00.00% what will you do now?") EndIf EndIf;;;;;;;;;;;;;;;;;;;;;;;;;;;;race666666666666666666666666666 EndSelect Until $msg = $GUI_EVENT_CLOSE Link to comment Share on other sites More sharing options...
nfwu Posted February 26, 2006 Share Posted February 26, 2006 (edited) replace your string.au3 with this: expandcollapse popup; Include Version:1.49 (1/17/2006) #include-once ;=============================================================================== ; ; Function Name: _HexToStr("hex") ; Description: Convert a hex string of characters to ASCII Characters. ; Parameter(s): $strHex is the hex string you want to convert. ; Requirement(s): Hex Input. ; Return Value(s): On Success - Returns the converted string of characters. ; On Failure - -1 and sets @ERROR = 1 ; Author(s): Jarvis Stubblefield ; Corrected: 2005/09/04 jpm error checking ; ;=============================================================================== Func _HexToString($strHex) Local $strChar, $aryHex, $i, $iDec, $Char, $iOne, $iTwo $aryHex = StringSplit($strHex, "") If Mod($aryHex[0], 2) <> 0 Then SetError(1) Return -1 EndIf For $i = 1 To $aryHex[0] $iOne = $aryHex[$i] $i = $i + 1 $iTwo = $aryHex[$i] $iDec = Dec($iOne & $iTwo) If @error <> 0 Then SetError(1) Return -1 EndIf $Char = Chr($iDec) $strChar = $strChar & $Char Next Return $strChar EndFunc ;==>_HexToString ;=============================================================================== ; ; Function Name: _StringEncrypt() ; Description: RC4 Based string encryption ; Parameter(s): $i_Encrypt - 1 to encrypt, 0 to decrypt ; $s_EncryptText - string to encrypt ; $s_EncryptPassword - string to use as an encryption password ; $i_EncryptLevel - integer to use as number of times to encrypt string ; Requirement(s): None ; Return Value(s): On Success - Returns the string encrypted (blank) times with (blank) password ; On Failure - Returns a blank string and sets @error = 1 ; Author(s): Wes Wolfe-Wolvereness ; ;=============================================================================== ; Func _StringEncrypt($i_Encrypt, $s_EncryptText, $s_EncryptPassword, $i_EncryptLevel = 1) If $i_Encrypt <> 0 And $i_Encrypt <> 1 Then SetError(1) Return '' ElseIf $s_EncryptText = '' Or $s_EncryptPassword = '' Then SetError(1) Return '' Else If Number($i_EncryptLevel) <= 0 Or Int($i_EncryptLevel) <> $i_EncryptLevel Then $i_EncryptLevel = 1 Local $v_EncryptModified Local $i_EncryptCountH Local $i_EncryptCountG Local $v_EncryptSwap Local $av_EncryptBox[256][2] Local $i_EncryptCountA Local $i_EncryptCountB Local $i_EncryptCountC Local $i_EncryptCountD Local $i_EncryptCountE Local $v_EncryptCipher Local $v_EncryptCipherBy If $i_Encrypt = 1 Then For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1 $i_EncryptCountG = '' $i_EncryptCountH = '' $v_EncryptModified = '' For $i_EncryptCountG = 1 To StringLen($s_EncryptText) If $i_EncryptCountH = StringLen($s_EncryptPassword) Then $i_EncryptCountH = 1 Else $i_EncryptCountH = $i_EncryptCountH + 1 EndIf $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255)) Next $s_EncryptText = $v_EncryptModified $i_EncryptCountA = '' $i_EncryptCountB = 0 $i_EncryptCountC = '' $i_EncryptCountD = '' $i_EncryptCountE = '' $v_EncryptCipherBy = '' $v_EncryptCipher = '' $v_EncryptSwap = '' $av_EncryptBox = '' Local $av_EncryptBox[256][2] For $i_EncryptCountA = 0 To 255 $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1)) $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA Next For $i_EncryptCountA = 0 To 255 $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256) $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0] $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0] $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap Next For $i_EncryptCountA = 1 To StringLen($s_EncryptText) $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256) $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256) $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0] $v_EncryptCipherBy = BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountA, 1)), $i_EncryptCountE) $v_EncryptCipher = $v_EncryptCipher & Hex($v_EncryptCipherBy, 2) Next $s_EncryptText = $v_EncryptCipher Next Else For $i_EncryptCountF = 0 To $i_EncryptLevel Step 1 $i_EncryptCountB = 0 $i_EncryptCountC = '' $i_EncryptCountD = '' $i_EncryptCountE = '' $v_EncryptCipherBy = '' $v_EncryptCipher = '' $v_EncryptSwap = '' $av_EncryptBox = '' Local $av_EncryptBox[256][2] For $i_EncryptCountA = 0 To 255 $av_EncryptBox[$i_EncryptCountA][1] = Asc(StringMid($s_EncryptPassword, Mod($i_EncryptCountA, StringLen($s_EncryptPassword)) + 1, 1)) $av_EncryptBox[$i_EncryptCountA][0] = $i_EncryptCountA Next For $i_EncryptCountA = 0 To 255 $i_EncryptCountB = Mod(($i_EncryptCountB + $av_EncryptBox[$i_EncryptCountA][0] + $av_EncryptBox[$i_EncryptCountA][1]), 256) $v_EncryptSwap = $av_EncryptBox[$i_EncryptCountA][0] $av_EncryptBox[$i_EncryptCountA][0] = $av_EncryptBox[$i_EncryptCountB][0] $av_EncryptBox[$i_EncryptCountB][0] = $v_EncryptSwap Next For $i_EncryptCountA = 1 To StringLen($s_EncryptText) Step 2 $i_EncryptCountC = Mod(($i_EncryptCountC + 1), 256) $i_EncryptCountD = Mod(($i_EncryptCountD + $av_EncryptBox[$i_EncryptCountC][0]), 256) $i_EncryptCountE = $av_EncryptBox[Mod(($av_EncryptBox[$i_EncryptCountC][0] + $av_EncryptBox[$i_EncryptCountD][0]), 256) ][0] $v_EncryptCipherBy = BitXOR(Dec(StringMid($s_EncryptText, $i_EncryptCountA, 2)), $i_EncryptCountE) $v_EncryptCipher = $v_EncryptCipher & Chr($v_EncryptCipherBy) Next $s_EncryptText = $v_EncryptCipher $i_EncryptCountG = '' $i_EncryptCountH = '' $v_EncryptModified = '' For $i_EncryptCountG = 1 To StringLen($s_EncryptText) If $i_EncryptCountH = StringLen($s_EncryptPassword) Then $i_EncryptCountH = 1 Else $i_EncryptCountH = $i_EncryptCountH + 1 EndIf $v_EncryptModified = $v_EncryptModified & Chr(BitXOR(Asc(StringMid($s_EncryptText, $i_EncryptCountG, 1)), Asc(StringMid($s_EncryptPassword, $i_EncryptCountH, 1)), 255)) Next $s_EncryptText = $v_EncryptModified Next EndIf Return $s_EncryptText EndIf EndFunc ;==>_StringEncrypt ;=============================================================================== ; ; Function Name: _StringInsert(), version 1.02 ; Description: Inserts a string within another ; Parameters: $s_String - Original string ; $s_InsertString - String to insert ; $i_Position - Position to insert string (negatives values ; count from right hand side) ; Requirement(s): None ; Author(s): Louis Horvath ; ; Return value: upon success, returns a string containing the desired insert string. ; upon error, sets @error to the following values: ; @error = 1 : Source string empty / not a string ; @error = 2 : Insert string empty / not a string ; @error = 3 : Invalid position ; ; and returns original string unmodified. ;=============================================================================== Func _StringInsert($s_String, $s_InsertString, $i_Position) Local $i_Length, $s_Start, $s_End If $s_String = "" Or (Not IsString($s_String)) Then SetError(1); Source string empty / not a string Return $s_String ElseIf $s_InsertString = "" Or (Not IsString($s_String)) Then SetError(2); Insert string empty / not a string Return $s_String Else $i_Length = StringLen($s_String); Take a note of the length of the source string If (Abs($i_Position) > $i_Length) Or (Not IsInt($i_Position)) Then SetError(3); Invalid position Return $s_String EndIf EndIf ; If $i_Position at start of string If $i_Position = 0 Then Return $s_InsertString & $s_String; Just add them up :) Easy :) ; If $i_Position is positive ElseIf $i_Position > 0 Then $s_Start = StringLeft($s_String, $i_Position); Chop off first part $s_End = StringRight($s_String, $i_Length - $i_Position); and the second part Return $s_Start & $s_InsertString & $s_End; Assemble all three pieces together ; If $i_Position is negative ElseIf $i_Position < 0 Then $s_Start = StringLeft($s_String, Abs($i_Length + $i_Position)); Chop off first part $s_End = StringRight($s_String, Abs($i_Position)); and the second part Return $s_Start & $s_InsertString & $s_End; Assemble all three pieces together EndIf EndFunc ;==>_StringInsert ;=============================================================================== ; ; Description: Changes a string to proper case, same a =Proper function in Excel ; Syntax: _StringProper( $sString) ; Parameter(s): $sString - String to change to proper case. ; Requirement(s): None ; Return Value(s): On Success - Returns the proper string. ; On Failure - Returns an empty string and sets @error = 1 ; Author(s): Jos van der Zande ; Note(s): None ; ;=============================================================================== Func _StringProper($s_Str) Local $iX = 0 Local $CapNext = 1 Local $s_nStr = "" Local $s_CurChar For $iX = 1 To StringLen($s_Str) $s_CurChar = StringMid($s_Str, $iX, 1) Select Case $CapNext = 1 If __CharacterIsApha($s_CurChar) Then $s_CurChar = StringUpper($s_CurChar) $CapNext = 0 EndIf Case Not __CharacterIsApha($s_CurChar) $CapNext = 1 Case Else $s_CurChar = StringLower($s_CurChar) EndSelect $s_nStr = $s_nStr & $s_CurChar Next Return ($s_nStr) EndFunc ;==>_StringProper ;=============================================================================== ; ; Description: Repeats a string a specified number of times. ; Syntax: _StringRepeat( $sString, $iRepeatCount ) ; Parameter(s): $sString - String to repeat ; $iRepeatCount - Number of times to repeat the string ; Requirement(s): None ; Return Value(s): On Success - Returns string with specified number of repeats ; On Failure - Returns an empty string and sets @error = 1 ; Author(s): Jeremy Landes <jlandes@landeserve.com> ; Note(s): None ; ;=============================================================================== Func _StringRepeat($sString, $iRepeatCount) ;============================================== ; Local Constant/Variable Declaration Section ;============================================== Local $sResult Select Case Not StringIsInt($iRepeatCount) SetError(1) Return "" Case StringLen($sString) < 1 SetError(1) Return "" Case $iRepeatCount <= 0 SetError(1) Return "" Case Else For $iCount = 1 To $iRepeatCount $sResult = $sResult & $sString Next Return $sResult EndSelect EndFunc ;==>_StringRepeat ;=============================================================================== ; ; Description: Reverses the contents of the specified string. ; Syntax: _StringReverse( $sString ) ; Parameter(s): $sString - String to reverse ; Requirement(s): None ; Return Value(s): On Success - Returns reversed string ; On Failure - Returns an empty string and sets @error = 1 ; Author(s): Jonathan Bennett <jon at hiddensoft com> ; Note(s): None ; ;=============================================================================== Func _StringReverse($sString) ;============================================== ; Local Constant/Variable Declaration Section ;============================================== Local $sReverse Local $iCount If StringLen($sString) >= 1 Then For $iCount = 1 To StringLen($sString) $sReverse = StringMid($sString, $iCount, 1) & $sReverse Next Return $sReverse Else SetError(1) Return "" EndIf EndFunc ;==>_StringReverse ;=============================================================================== ; ; Function Name: _StringToHex("string") ; Description: Convert a string of characters to hexadecimal. ; Parameter(s): $strChar is the string you want to convert. ; Requirement(s): String Input. ; Return Value(s): Returns the converted string in hexadecimal. ; Author(s): Jarvis Stubblefield ; Corrected: 2005/09/04 jpm error checking ; ;=============================================================================== Func _StringToHex($strChar) Local $aryChar, $i, $iDec, $hChar, $strHex $aryChar = StringSplit($strChar, "") For $i = 1 To $aryChar[0] $iDec = Asc($aryChar[$i]) $hChar = Hex($iDec, 2) $strHex = $strHex & $hChar Next Return $strHex EndFunc ;==>_StringToHex ;================================================================================= ; Helper functions Func __CharacterIsApha($s_Str) Local $a_Alpha = "abcdefghijklmnopqrstuvwxyz" Return (StringInStr($a_Alpha, $s_Str)) EndFunc ;==>__CharacterIsApha Edited October 21, 2013 by Jos TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted February 26, 2006 Author Share Posted February 26, 2006 (edited) Thanks now i just have a problem with J:\Craap\Attacker\eeeblah.au3(59,104) : ERROR: _INetGetSource(): undefined function. Global $source = _INetGetSource('http://www.racezoneonline.com/rz/rz_files/race_ladder.php?type=global') it worked earlier and im using the latest beta :-/ Edited February 26, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
greenmachine Posted February 26, 2006 Share Posted February 26, 2006 Did you include inet.au3? Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted February 26, 2006 Author Share Posted February 26, 2006 (edited) yes its right up top with my source #include <INet.au3> my Inet onyl has 3 funcs :-/ wtf could sum1 post theres please Edited February 26, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
nfwu Posted February 26, 2006 Share Posted February 26, 2006 replace inet.au3 with: expandcollapse popup; Include Version:1.53 (2/16/2006) #include-once ; ------------------------------------------------------------------------------ ; ; AutoIt Version: 3.0 ; Language: English ; Description: Functions that assist with Internet. ; ; ------------------------------------------------------------------------------ ;=============================================================================== ; ; Function Name: _GetIP() ; Description: Get public IP address of a network/computer. ; Parameter(s): None ; Requirement(s): Internet access. ; Return Value(s): On Success - Returns the public IP Address ; On Failure - -1 and sets @ERROR = 1 ; Author(s): Larry/Ezzetabi & Jarvis Stubblefield ; ;=============================================================================== Func _GetIP() Local $ip, $t_ip If InetGet("http://checkip.dyndns.org/?rnd1=" & Random(1, 65536) & "&rnd2=" & Random(1, 65536), @TempDir & "\~ip.tmp") Then $ip = FileRead(@TempDir & "\~ip.tmp", FileGetSize(@TempDir & "\~ip.tmp")) FileDelete(@TempDir & "\~ip.tmp") $ip = StringTrimLeft($ip, StringInStr($ip, ":") + 1) $ip = StringTrimRight($ip, StringLen($ip) - StringInStr($ip, "/") + 2) $t_ip = StringSplit($ip, '.') If $t_ip[0] = 4 And StringIsDigit($t_ip[1]) And StringIsDigit($t_ip[2]) And StringIsDigit($t_ip[3]) And StringIsDigit($t_ip[4]) Then Return $ip EndIf EndIf If InetGet("http://www.whatismyip.com/?rnd1=" & Random(1, 65536) & "&rnd2=" & Random(1, 65536), @TempDir & "\~ip.tmp") Then $ip = FileRead(@TempDir & "\~ip.tmp", FileGetSize(@TempDir & "\~ip.tmp")) FileDelete(@TempDir & "\~ip.tmp") $ip = StringTrimLeft($ip, StringInStr($ip, "Your ip is") + 10) $ip = StringLeft($ip, StringInStr($ip, " ") - 1) $ip = StringStripWS($ip, 8) $t_ip = StringSplit($ip, '.') If $t_ip[0] = 4 And StringIsDigit($t_ip[1]) And StringIsDigit($t_ip[2]) And StringIsDigit($t_ip[3]) And StringIsDigit($t_ip[4]) Then Return $ip EndIf EndIf SetError(1) Return -1 EndFunc ;==>_GetIP ;=============================================================================== ; ; Function Name: _INetExplorerCapable() ; Description: Convert a string to IE capable line ; Parameter(s): $s_IEString - String to convert to a capable IExplorer line ; Requirement(s): None ; Return Value(s): On Success - Returns the converted string ; On Failure - Blank String and @error = 1 ; Author(s): Wes Wolfe-Wolvereness <Weswolf@aol.com> ; ;=============================================================================== ; Func _INetExplorerCapable($s_IEString) If StringLen($s_IEString) <= 0 Then Return '' SetError(1) Else Local $s_IEReturn Local $i_IECount Local $n_IEChar For $i_IECount = 1 To StringLen($s_IEString) $n_IEChar = '0x' & Hex(Asc(StringMid($s_IEString, $i_IECount, 1)), 2) If $n_IEChar < 0x21 Or $n_IEChar = 0x25 Or $n_IEChar = 0x2f Or $n_IEChar > 0x7f Then $s_IEReturn = $s_IEReturn & '%' & StringRight($n_IEChar, 2) Else $s_IEReturn = $s_IEReturn & Chr($n_IEChar) EndIf Next Return $s_IEReturn EndIf EndFunc ;==>_INetExplorerCapable ;=============================================================================== ; ; Function Name: _INetGetSource() ; Description: Gets the source from an URL without writing a temp file. ; Parameter(s): $s_URL = The URL of the site. ; Requirement(s): DllCall/Struct & WinInet.dll ; Return Value(s): On Success - Returns the source code. ; On Failure - 0 and sets @ERROR = 1 ; Author(s): Wouter van Kesteren. ; ;=============================================================================== Func _INetGetSource($s_URL, $s_Header = '') If StringLeft($s_URL, 7) <> 'http://' And StringLeft($s_URL, 8) <> 'https://' Then $s_URL = 'http://' & $s_URL Local $h_DLL = DllOpen("wininet.dll") Local $ai_IRF, $s_Buf = '' Local $ai_IO = DllCall($h_DLL, 'int', 'InternetOpen', 'str', "AutoIt v3", 'int', 0, 'int', 0, 'int', 0, 'int', 0) If @error Or $ai_IO[0] = 0 Then DllClose($h_DLL) SetError(1) Return "" EndIf Local $ai_IOU = DllCall($h_DLL, 'int', 'InternetOpenUrl', 'int', $ai_IO[0], 'str', $s_URL, 'str', $s_Header, 'int', StringLen($s_Header), 'int', 0x80000000, 'int', 0) If @error Or $ai_IOU[0] = 0 Then DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0]) DllClose($h_DLL) SetError(1) Return "" EndIf Local $v_Struct = DllStructCreate('udword') DllStructSetData($v_Struct, 1, 1) While DllStructGetData($v_Struct, 1) <> 0 $ai_IRF = DllCall($h_DLL, 'int', 'InternetReadFile', 'int', $ai_IOU[0], 'str', '', 'int', 256, 'ptr', DllStructGetPtr($v_Struct)) $s_Buf &= StringLeft($ai_IRF[2], DllStructGetData($v_Struct, 1)) WEnd DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IOU[0]) DllCall($h_DLL, 'int', 'InternetCloseHandle', 'int', $ai_IO[0]) DllClose($h_DLL) Return $s_Buf EndFunc ;==>_INetGetSource ;=============================================================================== ; ; Function Name: _INetMail() ; Description: Open default mail client with given Address/Subject/Body ; Parameter(s): $s_MailTo - Address for E-Mail ; $s_Subject - Subject <Weswolf@aol.com>of E-Mail ; $s_MailBody - Body of E-Mail ; Requirement(s): _INetExplorerCapable ; Return Value(s): On Success - Process ID of e-mail client ; On Failure - If Opt('RunErrorsFatal', 1) ; -> Crash ; Else Opt('RunErrorsFatal', 0) ; -> Blank String and @error = 1 ; Author(s): Wes Wolfe-Wolvereness <Weswolf@aol.com> ; ;=============================================================================== ; Func _INetMail($s_MailTo, $s_MailSubject, $s_MailBody) Local $prev = opt("ExpandEnvStrings", 1) Local $var = RegRead('HKCR\mailto\shell\open\command', "") Local $ret = Run(StringReplace($var, '%1', _INetExplorerCapable('mailto:' & $s_MailTo & '?subject=' & $s_MailSubject & '&body=' & $s_MailBody))) opt("ExpandEnvStrings", $prev) Return $ret EndFunc ;==>_INetMail ;=============================================================================== ; ; Function Name: _INetSmtpMail() ; Description: Sends an email using SMTP over TCP IP. ; Parameter(s): $s_SmtpServer - SMTP server to be used for sending email ; $s_FromName - Name of sender ; $s_FromAddress - eMail address of sender ; $s_ToAddress - Address that email is to be sent to ; $s_Subject - Subject of eMail ; $as_Body - Single dimension array containing the body of eMail as strings ; $s_helo - Helo identifier (default @COMPUTERNAME) sometime needed by smtp server ; $s_first - send before Helo identifier (default @CRLF) sometime needed by smtp server ; $b_trace - trace on a splash window (default 0 = no trace) ; Requirement(s): None ; Return Value(s): On Success - Returns 1 ; On Failure - 0 and sets ; @ERROR = 1 - Invalid Parameters ; @ERROR = 2 - Unable to start TCP ; @ERROR = 3 - Unable to resolve IP ; @ERROR = 4 - Unable to create socket ; @ERROR = 5x - Cannot open SMTP session ; @ERROR = 50x - Cannot send body ; @ERROR = 5000 - Cannot close SMTP session ; Authors: Original function to send email via TCP - Asimzameer ; Conversion to UDF - Walkabout ; Correction Helo, timeout, trace - Jpm ; Correction send before Helo - Jpm ; ;=============================================================================== Func _INetSmtpMail($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_helo = "", $s_first=" ", $b_trace = 0) Local $v_Socket Local $s_IPAddress Local $i_Count Local $s_Send[6] Local $s_ReplyCode[6];Return code from SMTP server indicating success If $s_SmtpServer = "" Or $s_FromAddress = "" Or $s_ToAddress = "" Or $s_FromName = "" Or StringLen($s_FromName) > 256 Then SetError(1) Return 0 EndIf If $s_helo = "" Then $s_helo = @ComputerName If TCPStartup() = 0 Then SetError(2) Return 0 EndIf StringRegExp($s_SmtpServer, "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)") If @extended Then $s_IPAddress = $s_SmtpServer Else $s_IPAddress = TCPNameToIP($s_SmtpServer) EndIf If $s_IPAddress = "" Then TCPShutdown() SetError(3) Return 0 EndIf $v_Socket = TCPConnect($s_IPAddress, 25) If $v_Socket = -1 Then TCPShutdown() SetError(4) Return (0) EndIf $s_Send[0] = "HELO " & $s_helo & @CRLF $s_ReplyCode[0] = "250" $s_Send[1] = "MAIL FROM: <" & $s_FromAddress & ">" & @CRLF $s_ReplyCode[1] = "250" $s_Send[2] = "RCPT TO: <" & $s_ToAddress & ">" & @CRLF $s_ReplyCode[2] = "250" $s_Send[3] = "DATA" & @CRLF $s_ReplyCode[3] = "354" $s_Send[4] = "From:" & $s_FromName & "<" & $s_FromAddress & ">" & @CRLF & _ "To:" & "<" & $s_ToAddress & ">" & @CRLF & _ "Subject:" & $s_Subject & @CRLF & _ "Mime-Version: 1.0" & @CRLF & _ "Content-Type: text/plain; charset=US-ASCII" & @CRLF & _ @CRLF $s_ReplyCode[4] = "" $s_Send[5] = @CRLF & "." & @CRLF $s_ReplyCode[5] = "250" ; open stmp session If _SmtpSend($v_Socket, $s_Send[0], $s_ReplyCode[0], $b_trace, "220", $s_first) Then SetError(50) Return 0 EndIf ; send header For $i_Count = 1 To UBound($s_Send) - 2 If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then SetError(50 + $i_Count) Return 0 EndIf Next ; send body records (a record can be multiline : take care of a subline beginning with a dot should be ..) For $i_Count = 0 To UBound($as_Body) - 1 ; correct line beginning with a dot If StringLeft($as_Body[$i_Count], 1) = "." Then $as_Body[$i_Count] = "." & $as_Body[$i_Count] If _SmtpSend($v_Socket, $as_Body[$i_Count] & @CRLF, "", $b_trace) Then SetError(500 + $i_Count) Return 0 EndIf Next ; close the smtp session $i_Count = UBound($s_Send) - 1 If _SmtpSend($v_Socket, $s_Send[$i_Count], $s_ReplyCode[$i_Count], $b_trace) Then SetError(5000) Return 0 EndIf TCPCloseSocket($v_Socket) TCPShutdown() Return 1 EndFunc ;==>_INetSmtpMail ; internals routines---------------------------------- Func _SmtpTrace($str, $timeout = 0) Local $W_TITLE = "SMTP trace" Local $g_smtptrace = ControlGetText($W_TITLE, "", "Static1") $str = StringLeft(StringReplace($str, @CRLF, ""), 70) $g_smtptrace &= @HOUR & ":" & @MIN & ":" & @SEC & " " & $str & @LF If WinExists($W_TITLE) Then ControlSetText($W_TITLE, "", "Static1", $g_smtptrace) Else SplashTextOn($W_TITLE, $g_smtptrace, 400, 500, 500, 100, 4 + 16, "", 8) EndIf If $timeout Then Sleep($timeout * 1000) EndFunc ;==>_SmtpTrace Func _SmtpSend($v_Socket, $s_Send, $s_ReplyCode, $b_trace, $s_IntReply="", $s_first="") Local $s_Receive, $i, $timer If $b_trace Then _SmtpTrace($s_Send) If $s_IntReply <> "" Then ;Check intermediate reply before HELO acceptation If $s_first = -1 Then ; send directly HELO if TCPSend($v_Socket, $s_Send) = 0 Then TCPCloseSocket($v_Socket) TCPShutdown() Return 1; cannot send EndIf Else ; send special first char to awake smtp server If TCPSend($v_Socket, $s_first) = 0 Then TCPCloseSocket($v_Socket) TCPShutdown() Return 1; cannot send EndIf EndIf $s_Receive = "" $timer = TimerInit() While StringLeft($s_Receive,StringLen($s_IntReply)) <> $s_IntReply And TimerDiff($timer) < 45000 $s_Receive = TCPRecv($v_Socket, 1000) If $b_trace And $s_Receive <> "" Then _SmtpTrace("intermediate->" & $s_Receive) WEnd EndIf ; dont send again if no first message was needed If $s_first <> -1 AND (TCPSend($v_Socket, $s_Send) = 0) Then TCPCloseSocket($v_Socket) TCPShutdown() Return 1; cannot send EndIf $timer = TimerInit() $s_Receive = "" While $s_Receive = "" And TimerDiff($timer) < 45000 $i += 1 $s_Receive = TCPRecv($v_Socket, 1000) If $s_ReplyCode = "" Then ExitLoop WEnd If $s_ReplyCode <> "" Then ; Check replycode If $b_trace Then _SmtpTrace($i & " <- " & $s_Receive) If StringLeft($s_Receive, StringLen($s_ReplyCode)) <> $s_ReplyCode Then TCPCloseSocket($v_Socket) TCPShutdown() If $b_trace Then _SmtpTrace("<-> " & $s_ReplyCode, 5) Return 2; bad receive code EndIf EndIf Return 0 EndFunc ;==>_SmtpSend TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted February 26, 2006 Author Share Posted February 26, 2006 thanks a ton it works except i got to slow it down it attacked i think fast and like took down the site Link to comment Share on other sites More sharing options...
jpm Posted February 27, 2006 Share Posted February 27, 2006 thanks a ton it works except i got to slow it down it attacked i think fast and like took down the site I don't really understand why you need to update your standard include. What was the first line and the date of the file you replaced? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now