Да, с адресацией погорячился.
include 'win32a.inc'
format PE GUI 4.0
entry start
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section '.data' data readable writeable
reestrsub db 'Software\Microsoft\Windows\CurrentVersion\Run',0
rname1 db 'netagent',0
rname2 db 'test',0
hdd dd ?
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section '.code' code readable executable
start:
push hdd
push KEY_ALL_ACCESS
push 0
push reestrsub
push HKEY_LOCAL_MACHINE
call [RegOpenKeyEx]
push 4
push rname2
push REG_SZ
push 0
push rname1
push [hdd]
call [RegSetValueEx]
push [hdd]
call [RegCloseKey]
push 0
call [ExitProcess]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
section 'idata' import data readable writeable
library kernel,'KERNEL32.DLL',\
advapi,'ADVAPI32.DLL'
import kernel,\
ExitProcess,'ExitProcess'
import advapi,\
RegOpenKeyEx,'RegOpenKeyExA',\
RegSetValueEx,'RegSetValueExA',\
RegCloseKey,'RegCloseKey'
вот оригинал:
http://rfpro.ru/question/17157