drmusti Posted April 26, 2020 Share Posted April 26, 2020 hi idm hex to value how can? [HKEY_CURRENT_USER\Software\DownloadManager\4705] "FileSize"=hex(0):f4,c0,bb,7f,00,00,00,00 how can get value? 5460004555 etc please help. 4705.reg Link to comment Share on other sites More sharing options...
Developers Jos Posted April 26, 2020 Developers Share Posted April 26, 2020 Should that should HEX information contain the value 5460004555? Hex for 5460004555 is "0x145710ECB". Jos drmusti 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 5460004555 etc not equal dear only example " hex(0):f4,c0,bb,7f,00,00,00,00 " result i dont know that. thanks please help me that this subject. Sincerely Link to comment Share on other sites More sharing options...
Musashi Posted April 26, 2020 Share Posted April 26, 2020 (edited) Create a hex string, e.g. using RegEx or string functions (remove commas) -> I'm sure you can do that yourself . Local $sHexStr $sHexStr = "f4c0bb7f00000000" ConsoleWrite(_Hex2Dec('0x' & $sHexStr) & @CRLF & @CRLF) $sHexStr = "f4c0bb7f" ConsoleWrite(_Hex2Dec('0x' & $sHexStr) & @CRLF & @CRLF) Func _Hex2Dec($iN) Local $aN, $ihex = 0 $aN = StringSplit(StringTrimLeft($iN, 2), "", 1) For $x = 1 To UBound($aN) - 1 $ihex += Dec($aN[$x]) * (16 ^ (UBound($aN) - 1 - $x)) Next Return $ihex EndFunc ;==>_Hex2Dec EDIT : Pay attention to the advice given by @jchd regarding endianness (two posts below). I neglected to mention that. Edited April 26, 2020 by Musashi drmusti 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
Developers Jos Posted April 26, 2020 Developers Share Posted April 26, 2020 34 minutes ago, drmusti said: dear only example Yea right ...... So you post something to convert to a decimal value but they are unrelated... smart. 35 minutes ago, drmusti said: please help me that this subject. Sure, when you a capable of posting some related information -> input with the expected output. Jos drmusti 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
jchd Posted April 26, 2020 Share Posted April 26, 2020 Beware of endianness: 0x7FBBC0F4 = 2 143 011 060 [10] 0xF4C0BB7F = 4 106 271 615 [10] 0xF4C0BB7F00000000 = -810 441 778 791 448 576 [10] (signed) 0xF4C0BB7F00000000 = 17 636 302 294 918 103 040 [10] (unsigned) drmusti and Musashi 2 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Nine Posted April 26, 2020 Share Posted April 26, 2020 A different approach displaying correctly the 64 bits integer : Local $sHexStr = "f4c0bb7f00000000" ConsoleWrite("0x" & $sHexStr & " = " & _Hex2Dec($sHexStr) & " [signed]" & @CRLF) ConsoleWrite("0x" & $sHexStr & " = " & _Hex2Dec($sHexStr, False) & " [unsigned]" & @CRLF) $sHexStr = "f4c0bb7f" ConsoleWrite("0x" & $sHexStr & " = " & _Hex2Dec($sHexStr) & @CRLF) Func _Hex2Dec($iN, $bSigned = True) If Mod(StringLen($iN),2) Then $iN = "0" & $iN Local $tByte = DllStructCreate ("byte string [8]") Local $tINT64 = DllStructCreate ("INT64 int", DllStructGetPtr ($tByte)) Local $tUINT64 = DllStructCreate ("UINT64 uint", DllStructGetPtr ($tByte)) Local $j = 1, $aResult For $i = StringLen($iN)-1 to 0 Step -2 DllStructSetData ($tByte, "string", "0x" & StringMid($iN,$i,2),$j) $j += 1 Next If $bSigned Then $aResult = DllCall("msvcrt.dll", "INT:cdecl", "sprintf", "STR", "", "STR", "%lli", "INT64", $tINT64.int) Else $aResult = DllCall("msvcrt.dll", "INT:cdecl", "sprintf", "STR", "", "STR", "%llu", "UINT64", $tUINT64.uint) EndIf Return $aResult[1] EndFunc ;==>_Hex2Dec drmusti and Musashi 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 "FileSize"=hex(0):f4,c0,bb,7f,00,00,00,00 at Internet Download Manager result : 1,99 GB (2143011060 Bytes) i cant fix logic. 0xf4c0bb7f00000000 = -810441778791448576 [signed] 0xf4c0bb7f00000000 = 17636302294918103040 [unsigned] 0xf4c0bb7f = 4106271615 how can get "2143011060 Bytes" ? thank you very much for all helpings. . Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 (edited) 3 hours ago, jchd said: Beware of endianness: 0x7FBBC0F4 = 2 143 011 060 [10] 0xF4C0BB7F = 4 106 271 615 [10] 0xF4C0BB7F00000000 = -810 441 778 791 448 576 [10] (signed) 0xF4C0BB7F00000000 = 17 636 302 294 918 103 040 [10] (unsigned) how can find or convert this value. because true bytes for result. 0x7FBBC0F4 = 2 143 011 060 [10] 2 143 011 060 bytes true.... how can convert or find this? Edited April 26, 2020 by drmusti Link to comment Share on other sites More sharing options...
jchd Posted April 26, 2020 Share Posted April 26, 2020 (edited) 3 hours ago, jchd said: 0x7FBBC0F4 = 2 143 011 060 [10] Like that! Place the bytes in little endianness order (reverse order). Edited April 26, 2020 by jchd drmusti 1 This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.Another excellent RegExp tutorial. Don't forget downloading your copy of up-to-date pcretest.exe and pcregrep.exe hereRegExp tutorial: enough to get startedPCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta. SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt) Link to comment Share on other sites More sharing options...
Developers Jos Posted April 26, 2020 Developers Share Posted April 26, 2020 Something like this?: $kvalue = "hex(0):f4,c0,bb,7f,00,00,00,00" $hSize = "" $Akey = StringSplit(StringMid($kvalue, StringInStr($kvalue, ":") + 1), ",") For $x = UBound($Akey) - 1 to 1 Step -1 If ($Akey[$x] <> "00") Then $hSize &= $Akey[$x] EndIf Next ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Dec($hSize) = ' & Dec($hSize) & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Jos drmusti 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 (edited) $kvalue = "hex(0):74,72,76,22,00,00,00,00" $hSize = "" $Akey = StringSplit(StringMid($kvalue, StringInStr($kvalue, ":") + 1), ",") For $x = UBound($Akey) - 1 to 1 Step -1 If ($Akey[$x] <> "00") Then $hSize &= $Akey[$x] EndIf Next ;ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : Dec($hSize) = ' & Dec($hSize) & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Local $idm_get_filesize= Dec($hSize) great working but proplem regread get empty? my OS : WIN7 x64 pro i added attach reg file for test. #include <MsgBoxConstants.au3> Local $sFileSizeee = RegRead("HKEY_CURRENT_USER\Software\DownloadManager\4950", "FileSize") MsgBox($MB_SYSTEMMODAL, "", "get idm file size: " & $sFileSizeee) result:empty value that cant get value hex(0):f4,c0,bb,7f,00,00,00,00 result:empty value what is true function or code? Sincerely 4705 test reg file.reg 4950 test reg file.reg Edited April 26, 2020 by drmusti update Link to comment Share on other sites More sharing options...
Nine Posted April 26, 2020 Share Posted April 26, 2020 You shouldn't need to use it in HKCU, but try using #RequireAdmin, cause you should get a binary string. drmusti 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 4 minutes ago, Nine said: You shouldn't need to use it in HKCU, but try using #RequireAdmin, cause you should get a binary string. #include <MsgBoxConstants.au3> #RequireAdmin Local $sFileSizeee = RegRead("HKEY_CURRENT_USER\Software\DownloadManager\4950", "FileSize") MsgBox($MB_SYSTEMMODAL, "", "get idm file size: " & $sFileSizeee) i try but result empty dear. Link to comment Share on other sites More sharing options...
Musashi Posted April 26, 2020 Share Posted April 26, 2020 What is the console output when you run this script : expandcollapse popup#include <AutoItConstants.au3> Local $iError, $iVarType, $sVarTypeName Local $sValue = RegRead("HKEY_CURRENT_USER\Software\DownloadManager\4950", "FileSize") $iError = @error $iVarType = @extended Switch $iVarType Case $iVarType = 0 $sVarTypeName = "$REG_NONE" Case $iVarType = 1 $sVarTypeName = "$REG_SZ" Case $iVarType = 2 $sVarTypeName = "$REG_EXPAND_SZ" Case $iVarType = 3 $sVarTypeName = "$REG_BINARY" Case $iVarType = 4 $sVarTypeName = "$REG_DWORD / $REG_DWORD_LITTLE_ENDIAN" Case $iVarType = 5 $sVarTypeName = "$REG_DWORD_BIG_ENDIAN" Case $iVarType = 6 $sVarTypeName = "$REG_LINK" Case $iVarType = 7 $sVarTypeName = "$REG_MULTI_SZ" Case $iVarType = 8 $sVarTypeName = "$REG_RESOURCE_LIST" Case $iVarType = 9 $sVarTypeName = "$REG_FULL_RESOURCE_DESCRIPTOR" Case $iVarType = 10 $sVarTypeName = "$REG_RESOURCE_REQUIREMENTS_LIST" Case $iVarType = 11 $sVarTypeName = "$REG_QWORD / $REG_QWORD_LITTLE_ENDIAN" Case Else $sVarTypeName = "UNKNOWN" EndSwitch ConsoleWrite("Value : " & $sValue & @CRLF) ConsoleWrite("Error : " & $iError & @CRLF) ConsoleWrite("VarType : " & $iVarType & @CRLF) ConsoleWrite("VarTypeName : " & $sVarTypeName & @CRLF) "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 7 minutes ago, Musashi said: What is the console output when you run this script : expandcollapse popup#include <AutoItConstants.au3> Local $iError, $iVarType, $sVarTypeName Local $sValue = RegRead("HKEY_CURRENT_USER\Software\DownloadManager\4950", "FileSize") $iError = @error $iVarType = @extended Switch $iVarType Case $iVarType = 0 $sVarTypeName = "$REG_NONE" Case $iVarType = 1 $sVarTypeName = "$REG_SZ" Case $iVarType = 2 $sVarTypeName = "$REG_EXPAND_SZ" Case $iVarType = 3 $sVarTypeName = "$REG_BINARY" Case $iVarType = 4 $sVarTypeName = "$REG_DWORD / $REG_DWORD_LITTLE_ENDIAN" Case $iVarType = 5 $sVarTypeName = "$REG_DWORD_BIG_ENDIAN" Case $iVarType = 6 $sVarTypeName = "$REG_LINK" Case $iVarType = 7 $sVarTypeName = "$REG_MULTI_SZ" Case $iVarType = 8 $sVarTypeName = "$REG_RESOURCE_LIST" Case $iVarType = 9 $sVarTypeName = "$REG_FULL_RESOURCE_DESCRIPTOR" Case $iVarType = 10 $sVarTypeName = "$REG_RESOURCE_REQUIREMENTS_LIST" Case $iVarType = 11 $sVarTypeName = "$REG_QWORD / $REG_QWORD_LITTLE_ENDIAN" Case Else $sVarTypeName = "UNKNOWN" EndSwitch ConsoleWrite("Value : " & $sValue & @CRLF) ConsoleWrite("Error : " & $iError & @CRLF) ConsoleWrite("VarType : " & $iVarType & @CRLF) ConsoleWrite("VarTypeName : " & $sVarTypeName & @CRLF) i done result Value : error : -2 type name : $REG_SZ empty. dear error -2 what mean? i cant read . Link to comment Share on other sites More sharing options...
Musashi Posted April 26, 2020 Share Posted April 26, 2020 2 minutes ago, drmusti said: dear error -2 what mean? see help : @error: 1 = unable to open requested key 2 = unable to open requested main key 3 = unable to remote connect to the registry -1 = unable to open requested value-2 = value type not supported "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 1 minute ago, Musashi said: see help : @error: 1 = unable to open requested key 2 = unable to open requested main key 3 = unable to remote connect to the registry -1 = unable to open requested value-2 = value type not supported result: readreg that value impossible? or any solution? Link to comment Share on other sites More sharing options...
Musashi Posted April 26, 2020 Share Posted April 26, 2020 11 minutes ago, drmusti said: or any solution? What happens, when you use : Local $sValue = RegRead("HKCU64\Software\DownloadManager\4950", "FileSize") drmusti 1 "In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." Link to comment Share on other sites More sharing options...
drmusti Posted April 26, 2020 Author Share Posted April 26, 2020 3 minutes ago, Musashi said: What happens, when you use : Local $sValue = RegRead("HKCU64\Software\DownloadManager\4950", "FileSize") i used and result value empty. unfortunately. 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