-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSYSFILE.C
More file actions
69 lines (60 loc) · 1.75 KB
/
Copy pathSYSFILE.C
File metadata and controls
69 lines (60 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <dos.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <io.h>
void Encode (char *string) ;
main ()
{
char szFile [] = "micro-ed.sys" ;
int hFile ;
char szSchool [51] ;
char szPassword [21] ;
char szVer1 [50], szVer2 [50] ;
char szSer1 [50], szSer2 [50] ;
char szAutoHelp [2] ;
char szDemoData [2] ;
char szMonoSet [2] ;
char szRuns [6] ;
printf ("\nSysFile generator. Micro-Ed development\n\n") ;
printf ("Offset: ? 0 2 4 6 10 11 12 13 19 66 .... 86\n") ;
printf ("Varble: ^C nVer1 nVer2 nSer1 nSer2 bAutoHelp bDemoData bMonoSet nRuns szSchool szPassword\n") ;
strset (szSchool, 0) ;
strset (szPassword, 0) ;
printf ("szSchool? ") ; gets (szSchool) ;
printf ("szPassword? ") ; gets (szPassword) ;
printf ("nVer1? ") ; gets (szVer1) ;
printf ("nVer2? ") ; gets (szVer2) ;
printf ("nSer1? ") ; gets (szSer1) ;
printf ("nSer2? ") ; gets (szSer2) ;
printf ("bAutoHelp? ") ; gets (szAutoHelp) ;
printf ("bDemoData? ") ; gets (szDemoData) ;
printf ("bMonoSet? ") ; gets (szMonoSet) ;
printf ("nRuns? ") ; gets (szRuns) ;
Encode (&szPassword) ;
Encode (&szSchool) ;
hFile = open (szFile, O_CREAT) ;
if (hFile == -1)
{
printf ("Error opening file: %s\n", sys_errlist [errno]) ;
return ;
}
write (hFile, "\x1a", 1) ;
write (hFile, szVer1, 2) ;
write (hFile, szVer2, 2) ;
write (hFile, szSer1, 2) ;
write (hFile, szSer2, 4) ;
write (hFile, szAutoHelp, 1) ;
write (hFile, szDemoData, 1) ;
write (hFile, szMonoSet, 1) ;
write (hFile, szRuns, 5) ;
write (hFile, szSchool, 50) ;
write (hFile, szPassword, 20) ;
close (hFile) ;
}
void Encode (char *string)
{
int i = 1 ;
while (*string) *string++ ^= i++ ;
}