Where I am mistaken?
.data
procname db 'C:\WINDOWS\process.exe', 0
.code
start:
invoke GetModuleHandle, ADDR procname
invoke OpenProcess, PROCESS_TERMINATE, 0, eax
invoke TerminateProcess, eax, 0
invoke ExitProcess, 0
end start
The GetModuleHandle API returns the module handle for the specified module if the file has been mapped into the address space of the calling process. So you can do GetModuleHandle on let's say kernel32.dll if your program uses kernel32 (it probably does) because it's a part of your program's memory space. But you can't get a module handle of each process running. Also, OpenProcess wants a process identifier, not a module handle. If your intention was to terminate a process running in windows, try to search for the ToolHelp api, this api can enumerate all processes and give the process id's for them (sorry, I don't have a link for you).
Thomas
Thank for your answer