• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

AutoIT Simple 4 digit number brute

Status
Not open for further replies.

Skydno

NOT IN SPAIN
User
Joined
Jan 14, 2015
Messages
33
Reputation
0
Reaction score
319
Points
53
Credits
0
‎10 Years of Service‎
66%
[HIDE-THANKS]

Code:
>#include 
#include 
#include 
#include 
#include 
#include 

$Brute = GUICreate("Brute", 188, 131, -1, -1)
$Rand = GUICtrlCreateButton("[R]", 104, 8, 75, 21)
GUICtrlCreateGroup("", 0, 32, 185, 9)
$SetNum = GUICtrlCreateInput("0000", 10, 8, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Num = GUICtrlCreateInput("0000", 10, 50, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Start = GUICtrlCreateButton("Start", 104, 48, 75, 25)
$DelayLbl = GUICtrlCreateLabel("Delay: XXXXXXXXXXXXXXXXX ms", 8, 80, 172, 17)
$Progress = GUICtrlCreateProgress(8, 104, 174, 17)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
	Case $Rand
		$iRand = Random(0, 9, 1) & Random(0, 9, 1) & Random(0, 9, 1) & Random(0, 9, 1)
		GuiCtrlSetData($SetNum, $iRand)
	Case $Start
		Local $iCurrent = 0
		Local $sCurrent
		Local $iResult = GUICtrlRead($SetNum)

		$sCurrent = sAddZero($iCurrent)

		$hTimer = TimerInit()
		For $iCurrent = 0 To 9999 Step 1
			If($sCurrent == $iResult) Then
				$iDiff = TimerDiff($hTimer)
				ExitLoop
			EndIf

			$sCurrent = sAddZero($iCurrent)
			GUICtrlSetData($Num, $sCurrent)
			$Percentage = $iCurrent / 9999 * 100
			GUICtrlSetData($Progress, $Percentage)
		Next

		GuiCtrlSetData($DelayLbl, "Delay: " & Round($iDiff, 2) & " ms")
EndSwitch
WEnd
Func sAddZero($iNum)
Local $sOut

Switch $iNum
	Case $iNum <= 9
		$sOut = "000" & $iNum
	Case $iNum <= 99
		$sOut = "00" & $iNum
	Case $iNum <= 999
		$sOut = "0" & $iNum
	Case $iNum > 999
		$sOut = $iNum
EndSwitch

Return $sOut
EndFunc
[/HIDE-THANKS]

 
Re: Simple 4 digit number brute

***Hidden content cannot be quoted.***
Improved version, now it use second "thread" (variation).

[HIDE-THANKS]

Code:
>#include 
#include 
#include 
#include 
#include 
#include 

$Brute = GUICreate("Brute pimped!", 189, 177, -1, -1)
$Rand = GUICtrlCreateButton("[R]", 104, 8, 75, 21)
GUICtrlCreateGroup("", 0, 32, 185, 9)
$SetNum = GUICtrlCreateInput("0000", 10, 8, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Num = GUICtrlCreateInput("0000", 10, 50, 89, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_NUMBER))
$Start = GUICtrlCreateButton("Start", 104, 48, 75, 25)
$DelayLbl = GUICtrlCreateLabel("Delay: XXXXXXXXXXXXXXXXX ms", 8, 103, 172, 17)
$Progress = GUICtrlCreateProgress(8, 128, 174, 17)
$ProgressT = GUICtrlCreateProgress(8, 152, 174, 17)
GuiCtrlSetData(-1, 100)
$NumT = GUICtrlCreateInput("9999", 10, 72, 89, 21)
GUISetState(@SW_SHOW)


While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit
	Case $Rand
		$iRand = Random(0, 9, 1) & Random(0, 9, 1) & Random(0, 9, 1) & Random(0, 9, 1)
		GuiCtrlSetData($SetNum, $iRand)
	Case $Start
		Local $iCurrent = 0
		Local $iCurrentTurbo = 9999
		Local $sCurrent
		Local $iResult = GUICtrlRead($SetNum)

		$sCurrent = sAddZero($iCurrent)
		$sCurrentTurbo = sAddZero($iCurrentTurbo)

		$hTimer = TimerInit()
		For $iCurrent = 0 To 9999 Step 1
			If($sCurrent == $iResult OR $sCurrentTurbo == $iResult) Then
				$iDiff = TimerDiff($hTimer)
				ExitLoop
			EndIf

			$iCurrentTurbo -= 1
			$sCurrentTurbo = sAddZero($iCurrentTurbo)

			$sCurrent = sAddZero($iCurrent)

			GUICtrlSetData($Num, $sCurrent)
			GUICtrlSetData($NumT, $sCurrentTurbo)
			$Percentage = $iCurrent / 9999 * 100
			GUICtrlSetData($Progress, $Percentage)
			$PercentageT = $iCurrentTurbo / 9999 * 100
			GUICtrlSetData($ProgressT, $PercentageT)
		Next

		GuiCtrlSetData($DelayLbl, "Delay: " & Round($iDiff, 2) & " ms")
EndSwitch
WEnd
Func sAddZero($iNum)
Local $sOut

Switch $iNum
	Case $iNum <= 9
		$sOut = "000" & $iNum
	Case $iNum <= 99
		$sOut = "00" & $iNum
	Case $iNum <= 999
		$sOut = "0" & $iNum
	Case $iNum > 999
		$sOut = $iNum
EndSwitch

Return $sOut
EndFunc
[/HIDE-THANKS]

 
Status
Not open for further replies.
Back
Top