943,972 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Marked Solved
  • Views: 1727
  • Assembly RSS
Nov 19th, 2007
0

problem in usin registry api

Expand Post »
hi

i write a program to add a value in windows registry but it didn't work
and doesn't add anything in registry, what's a problem?
my assembler is masm32.

and here is my code:

asm Syntax (Toggle Plain Text)
  1.  
  2. .386
  3. .model flat, stdcall
  4. option casemap:none
  5.  
  6. include windows.inc
  7. include kernel32.inc
  8. include advapi32.inc
  9.  
  10. includelib kernel32.lib
  11. includelib advapi32.lib
  12.  
  13. .data
  14. szRegSubKey db "Software\Microsoft\Windows\CurrentVersion\Policies\System", 0
  15. szValue db "DisableTaskMgr", 0
  16.  
  17. .data?
  18. hKey PHKEY ?
  19.  
  20. .code
  21. start:
  22.  
  23. invoke RegOpenKeyEx, RegOpenKeyEx, ADDR szRegSubKey, NULL, KEY_ALL_ACCESS, ADDR hKey
  24.  
  25. OR EAX, EAX
  26. JNE _error
  27. invoke RegSetValueEx, hKey, ADDR szValue, NULL, REG_DWORD, 1, DWORD
  28.  
  29. _error:
  30.  
  31. invoke RegCloseKey, hKey
  32. invoke ExitProcess, NULL
  33.  
  34. end start
Similar Threads
Reputation Points: 10
Solved Threads: 1
Newbie Poster
BlZbB is offline Offline
6 posts
since Sep 2007
Nov 19th, 2007
0

Re: problem in usin registry api

try
asm Syntax (Toggle Plain Text)
  1. invoke RegOpenKeyEx HKEY_LOCAL_MACHINE, ADDR szRegSubKey, NULL, KEY_ALL_ACCESS, ADDR hKey)
Last edited by Tight_Coder_Ex; Nov 19th, 2007 at 3:58 pm. Reason: Typo
Reputation Points: 47
Solved Threads: 17
Posting Whiz in Training
Tight_Coder_Ex is offline Offline
215 posts
since Feb 2005
Nov 19th, 2007
0

Re: problem in usin registry api

thanks Tight_Coder_Ex it's work.
Reputation Points: 10
Solved Threads: 1
Newbie Poster
BlZbB is offline Offline
6 posts
since Sep 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Booth's Algorithm in mips
Next Thread in Assembly Forum Timeline: need help in macro





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC