News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

RegEnum and read

Started by ragdog, January 07, 2008, 06:45:34 PM

Previous topic - Next topic

ragdog

hi

   
I would like the  install path of firefox to read why the works could not correct me tell you where the error is please


.data
keyname db "SOFTWARE\Mozilla\Mozilla Firefox", 0
keyname2 db "Main",0
keyread  db "PathToExe",0
buflen dd 512
rtype        DWORD REG_SZ
.data?

hInstance   dd ?
buf db 454 dup (?)
  buf1 db 454 dup (?)
handle dd ?
handle2 dd ?

.code



comment #
[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\2.0.0.11 (eng)\Main]
"PathToExe"="C:\\Program\\Mozilla Firefox\\firefox.exe"
#

.if uMsg==WM_INITDIALOG

      invoke RegOpenKeyEx, HKEY_LOCAL_MACHINE, OFFSET keyname, 0, KEY_READ, OFFSET handle
         mov ebx, 0

      invoke RegEnumKeyEx, handle, ebx, OFFSET buf, offset buflen, NULL, NULL, NULL, NULL
         cmp eax, 0
         jne @F

      invoke RegOpenKeyEx, handle, OFFSET buf, 0, KEY_READ, OFFSET handle2
 
      invoke RegOpenKeyEx, handle2, OFFSET keyname2, 0, KEY_READ, OFFSET handle2
      invoke RegQueryValueEx, handle2,addr keyread, 0,addr rtype  , OFFSET buf1, OFFSET buflen

      invoke MessageBox,hWnd,OFFSET buf1,0,MB_OK

@@:


thanks