我正在尝试使用masm32向运行注册表项添加值。
.386
.model FLAT, STDCALL
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\masm32.inc
include \masm32\include\advapi32.inc
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\masm32.lib
.data
regkey dd 0
origfile db "C:\\masm32\\activity\\time.exe",0
Run db "\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run",0
valuename db "Time", 0
.code
start:
;open registry
push regkey ;hkey
push 0F003FH ; all access
push 0
push offset Run ; subkey
push 80000002h ; local machine
call RegOpenKeyExA
;set the value
push 31
push offset origfile
push REG_SZ
push 0
push offset valuename
push regkey
call RegSetValueExA
但是在检查regedit时,它没有添加或设置我在运行注册表中想要的值。我只想知道我是否错过了一些东西,以便代码正常工作。关于这个有什么建议吗?预先谢谢你!