Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/12/2025 in Posts

  1. Great catch again, I've now implemented both solutions. Minor nitpick is that WriteFileFromArray doesn't currently support LF line endings so I have to use dos2unix on the output, which I reported as a bug here, but apart from that it works perfectly. Just out of interest, if in the future I wanted to use this to brute-force a larger range of serial numbers (7, 8 or 9 digits instead of 6) the amount of failed cases might get a little too much to handle manually like I am now, and this also requires that I run the script with two different methods and diff both files. Is there an easy way of making it so that the script does fallback to returning nothing instead of 0000 when nothing is recognised, so that I can then bring back the Do Until loop to take a little more time on those particular numbers? If this would require too much work don't worry about it, but if it's an easy change it would be a huge improvement to the robustness of the script. Also as requested I have now donated to AutoIt, thanks once again everyone.
    2 points
  2. Sadly your wish will not come true. This is why Windows implemented a lot of security nets to disable temptations to take over computers. And I am not quite sure about your objectives, what is it so complicated for a user to press a Yes button ?
    1 point
  3. If something doesn't do what you want it to do, the first thing you have to do: Debugging. In the simplest case, this means that you have passed values or variables output to find out their value at runtime to determine whether they have the expected value. In your case here, simply outputting the call string you have put together is all you need to do: ConsoleWrite("REGEDIT /S " & "D:\Scripts Working\GlobalRemoveAll\RegKeys\AddMe.reg" & @CRLF) ConsoleWrite('REGEDIT /S "D:\Scripts Working\GlobalRemoveAll\RegKeys\AddMe.reg"' & @CRLF) Then you will quickly see that the specific problem here is the spaces in the path.
    1 point
  4. oops, one more, we dont need to create the dllstruct a million times either, just once in the top... Global $posx = 1715, $posy = 705, $result = "", $code[4], $capture, $pixels = DllStructCreate('dword[2816]') . . . . Func Getnumber($result) Local $code[4] = [0,0,0,0], $value = 64; dllstructcreate was here, moved to top DllCall('gdi32.dll', 'dword', 'GetBitmapBits', 'ptr', $capture, 'dword', DllStructGetSize($pixels), 'ptr', DllStructGetPtr($pixels)) For $loop = 1 To 2816 Step 440 $code[0] += DllStructGetData($pixels, 1, $loop ) > 4278190080 ? $value:0 $code[1] += DllStructGetData($pixels, 1, $loop+29) > 4278190080 ? $value:0 $code[2] += DllStructGetData($pixels, 1, $loop+58) > 4278190080 ? $value:0 $code[3] += DllStructGetData($pixels, 1, $loop+87) > 4278190080 ? $value:0 $value /= 2 Next Return String($digit[$code[0]]) & String($digit[$code[1]]) & String($digit[$code[2]]) & String($digit[$code[3]]) EndFunc For some reason we cant hardcode the dllstructgetsize and getptr, so they'll have to stay.
    1 point
  5. Good to see you resolved it. I updated my example with the matching based on a checksum by using replace/stringreplace just counting and adding the bytes to a certain checksum.
    1 point
  6. Thanks, I'll take a look at that. VSCode is quite new to me still.
    1 point
  7. ioa747

    Import Reg File Issue!

    like that maybe RunWait('REGEDIT /S "' & $sSrcPath & $sSrcFolder & $sSrcRegKeyData & '"')
    1 point
  8. Nine

    Import Reg File Issue!

    Because your quote include the vars. RunWait('REGEDIT /S ' & $sSrcPath & $sSrcFolder & $sSrcRegKeyData)
    1 point
  9. rudi

    Ubound($array) vs $array[0]

    Sometimes it's nice to have the number of elements in [0], sometimes it's more convenient to have an array, that's holding just values. e.g. the two functions FileReadToArray() and _FileReadToArray() #include <Debug.au3> #include <File.au3> $File=@TempDir & "\Sample-Text.txt" $h=FileOpen($File,2+8) for $i = 1 to 10 FileWriteLine($h,"This is line " & $i) Next FileClose($h) $aOne= FileReadToArray($File) ; returns an array with first *ELEMENT* in [0] _DebugArrayDisplay($aOne) ; Arrays with "fist-element-in-[0]" offer the very nice feature to *ENUMERATE* its element by using "for $Variable in $aArray" for $line in $aOne MsgBox(0, '', $line) Next Dim $aTwo _FileReadToArray($File,$aTwo) _DebugArrayDisplay($aTwo) for $i = 1 to $aTwo[0] if mod($i,2)=0 then ; even -> display MsgBox(0, '', $aTwo[$i]) EndIf Next
    1 point
  10. $nFile_Array = UBound($aFile_Array) Dim $aTmp[$nFile_Array] $iFile_Array = 0 For $i = 0 To $nFile_Array - 1 If Not $aFile_Array[$i] Then ContinueLoop $aTmp[$iFile_Array] = $aFile_Array[$i] $iFile_Array += 1 Next ReDim $aTmp[$iFile_Array] $aFile_Array = $aTmp
    1 point
×
×
  • Create New...