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:
.386
.model flat, stdcall
option casemap:none
include windows.inc
include kernel32.inc
include advapi32.inc
includelib kernel32.lib
includelib advapi32.lib
.data
szRegSubKey db "Software\Microsoft\Windows\CurrentVersion\Policies\System", 0
szValue db "DisableTaskMgr", 0
.data?
hKey PHKEY ?
.code
start:
invoke RegOpenKeyEx, RegOpenKeyEx, ADDR szRegSubKey, NULL, KEY_ALL_ACCESS, ADDR hKey
OR EAX, EAX
JNE _error
invoke RegSetValueEx, hKey, ADDR szValue, NULL, REG_DWORD, 1, DWORD
_error:
invoke RegCloseKey, hKey
invoke ExitProcess, NULL
end start