This repository was archived by the owner on Dec 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathV-LBC3.C
More file actions
92 lines (78 loc) · 2.77 KB
/
V-LBC3.C
File metadata and controls
92 lines (78 loc) · 2.77 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*---------------------------------------------------------------
;
; V-LBC3 LBC 바이러스용 백신 프로그램
;
; (저) 1994 안 철 수
;
;--------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "vtools.h"
struct DxStr LbcMemDx = { /* 기억장소 진단용 문자열 */
0x117,
10,
{0x48, 0x48, 0x89, 0x07, 0xB1, 0x06, 0xD3, 0xE0, 0x8E, 0xC0}
};
struct DxStr LbcMbsDx = { /* 부트 섹터 진단용 문자열 */
0x17,
10,
{0x48, 0x48, 0x89, 0x07, 0xB1, 0x06, 0xD3, 0xE0, 0x8E, 0xC0}
};
struct BvMemTx0 LbcMemTx = {
0x178, 2
};
struct BvMbsTx10 LbcMbsTx = {
0x5E, 0x63, 0x5D, 0
};
unsigned char cDrive;
int iResult;
char szPrgName[] = "V-LBC3 Vaccine program for LBC virus\n"
" (c)Copyright 1994 by Cheolsoo Ahn\n\n";
char szMsg1[] = "Usage: V-LBC3 <drive>\n";
char szMsg2[] = "Checking the Memory : ";
char szMsg3[] = "Checking Boot Sector: ";
char szMsg4[] = "no LBC virus\n";
char szMsg5[] = "\aLBC virus found";
char szMsg6[] = " -> Cured\n";
char szErrMsg1[] = "\n\aERROR: disk read error\n";
char szErrMsg2[] = "\n\aERROR: disk write error\n";
int main(int argc, char *argv[])
{
printf("%s", szPrgName); /* 프로그램 이름 출력 */
if (argc == 1) { /* 인자 없을 때 도움말 출력 */
printf("%s", szMsg1);
exit(0);
}
cDrive = toupper(*argv[1]) - 'A';
/* 일반 기억장소 검사 */
printf("%s", szMsg2); /* '기억장소 검사:' 출력 */
if (CheckBootVirusInMem(&LbcMemDx) == 0)
printf("%s", szMsg4); /* '바이러스 없음' 출력 */
else {
printf("%s", szMsg5); /* '바이러스 존재' 출력 */
CureBootVirusInMem(0, &LbcMemTx);
printf("%s", szMsg6); /* '-> 치료' 출력 */
}
/* 부트 섹터 읽음 */
printf("%s", szMsg3); /* '부트 섹터 검사:' 출력 */
if ((iResult=CheckBootVirusInMBS(cDrive,&LbcMbsDx)) == -1) {
printf("%s", szErrMsg1); /* 디스크 읽기 오류 */
exit(1);
}
if (iResult == 0)
printf("%s", szMsg4); /* '바이러스 없음' 출력 */
else {
printf("%s", szMsg5); /* '바이러스 존재' 출력 */
if (CureBootVirusInMBS(cDrive, 0x10, &LbcMbsTx) == -1) {
switch (wErrCode) {
case 2: printf("%s", szErrMsg1);
exit(1);
case 3: printf("%s", szErrMsg2);
exit(1);
}
} else
printf("%s", szMsg6); /* '-> 치료' 출력 */
}
return 0;
}