View Single Post
Old 2003-09-28, 20:40   #1
dsouza123's Avatar
Sep 2002

66210 Posts
Default Small windows programs to create and delete the stop.txt file for console ver NFSNET

I have attached two programs nfs_stop.exe and nfs_go.exe
they are written in MASM and work in 32-bit Windows 98SE, 2000, XP.

Used ML 6.14.8444 to assemble and LINK 5.12.8078 to link.

The source is included.

nfs_stop.exe writes the text file stop.txt in C:\NFSNET\processors\p0 causing the console version of NFSNET to stop as soon as it can

nfs_go.exe deletes stop.txt

In windows the path and filename are Not case sensitive.
If you have a different path then you will most likely need to reassemble and link.

;== here is code common to both ==
.model flat,stdcall
option casemap:none

include \masm32\include\
include \masm32\include\
include \masm32\include\

includelib \masm32\lib\user32.lib
includelib \masm32\lib\kernel32.lib

;== here is nfs_stop ==
szFullPathStop db "C:\NFSNET\processors\p0\stop.txt",0
szBuffStop db "stop",0
szCaption db "NFS_Stop",0
hFile dd 0
fwritten dd 0


; write stop to textfile C:\NFSNET\PROCESSORS\P0\stop.txt

mov hFile,eax
invoke SetFilePointer,hFile,0,0,FILE_END
invoke lstrlen,ADDR szBuffStop
invoke WriteFile,hFile,ADDR szBuffStop,eax,ADDR fwritten,0
invoke CloseHandle,hFile

invoke MessageBox,0,ADDR szFullPathStop,ADDR szCaption,MB_OK

mov eax,0
invoke ExitProcess,eax
end start

;== here is nfs_go ==

szFullPathStop db "C:\NFSNET\processors\p0\stop.txt",0
szBuffStop db "stop",0
szCaption db "NFS_Go",0
szDeleted db "Deleted C:\NFSNET\processors\p0\stop.txt",0
szNotFound db "Not Found C:\NFSNET\processors\p0\stop.txt",0


; delete file C:\NFSNET\PROCESSORS\P0\stop.txt

invoke DeleteFile,ADDR szFullPathStop
.if eax == TRUE
lea edx,szDeleted
lea edx,szNotFound

invoke MessageBox,0,edx,ADDR szCaption,MB_OK

mov eax,0
invoke ExitProcess,eax
end start
Attached Files
File Type: zip (2.2 KB, 359 views)
dsouza123 is offline   Reply With Quote