Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/06/2023 in all areas

  1. 1. Just replace the first line of the function GetMinimum() with the code below. Local $Code = Binary('0x8B7424048B4C2408BA01000000AD39D07404E2F9EB0B8B7424048B4C240842EBEC89D0C20800') 2. That's true. Global $tData = DllStructCreate('int Data[50000]') The code above will create a structure that can hold 50k integers and nothing has to be changed in the code. Edit: to test the code probably you should replace also in LoadSomeTestNumbers() the content of $aNumbers. Instead of 1 just write a different number and let the program identify 1 as minimum. Func LoadSomeTestNumbers($cListView, $tStruct) Local $aNumbers[10] = [15, 1, 6, 5, 7, 9, 3, 8, 12, 25] For $Index = 0 To 9 GUICtrlCreateListViewItem($aNumbers[$Index], $cListView) WriteNumber($tData, $aNumbers[$Index]) Next EndFunc Edit#2: you can also have a more specialized function that will accept a new parameter $iMinimum so you can indicate from what number do you want to search for your minimum value. So it doesn't need to be 0 or 1 but anything you want and can be just an optional parameter. Func GetMinimum($tStruct, $iMinimum = 1) Local $Code = Binary('0x8B7424048B4C24088B54240CAD39D07404E2F9EB0B8B7424048B4C240842EBEC89D0C20C00') Local $iSize = BinaryLen($Code) Local $tCode = DllStructCreate('byte Code[' & $iSize & ']') DllStructSetData($tCode, 'Code', $Code) Local $aCall = DllCallAddress('int', DllStructGetPtr($tCode), 'ptr', DllStructGetPtr($tStruct), 'int', DllStructGetSize($tStruct) / 4, 'int', $iMinimum) Return $aCall[0] EndFunc
    1 point
  2. Sorry, but no. This is an AutoIt Forum, not a Cryptography forum. I can appreciate that you want to learn more about cryptography, but remedial instruction on the subject or advice on how to get a better understanding of cryptography is outside the scope of this forum. I'm happy to try to help you overcome technical obstacles or answer detailed, specific questions that are AutoIt-related. But unfortunately, you need to do your own research and the critical thinking necessary to get yourself to a point where you can ask those detailed, specific questions. Furthermore, I have no idea on what types of technical media (videos, articles, whitepapers, books, etc.) help you best absorb new information. Good luck on your journey to get a better understanding of cryptography.
    1 point
  3. TheSaint

    Kobo Cover Fixer

    Oh well, not what I was expecting to do today, which was to test out my resulting code with my Kobo device. But first I had this desire for some more helpful options to make some things easier etc. And then I spent much of the day doing them, and no device testing at all. So I ended up making a few more changes and additions to the program and Results window. 1. I felt the need for a MARK button, to mark a row, which would persist after a reload or program close. Row gets colored YELLOW or OLIVE. (see screenshot above) 2. Then I needed a NEXT button to quickly jump to each marked row. 3. Then I thought it would be much easier to use UP and DOWN arrow buttons, rather than just scrolling and list entry clicking. Makes it easier to step through each entry looking for images that need fixing. 4. I also wanted a FIX button for renaming an author. This is purely where there is one author name, and it is surname first followed by comma and then first name(s). The row gets colored AQUA when this happens, unless the row is also marked, in which case the row gets colored OLIVE to indicate both states. To accommodate these new buttons, I decided to increase the height of the window to allow another row of controls. This also allowed me to have longer inputs for Title and Author, and to properly label a few things. Clipboard button was enlarged to suit. SUBS button was renamed to ADD. All round a great improvement I think. During all this, I recalled I was supposed to have changed the positioning of the hidden CANCEL checkbox, that appears during the BACKUP IMAGES process. I'd changed the size of the BACKUP IMAGES button a couple of days ago. While checking that, I realized that due to that button now being multi-line, it would not look right when shrunk to half height to show the CANCEL checkbox. So not only did I need to fix the position of the CANCEL checkbox, I also needed to change the size of the text for both and not shrink the BACKUP IMAGES button as much. The SETTINGS button was also reduced in width to help things look better for the CANCEL checkbox, by widening the BACKUP IMAGES button a little. So all that was the easy part, though it took a while. Then because I now had a FIX button to rename the author name, I wanted a better method sorting, where title per sorted author was also sorted properly. This eventually meant creating a 2D array, after I tried a few other things first. I rarely work with 2D arrays, especially creating them from scratch, so it took a while (once again) to grasp what was required. I eventually got it right, including temporarily using an extra column that contained both Author and Title, then deleting that after sort had occurred, and the result is great. So loading the Ebooks List (which was also renamed) takes a few seconds longer now, but well worth it. I've also made the sorting optional, as an option on the SETTINGS window. I also thought I should add an Update Device SQLite option as well, though only the checking and unchecking is coded so far. So that and a few family things today, meant I finished late and did no device testing. Tomorrow is a new day, and I feel better prepared now. DOWNLOAD Kobo Cover Fixer.au3 (57 downloads) SEE THE FIRST POST in this topic for the latest version. 121.09 kB
    1 point
  4. @mLipok Those aren't the same scenarios. However, we could temporarily offer the ability to download older instances of Chromedriver from the original site.
    1 point
  5. Hi @argumentum Thanks, I have found what problem it is, below is the workable code. $file_to_open = "c:\dmcheck\dmcheck.sfv" ConsoleWrite(@CRLF & _CRC32ForFile($file_to_open) & @CRLF & @CRLF) ; basically this. You code the rest. $v1 = _CRC32ForFile($file_to_open) $v2 = "E1866101" If $v1 == $v2 Then MsgBox(262160, "PASS", "File check passed.") Else MsgBox(262160, "FAIL", "File check failed.") EndIf The "If" should with "==" but not "=". Anyway, thanks for your suggestion, I appreciated.
    1 point
  6. Mike, you'll find them in this post
    1 point
  7. Why on earth would you need to do this? #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> example() Func example() Const $BIN_VALUE = Binary("0x303425637013293133FDA4D5") Local $sBase2Value = _BinaryBits($BIN_VALUE, False), _ $sBits39to58 = StringMid($sBase2Value, 39, 20) Local $iInt32Value = _StringToInt32($sBits39to58, 2) ConsoleWrite("Base16 value: " & $BIN_VALUE & @CRLF) ConsoleWrite("Base2 value: " & _BinaryBits($BIN_VALUE) & @CRLF) ConsoleWrite("Bits 39-58 " & $sBits39to58 & @CRLF) ConsoleWrite("Int32 value of bits 39-58: " & $iInt32Value & @CRLF) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _BinaryBits ; Description ...: Convert data to its base2 value (with or without a space between every 4 bits) ; Syntax ........: _BinaryBits($vData[, $bAddSeparator = True]) ; Parameters ....: $vData - a string or number value. ; $bAddSeparator - [optional] a boolean value. Default is True. ; Return values .: A string representing the base2 value ; Author ........: TheXman ; =============================================================================================================================== Func _BinaryBits($vData, $bAddSeparator = True) Local $sBits = "" Local $xBinaryData = Binary($vData), _ $xByte = Binary("") Local $iBinaryDataLength = BinaryLen($xBinaryData) ;Process binary data from left-most byte to right-most byte For $i = 1 To $iBinaryDataLength ;Get byte $xByte = BinaryMid($xBinaryData, $i, 1) ;Spin thru each bit of byte (msb to lsb) For $j = 7 To 0 Step -1 ;If separator requested and this is 5th bit, then add a nibble separator If $bAddSeparator And $j = 3 Then $sBits &= " " ;If bit is set, then prepend 1 else prepend 0 $sBits &= (BitAND($xByte, 2 ^ $j) ? "1" : "0") Next ;If this isn't the last byte to be processed, then add a byte separator If $i < $iBinaryDataLength And $bAddSeparator Then $sBits &= " " Next Return $sBits EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _StringToInt32 ; Description ...: Convert a string, in the specified number base, to an int32. ; Syntax ........: _StringToInt64($sString, $iBase) ; Parameters ....: $sString A string representation of a integer value (in a base from 2 to 36). ; $iBase An integer value from 2 to 36. ; Return values .: Success An int32 value of the string. ; Failure 0 and sets @error to a non-zero value. ; @error 1 = Invalid number base ; 2 = DllCall failed. @extended = DllCall @error ; Author ........: TheXman ; =============================================================================================================================== Func _StringToInt32($sString, $iBase) Local $aResult[0] If $iBase < 2 Or $iBase > 36 Then Return SetError(1, 0, "") $aResult = DllCall('msvcrt.dll', 'int64:cdecl', '_wcstoui64', _ 'wstr' , $sString, _ 'wstr*' , Null, _ 'int' , $iBase) If @error Then Return SetError(2, @error, 0) Return Number($aResult[0], $NUMBER_32BIT) EndFunc Output: Base16 value: 0x303425637013293133FDA4D5 Base2 value: 0011 0000 0011 0100 0010 0101 0110 0011 0111 0000 0001 0011 0010 1001 0011 0001 0011 0011 1111 1101 1010 0100 1101 0101 Bits 39-58 00000100110010100100 Int32 value of bits 39-58: 19620
    1 point
  8. I still don't get what do you mean to keep the GUI responsive. Something like that? $hMain = GUICreate('Whatever', 400, 400) $cListBox = GUICtrlCreateList('', 10, 10, 390, 350) $cButton = GUICtrlCreateButton('Click me', 100, 365, 200, 30) GUISetState(@SW_SHOW, $hMain) While True ProcessMessages() AdlibRegister('ProcessMessages', 30) For $Index = 1 To 1000 ; If a loop doesn't take seconds ; you can remove adlib and process ; messages here ; ProcessMessages() GUICtrlSetData($cListBox, $Index) Sleep(500) Next AdlibUnRegister('ProcessMessages') Sleep(10) WEnd Func ProcessMessages() Switch GUIGetMsg() Case -3 Exit Case $cButton ConsoleWrite('Hi there!!' & @CRLF) EndSwitch EndFunc
    1 point
  9. You're welcome. I see a few issues with your revised snippet. The goal is to take the the 1st 32 characters of the encrypted string and the next 32 characters, that look like "8601da..." and convert them to binary, then decode the remaining base64 string to binary. There are multiple ways to do it. One way is to use a CryptoNG function that is made for converting strings to binary. You can read about it in the CryptoNG Help File under "Function Reference -> Misc / Helper Functions". You will see that the function can convert several different string formats to binary (including several different formats of HEX and even BASE64 strings). There are also examples using the function and its inverse function, in the provided examples file. You can compare your script to what I actually used and see where your issues are. First, the second StringMid() is not capturing the 2nd 32 characters. If the first 32 characters are (1,32), then the next 32 characters would be (33, 32). Which means the remaining characters would start at character 65. Here is how I parsed the values from the encrypted string: ;Parse IV, Salt & Encrypted Message from encrypted string $xIV = _CryptoNG_CryptStringToBinary(StringMid($sEncryptedString, 1, 32), $CNG_CRYPT_STRING_HEX) $xSalt = _CryptoNG_CryptStringToBinary(StringMid($sEncryptedString, 33, 32), $CNG_CRYPT_STRING_HEX) $xEncryptedMessage = _CryptoNG_CryptStringToBinary(StringMid($sEncryptedString, 65), $CNG_CRYPT_STRING_BASE64)
    1 point
  10. Or maybe some low level code: #include <WinAPIDiag.au3> Global $hListView, $cListView Global $tData = DllStructCreate('int Data[20000]') $hMain = GUICreate('Sample code', 400, 400) $cListView = GUICtrlCreateListView('Numbers', 10, 10, 380, 380, 0x0C, 0x21) ; LVS_SINGLESEL, LVS_SHOWSELALWAYS, LVS_EX_GRIDLINES, LVS_EX_FULLROWSELECT $hListView = GUICtrlGetHandle($cListView) GUISetState(@SW_SHOW, $hMain) FillStruct($tData) LoadSomeTestNumbers($cListView, $tData) GUIRegisterMsg(0x004E, 'WM_NOTIFY') Do Sleep(10) Until GUIGetMsg() = -3 ; GUI_EVENT_CLOSE Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam) Local $iCode = DllStructGetData($tNMHDR, "Code") If $hListView = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) And $iCode = -2 Then ; NM_CLICK Local $tNMITEMACTIVATE = DllStructCreate($tagNMITEMACTIVATE, $lParam) ; When I click a particular cell (let's say 4th cell of the listview) If DllStructGetData($tNMITEMACTIVATE, 'Index') = 3 Then Local $Minimum = GetMinimum($tData) GUICtrlCreateListViewItem($Minimum, $cListView) WriteNumber($tData, $Minimum) EndIf EndIf Return 'GUI_RUNDEFMSG' EndFunc Func LoadSomeTestNumbers($cListView, $tStruct) Local $aNumbers[10] = [15, 1, 6, 5, 7, 9, 3, 8, 12, 25] For $Index = 0 To 9 GUICtrlCreateListViewItem($aNumbers[$Index], $cListView) WriteNumber($tData, $aNumbers[$Index]) Next EndFunc Func FillStruct($tStruct) Local $Code = Binary('0x8B7424048B4C2408C706FFFFFFFF83C604E2F5C20800') Local $iSize = BinaryLen($Code) Local $tCode = DllStructCreate('byte Code[' & $iSize & ']') DllStructSetData($tCode, 'Code', $Code) Local $aCall = DllCallAddress('int', DllStructGetPtr($tCode), 'ptr', DllStructGetPtr($tStruct), 'int', DllStructGetSize($tStruct) / 4) EndFunc Func GetMinimum($tStruct) Local $Code = Binary('0x8B7424048B4C240831D2AD39D07404E2F9EB0B8B7424048B4C240842EBEC89D0C20800') Local $iSize = BinaryLen($Code) Local $tCode = DllStructCreate('byte Code[' & $iSize & ']') DllStructSetData($tCode, 'Code', $Code) Local $aCall = DllCallAddress('int', DllStructGetPtr($tCode), 'ptr', DllStructGetPtr($tStruct), 'int', DllStructGetSize($tStruct) / 4) Return $aCall[0] EndFunc Func WriteNumber($tStruct, $Minimum) Local $Code = Binary('0x8B7424048B4C24088B54240CAD83F8FF7409E2F8B8FFFFFFFFEB088956FCB800000000C20C00') Local $iSize = BinaryLen($Code) Local $tCode = DllStructCreate('byte Code[' & $iSize & ']') DllStructSetData($tCode, 'Code', $Code) Local $aCall = DllCallAddress('int', DllStructGetPtr($tCode), 'ptr', DllStructGetPtr($tStruct), 'int', DllStructGetSize($tStruct) / 4, 'int', $Minimum) Return $aCall[0] EndFunc On my PC to get (and then write) 10 minimum integers on a reserved memory that holds 20k integers take less then 1 ms. Is that fast enough?
    1 point
  11. What's New in Version v1.7.0 Released 4 minutes ago Internal code optimizations Increased query speed jqExec() and _jqExecFile() now accept string filters with comments (#), as if they were passed in from a file using the -f or --from-file option. jq UDF has a new companion tool for creating, testing, and learning JSON parsing and processing, it's called jqPlayground, It can be found in the AutoIt Downloads area under "Information Gathering" or by clicking HERE. It comes with over 15 JSON processing examples. You can modify and play with the examples or create & test your own.
    1 point
×
×
  • Create New...