Jump to content

[Solved]regread() for reg_qword(11) type unable to read value from regedit.


Fire
 Share

Recommended Posts

Hallo Dear AutoIT Community.

I'm trying automate GPO task for prevent execute of some applicaiton on machine(Based on MD5 SUM for file).(OS=WIN XP2)

( Belongs to http://technet.microsoft.com/en-us/library/bb457006.aspx )

Theris no problem trace registry chacnges also write to regedit .

But now i have problem.

Problem in that regread() is unable to read REG_QWORD(11) types values from regedit.

Posted Image

In fact using regwrite() with REG_QWORD() successfull for me.

Like this:

$main="HKEY_USERS\S-1-5-21-436374069-299502267-839522115-1007\Software\Microsoft\Windows\CurrentVersion\Group Policy Objects\{212C5223-8731-4415-AD99-4BA2393901A4}Machine\Software\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Hashes\{9d36208f-c301-44cf-b785-fd60a6e94d52}"

RegWrite($main,"ItemSize","REG_QWORD",Binary(FileGetSize("J:\package\installer1111.exe")))

But it's unable to read ItemSize value because it is 64 bit number.If i understand correctly Autoit has limitation and this issuse associated with it.

Am i right?Or misunderstand?

Valid export for regedit gives me reg.reg file which contains(see below)

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Hashes\{ca394125-3470-4a71-b977-846792228ea1}]
"LastModified"=hex(b):be,b1,aa,b6,e4,7c,cb,01
"Description"=""
"FriendlyName"=" (1.0.0.0)"
"SaferFlags"=dword:00000000
"ItemSize"=hex(b):b8,71,23,00,00,00,00,00
"ItemData"=hex:5e,b0,20,0d,f7,b4,3c,75,ce,82,86,12,54,1b,c8,5d
"HashAlg"=dword:00008003

Can you see

"ItemSize"=hex(b):b8,71,23,00,00,00,00,00
<== how to read it using Autoit regread() funcsion?

I have all read/write permissions to regedit.But regread() for ItemSize gives me nothing which means error :graduated:( Also for LastModified)

Autoit version:v3.3.6.0

OS = Win Xp SP2 (32bit)

Questions:

Is here another alternative way for solve this?

Any hints, helps please?

Thanks so much GREAT COMMUNITY;).

Edited by Fire
[size="5"] [/size]
Link to comment
Share on other sites

Nevermind!

Solution (Thanks very much wraithdu for this great UDF!)

#Include <String.au3>
#include <udf.au3>
$str= _RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Safer\CodeIdentifiers\0\Hashes\{ca394125-3470-4a71-b977-846792228ea1}", "ItemSize")
$str=$str / 1000000

$out=StringMid($str,StringInStr($str,".",0,1) - 1,StringInStr($str,".",0,1) +1)

MsgBox(64,"","Filesize = " &  $out& " MB")

Solved!

Thx to all

[size="5"] [/size]
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...