Go Back > Extra Stuff > Programming

Thread Tools
Old 2003-09-28, 20:40   #1
dsouza123's Avatar
Sep 2002

2×331 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, 332 views)
dsouza123 is offline   Reply With Quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create file to test primes automatically PawnProver44 Information & Answers 18 2016-03-08 00:58
console output to txt file pepi37 Linux 23 2015-09-28 18:23
Tired of all the prpclient console windows? opyrt Prime Sierpinski Project 4 2010-05-31 08:42
nfsnet programs henryzz NFSNET Discussion 2 2007-11-06 14:59
Posted windows programs and source to stop/allow console ver NFSNET dsouza123 NFSNET Discussion 1 2003-09-30 13:58

All times are UTC. The time now is 07:31.

Thu Dec 2 07:31:49 UTC 2021 up 132 days, 2 hrs, 0 users, load averages: 1.46, 1.31, 1.23

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.