![]() |
![]() |
#1 |
Sep 2002
2×331 Posts |
![]()
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 == .386 .model flat,stdcall option casemap:none include \masm32\include\windows.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib ;== here is nfs_stop == .data szFullPathStop db "C:\NFSNET\processors\p0\stop.txt",0 szBuffStop db "stop",0 szCaption db "NFS_Stop",0 hFile dd 0 fwritten dd 0 .code start: ; write stop to textfile C:\NFSNET\PROCESSORS\P0\stop.txt invoke CreateFile,ADDR szFullPathStop,GENERIC_WRITE,FILE_SHARE_READ,0,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,0 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 == .data 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 .code start: ; delete file C:\NFSNET\PROCESSORS\P0\stop.txt invoke DeleteFile,ADDR szFullPathStop .if eax == TRUE lea edx,szDeleted .else lea edx,szNotFound .endif invoke MessageBox,0,edx,ADDR szCaption,MB_OK mov eax,0 invoke ExitProcess,eax end start |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
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 |