-
Notifications
You must be signed in to change notification settings - Fork 0
/
VirusEliminator2.2a.asm
executable file
·7075 lines (6558 loc) · 120 KB
/
VirusEliminator2.2a.asm
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;
; Copyright (C) 1998-2018 S?awomir Wojtasiak
;
; This program is free software
; modify it under the terms of the GNU General Public License
; as published by the Free Software Foundation
; of the License, or (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program
; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
;
INCDIR "INCLUDE:"
INCLUDE "intuition/intuition.i"
INCLUDE "intuition/intuition_lib.i"
INCLUDE "intuition/screens.i"
INCLUDE "exec/exec_lib.i"
INCLUDE "exec/exec.i"
INCLUDE "dos/dos.i"
INCLUDE "dos/dos_lib.i"
INCLUDE "libraries/diskfont_lib.i"
INCLUDE "graphics/graphics_lib.i"
INCLUDE "libraries/gadtools.i"
INCLUDE "devices/trackdisk.i"
INCLUDE "workbench/icon_lib.i"
INCLUDE "xvs/xvs.i"
INCLUDE "xvs/xvs_lib.i"
INCLUDE "libraries/reqtools.i"
INCLUDE "libraries/reqtools_lib.i"
**** STA?E ****
EXEC equ 4
USER equ $80000000
_LVOGetVisualInfoA equ -126
_LVOFreeVisualInfo equ -132
_LVOCreateConText equ -114
_LVOFreeGadgets equ -36
_LVOCreateGadget equ -30
_LVORefreshWindow equ -84
_LVOGetIMsg equ -72
_LVOReplyIMsg equ -78
_LVOCreateMenusA equ -48
_LVOLayoutMenusA equ -66
_LVOFreeMenus equ -54
_LVOAddAppIconA equ -60
_LVORemoveAppIcon equ -66
_LVOGBeginRefresh equ -$5a
_LVOGEndRefresh equ -$60
_LVOGSetGadgetAttrsA equ -$2a
**** Start ****
PROGRAM:
move.l EXEC.W,a6
lea ProcName,a1
jsr _LVOFindTask(a6)
tst.l d0
beq NieUruchomiony
move.l #1,TASK_S
bra DALEJ
NieUruchomiony:
move.l EXEC.W,a6
move.l $114(a6),a0
tst.l $ac(a0)
bne Runit
DALEJ: movem.l d0/a0,-(a7)
clr.l ReturnMsg
movea.w #0,a1
move.l $4.W,a6
jsr _LVOFindTask(a6)
movea.l d0,a4
lea $5c(a4),a0
jsr _LVOWaitPort(a6)
lea $5c(a4),a0
jsr _LVOGetMsg(a6)
move.l d0,ReturnMsg
movem.l (a7)+,d0/a0
tst.l TASK_S
bne SKOK
bsr Runit
SKOK:
move.l d0,-(a7)
move.l $4.W,a6
jsr _LVOForbid(a6)
move.l ReturnMsg,a1
jsr _LVOReplyMsg(a6)
move.l (a7)+,d0
rts
Runit:
lea PROGRAM,a1
move.l -4(a1),d3
clr.l -4(a1)
lea $17a(a6),a0
lea DosName,a1
jsr _LVOFindName(a6)
move.l $114(a6),a0
move.l d0,a6
move.l $98(a0),d1
jsr -$60(a6)
move.l d0,-(sp)
move.l a6,-(sp)
move.l 4,a6
jsr _LVOForbid(a6)
move.l (sp)+,a6
lea ProcName,a5
move.l a5,d1
clr.l d2
move.l #END_CODE-START,d4
jsr _LVOCreateProc(a6)
move.l d0,a0
move.l (sp)+,$3c(a0)
move.l EXEC.W,a6
jsr _LVOPermit(a6)
moveq #0,d0
rts
TASK_S: dc.l 0
ReturnMsg: dc.l 0
ProcName: dc.b 'VirusEliminator v2.2a by S?awomir Wojtasiak',0
SECTION VE,CODE_C
START: movem.l d0-a6,-(sp)
bsr VirusEliminator
movem.l (sp)+,d0-a6
tst.l ICONIFY
bne ICONIFY_PROC
rts
VirusEliminator:
bsr CreateGadgetCHB
bsr CreateGadgetDRIVE
move.l #42,LINE_NR
bsr OpenIntuition
beq ErrorInt
bsr OpenBootBlock
beq ErrorBoot
bsr _CheckDrive
move.w #0,DRIVE_NR
bsr OpenReqTools
beq ErrorReq
bsr OpenDiskFont
beq ErrorDF
bsr OpenGadTools
beq ErrorGadTools
bsr OpenDos
beq ErrorDos
bsr OpenGr
beq ErrorGr
bsr OpenVIREXFont
beq ErrorFont
bsr LockPubScreen
beq ErrorLock
bsr GetDrawInfo
beq ErrorDraw
bsr OpenScreen
beq ErrorScreen
bsr GetVisual
beq ErrorVisual
bsr CreateGadget
beq ErrorGadget
bsr OpenWindow
beq ErrorWindow
bsr DrawLine
bsr FontToRastPort
bsr CrMenu
bne ErrorMenu
bsr Memory
bsr Memory_Refresh
bsr OpenTrackDisk
bne ErrorTrackDisk
bsr OpenXVS
beq ErrorXVS
bsr LoadLibrary
move.l #0,_ICONIFY
**** Loop ****
Loop: bsr MenuRefresh
bsr ClrReg
bsr Memory_Refresh
move.l WindowBase,a0
bsr _GetMsg
cmp.l #MENUPICK,d1
bne Gadgety
cmp.w #$f821,d2
beq CheckFile
cmp.w #$f8a7,d2
beq MemoryCheck
cmp.w #$f887,d2
beq ZapisMem
cmp.w #$f867,d2
beq KopjujMem
cmp.w #$f807,d2
beq ReqATTR
cmp.w #$f827,d2
beq ReqATTR
cmp.w #$0047,d2
beq Zapisz_PHEX
cmp.w #$0847,d2
beq Zapisz_PASCII
cmp.w #$f805,d2
beq HardReset
cmp.w #$f825,d2
beq ColdReboot
cmp.w #$f864,d2
beq ZerujCOOL
cmp.w #$f884,d2
beq ZerujCOLD
cmp.w #$f8A4,d2
beq ZerujWARM
cmp.w #$f8C4,d2
beq ZerujTag
cmp.w #$f8E4,d2
beq ZerujMem
cmp.w #$f824,d2
beq SprawdzajWektory
cmp.w #$0004,d2
beq WektorHEX
cmp.w #$0804,d2
beq WektorASCII
cmp.w #$f883,d2
beq FreeLibrary_LABEL
cmp.w #$f8a3,d2
beq PrintBootName
cmp.w #$f843,d2
beq WriteLibrary
cmp.w #$f803,d2
beq AddBootBlock
cmp.w #$f823,d2
beq LoadLibrary_MENU
cmp.w #$f8A0,d2
beq Koniec
cmp.w #$f800,d2
beq About
cmp.w #$f802,d2
beq BootBlock_Buffor
move.l #LibList,VIEWATTR
cmp.w #$f806,d2
beq Libraries_LIST
move.l #DeviceList,VIEWATTR
cmp.w #$f826,d2
beq Libraries_LIST
cmp.w #$f822,d2
beq Plik_Buffor
cmp.w #$f820,d2
beq ICONIFY_INIT
cmp.w #$f801,d2
beq CHECK_BOOTBLOCK
moveq #XVSLIST_BOOTVIRUSES,d3
cmp.w #$0060,d2
beq VIRUS_LIST
moveq #XVSLIST_FILEVIRUSES,d3
cmp.w #$0860,d2
beq VIRUS_LIST
moveq #XVSLIST_LINKVIRUSES,d3
cmp.w #$1060,d2
beq VIRUS_LIST
cmp.w #$f840,d2
beq STATUS
cmp.w #$f842,d2
beq BUFFOR_PLIK
cmp.w #$f862,d2
beq KasujBuffor
cmp.w #$f8a2,d2
beq Czysty
cmp.w #$f8c2,d2
beq Standard
cmp.w #$f8e2,d2
beq Buffor
cmp.w #$f922,d2
beq Format
cmp.w #$f902,d2
beq InstallVEBoot
cmp.w #$f962,d2
beq Ascii
cmp.w #$f982,d2
beq HexRead
cmp.w #$f9a2,d2
beq Analizuj
Gadgety:
cmp.l #GADGETUP,d1
bne NieGadget
cmp.w #1,d0
beq Requstery_PROC
cmp.w #2,d0
beq TestDrive_PROC
cmp.w #3,d0
beq KillWirus_PROC
NieGadget:
cmp.l #GADGETDOWN,d1
bne NieGADDOWN
move.w d2,DRIVE_NR
NieGADDOWN:
cmp.l #GADGETUP,d1
bne NieGADUP
cmp.w #5,d0
beq Koniec
cmp.w #6,d0
beq ICONIFY_INIT
cmp.w #7,d0
beq STATUS
NieGADUP:
cmp.l #MOUSEBUTTONS,d1
bne NieMysz
bra Loop
NieMysz:
cmp.l #DISKINSERTED,d1
bne NieDysk
tst.l TestDrive
beq Loop
move.l #1,d2
lea CheckDrive.txt,a0
bsr PrintLine
bsr FreeMsg
lea Buffor_Roboczy,a0
bsr ReadBoot
bne ErrorBoot_check
lea Buffor_Roboczy,a0
add.l #1,CheckDrive
bra OkBuff_CBB
NieDysk:
bra Loop
ErrorBoot_check:
move.l #2,d2
lea ReadError,a0
bsr PrintLine
bra Loop
**************
FreeMsg:
move.l $4.W,a6
move.l WindowBase,a0
move.l wd_UserPort(a0),a0
move.l a0,a5
jsr _LVOWaitPort(a6)
move.l a5,a0
jsr _LVOGetMsg(a6)
tst.l d0
beq EndMsg
move.l d0,a1
jsr _LVOReplyMsg(a6)
EndMsg: rts
*************
Koniec: tst.l ICONIFY
bne SkokReq_0
cmp.w #0,Requstery
beq SkokReq_0
lea Koniec.txt,a1
lea Koniec.gad,a0
bsr ReqRequestGAD
tst.l d0
beq Loop
SkokReq_0:
bsr FreeLibrary
bsr CloseXVS
LOCK.XVS:
bsr CloseTrackDisk
LOCK.TD:
bsr CloseMenu
LOCK.MN:
bsr CloseWindow
LOCK.WA:
bsr FreeGadget
LOCK.FR:
bsr FreeVisual
LOCK.VI:
bsr CloseScreen
LOCK.SR:
bsr FreeDrawInfo
LOCH.DI:
bsr UnLockPubScreen
LOCK.ET:
bsr CloseFont
CloseLibraries:
bsr CloseGr
bsr CloseDos
bsr CloseGadTools
bsr CloseDiskFont
bsr CloseReqTools
LOCK.BOT:
bsr CloseIntuition
rts
ICONIFY_INIT:
move.l #1,ICONIFY
bra Koniec
**************************
* Procedury *
**************************
_CheckDrive:
lea Buffor_Roboczy,a0
move.w #3,DRIVE_NR
bsr ReadBoot
cmp.l #33,d0
bne Ok4stacje
move.w #2,DRIVE_NR
bsr ReadBoot
cmp.l #33,d0
bne Ok3stacje
move.w #1,DRIVE_NR
bsr ReadBoot
cmp.l #33,d0
bne Ok2stacje
move.w #0,DRIVE_NR
bsr ReadBoot
cmp.l #33,d0
bne Ok1stacje
rts
Ok4stacje:
rts
Ok3stacje:
move.l #DriveTable+3*4,a0
move.l #0,(a0)
rts
Ok2stacje:
move.l #DriveTable+2*4,a0
move.l #0,(a0)
rts
Ok1stacje:
move.l #DriveTable+1*4,a0
move.l #0,(a0)
rts
**************************
COPY_MEM_0:
movem.l d0-a6,-(sp)
subq.l #1,d0
Loop_COPYSTR:
move.b (a0)+,(a1)+
dbne d0,Loop_COPYSTR
suba.l #1,a1
move.b #' ',(a1)
movem.l (sp)+,d0-a6
rts
*************************
CheckFile:
lea CoSpr.gad,a0
lea CoSpr.txt,a1
bsr ReqRequestGAD
tst.l d0
beq Loop
cmp.l #2,d0
beq KatAlog
cmp.l #1,d0
beq PlIk
bra Loop
KatAlog:
bsr DirReq
tst.l d0
beq Loop
move.l DosBase,a6
move.l #FullName,d1
move.l #ACCESS_READ,d2
jsr _LVOLock(a6)
tst.l d0
beq Lock_Error
move.l d0,LOCK
move.l LOCK,d1
move.l #Buffor_FILE,d2
jsr _LVOExamine(a6)
tst.l d0
beq Error_Examine
Loop_READ:
move.l DosBase,a6
move.l LOCK,d1
move.l #Buffor_FILE,d2
jsr _LVOExNext(a6)
tst.l d0
beq UnLock
move.l #Buffor_FILE+fib_FileName,a0
tst.l Buffor_FILE+fib_DirEntryType
bpl Katalog
moveq #1,d2
bra Plik
Katalog:
moveq #2,d2
bsr PrintLine
sub.l #8,LINE_NR
moveq #1,d2
move.l #500,d1
lea Katalog.txt,a0
bsr PrintLine_X
bra Loop_READ
PlIk: bsr FileReq
tst.l d0
beq Loop
move.l DosBase,a6
move.l #FullName,d1
move.l #ACCESS_READ,d2
jsr _LVOLock(a6)
tst.l d0
beq FileError_LOCK.err
move.l d0,d3
move.l d0,d1
move.l #Buffor_FILE,d2
jsr _LVOExamine(a6)
move.l d3,d1
jsr _LVOUnLock(a6)
move.l #0,LOCK
move.l #FileName,a0
moveq #1,d2
Plik: bsr PrintLine
add.l #1,CheckFiles
move.l #Buffor_FILE+fib_Size,a0
move.l (a0),FileSize
tst.l LOCK
beq SKIP_Current1
move.l DosBase,a6
move.l LOCK,d1
jsr _LVOCurrentDir(a6)
move.l d0,LOCK_SAVE
SKIP_Current1:
move.l XVSBase,a6
move.l #XVSOBJ_FILEINFO,d0
jsr _LVOxvsAllocObject(a6)
tst.l d0
bne OkAllocObj
move.l #AllocError2.txt,a1
bsr ReqRequest
bra EndPlik_CHECK
OkAllocObj:
move.l d0,FileInfo
move.l EXEC.W,a6
move.l FileSize,d0
move.l #MEMF_ANY,d1
jsr _LVOAllocMem(a6)
beq AllocError
move.l d0,FileData
move.l DosBase,a6
move.l #Buffor_FILE+fib_FileName,d1
tst.l LOCK
bne JestLock
move.l #FullName,d1
JestLock:
move.l #MODE_OLDFILE,d2
jsr _LVOOpen(a6)
tst.l d0
beq OpenError_FCH
move.l d0,FileHandle_FCH
move.l d0,d1
move.l FileData,d2
move.l FileSize,d3
jsr _LVORead(a6)
tst.l d0
beq ReadError_FCH
move.l FileHandle_FCH,d1
jsr _LVOClose(a6)
move.l XVSBase,a6
move.l FileInfo,a0
move.l FileData,xvsfi_File(a0)
move.l FileSize,xvsfi_FileLen(a0)
jsr _LVOxvsCheckFile(a6)
cmp.l #XVSFT_EMPTYFILE,d0
beq EMPTYFILE
cmp.l #XVSFT_DATAFILE,d0
beq DATAFILE
cmp.l #XVSFT_EXEFILE,d0
beq EXEFILE
cmp.l #XVSFT_DATAVIRUS,d0
beq DATAVIRUS
cmp.l #XVSFT_FILEVIRUS,d0
beq FILEVIRUS
cmp.l #XVSFT_LINKVIRUS,d0
beq LINKVIRUS
move.l #NieWiem.txt,a0
move.l #500,d1
move.l #2,d1
bsr PrintLine_X
FreeMem:
move.l EXEC.W,a6
move.l FileSize,d0
move.l FileData,a1
jsr _LVOFreeMem(a6)
FreeFileInfo:
move.l XVSBase,a6
move.l FileInfo,a1
jsr _LVOxvsFreeObject(a6)
EndPlik_CHECK:
tst.l LOCK
beq Loop
move.l DosBase,a6
move.l LOCK_SAVE,d1
jsr _LVOCurrentDir(a6)
bra Loop_READ
***** Obs?uga wirusa ******
EMPTYFILE:
lea EmptyFile.txt,a0
moveq #3,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra FreeMem
DATAFILE:
lea DataFile.txt,a0
moveq #1,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra FreeMem
EXEFILE:
lea ExeFile.txt,a0
moveq #1,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra FreeMem
DATAVIRUS:
lea DataWirus.txt,a0
moveq #1,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra FreeMem
FILEVIRUS:
add.l #1,VirusFound
lea FileVirus.txt,a0
moveq #3,d2
sub.l #8,LINE_NR
move.l #500,d1
bsr PrintLine_X
move.l FileInfo,a0
move.l xvsfi_Name(a0),a1
lea FileWirus.txt+21,a0
Copy_FV_Loop:
move.b (a1)+,(a0)+
bne Copy_FV_Loop
lea FileWirus.txt,a1
lea Del_Nie.gad,a0
bsr ReqRequestGAD
tst.l d0
beq FreeMem
move.l DosBase,a6
move.l #FullName,d1
tst.l LOCK
beq LOCKJest0
move.l #Buffor_FILE+fib_FileName,d1
LOCKJest0:
jsr _LVODeleteFile(a6)
tst.l d0
bne OkSKASOWANY
lea ErrorDel.err,a0
moveq #2,d2
bsr PrintLine
bra FreeMem
OkSKASOWANY:
lea SKASOWANY,a0
moveq #1,d2
bsr PrintLine
bra FreeMem
LINKVIRUS:
lea LinkVirus.txt,a0
moveq #1,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
cmp.w #1,KillWirus
beq OKKILL
lea Link.txt,a1
lea Link.gad,a0
jsr ReqRequestGAD
tst.l d0
beq FreeMem
OKKILL:
move.l FileInfo,a0
move.l XVSBase,a6
jsr _LVOxvsRepairFile(a6)
tst.l d0
beq ErrorRepair
move.l #FullName,d1
move.l DosBase,a6
move.l #MODE_NEWFILE,d0
jsr _LVOOpen(a6)
tst.l d0
bne OkRead_
lea WriteError.txt,a0
moveq #2,d2
bsr PrintLine
bra FreeMem
OkRead_:
bra FreeMem
move.l d0,d7
move.l d0,d1
move.l FileInfo,a0
move.l xvsfi_Fixed(a0),d2
move.l xvsfi_FixedLen(a0),d3
jsr _LVOWrite(a6)
tst.l d0
beq ErrorW
move.l d7,d1
jsr _LVOClose
lea OkRepair.txt,a0
moveq #1,d2
bsr PrintLine
bra FreeMem
ErrorW:
move.l d7,d1
jsr _LVOClose
lea WriteError.txt,a0
moveq #2,d2
bsr PrintLine
bra FreeMem
ErrorRepair:
lea NotRepair.txt,a0
moveq #2,d2
bsr PrintLine
bra FreeMem
***** Errory FCH *****
FileError_LOCK.err:
lea ReadError_FCH.err,a0
moveq #2,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra Loop
ReadError_FCH:
move.l DosBase,a6
move.l FileHandle_FCH,d1
jsr _LVOClose(a6)
OpenError_FCH:
lea ReadError_FCH.err,a0
moveq #2,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra FreeMem
AllocError:
lea LibOpenERR,a0
moveq #2,d2
move.l #500,d1
sub.l #8,LINE_NR
bsr PrintLine_X
bra FreeFileInfo
UnLock:
move.l DosBase,a6
move.l LOCK,d1
jsr _LVOUnLock(a6)
bra Loop
Error_Examine:
lea Lock.err,a1
bsr ReqRequest
bra UnLock
Lock_Error:
lea Lock.err,a1
bsr ReqRequest
bra Loop
even
LOCK: dc.l 0
LOCK_SAVE: dc.l 0
FileInfo: dc.l 0
FileData: dc.l 0
FileHandle_FCH: dc.l 0
KATALOG: dc.l 0
FileSize: dc.l 0
Lock.err: dc.b 'Nie mog? otworzy? katalogu...',0
ReadError_FCH.err:dc.b 'B??d odczytu!',0
Katalog.txt: dc.b 'Katalog',0
NieWiem.txt dc.b '???',0
EmptyFile.txt: dc.b 'Pusty plik!',0
DataFile.txt: dc.b 'Plik z danymi',0
ExeFile.txt: dc.b 'Plik wykonywalny',0
DataWirus.txt: dc.b 'Plik z danymi wir.',0
FileVirus.txt: dc.b 'Virus plikowy!',0
LinkVirus.txt: dc.b 'Virus linker !',0
OkRepair.txt: dc.b 'Plik naprawiony !!!',0
NotRepair.txt: dc.b 'Nie uda?o si? naprawi? pliku !!!',0
FileWirus.txt: dc.b 'Uwaga wirus plikowy:',10
blk.b 50
Del_Nie.gad: dc.b 'Kasuj|Dalej',0
ErrorDel.err: dc.b 'Nie mog? skasowa? pliku !!!',0
SKASOWANY: dc.b 'Plik skasowany !!!',0
even
**************************
MemoryCheck:
move.l XVSBase,a6
move.l #XVSOBJ_MEMORYINFO,d0
jsr _LVOxvsAllocObject(a6)
tst.l d0
bne OkALocate
lea AllocError.txt,a1
bsr ReqRequest
bra Loop
OkALocate:
move.l d0,MemoryInfo
lea TestMem.txt,a0
moveq #1,d2
bsr PrintLine
move.l MemoryInfo,a0
move.w xvsmi_Count(a0),d0
tst.w d0
bne OkNie0
lea NicPod.txt,a0
moveq #1,d2
bsr PrintLine
bra FreeMemInfo
OkNie0:
FreeMemInfo:
move.l XVSBase,a6
move.l MemoryInfo,a1
jsr _LVOxvsFreeObject(a6)
bra Loop
**************************
ZapisMem:
bsr AdresReq
beq Loop
move.l d0,d5
lea TITLE_LongByte,a0
bsr GetLongREQ
cmp.l #-1,d0
beq Loop
move.l d0,ILE_MEM
bsr FileReq
tst.l d0
beq Loop
tst.w Requstery
beq OK_PLIKU_BRAK
move.l DosBase,a6
move.l #FullName,d1
move.l #MODE_OLDFILE,d2
jsr _LVOOpen(a6)
tst.l d0
beq OK_PLIKU_BRAK
move.l d0,d1
jsr _LVOClose(a6)
move.l #JestPlik1.txt,a1
move.l #JestPlik1.gad,a0
bsr ReqRequestGAD
tst.l d0
beq Loop
OK_PLIKU_BRAK:
move.l DosBase,a6
move.l #FullName,d1
move.l #MODE_NEWFILE,d2
jsr _LVOOpen(a6)
tst.l d0
bne OkPlikStworzony
lea WOpen.err,a1
bsr ReqRequest
bra Loop
OkPlikStworzony:
move.l DosBase,a6
move.l d0,d7
move.l d0,d1
move.l d5,d2
move.l ILE_MEM,d3
jsr _LVOWrite(a6)
tst.l d0
bne OkWriteFileMem
move.l d7,d1
jsr _LVOClose(a6)
lea WriteError.txt,a1
bsr ReqRequest
bra Loop
OkWriteFileMem:
move.l d7,d1
jsr _LVOClose(a6)
lea PlikZapisany.txt,a0
moveq #1,d2
bsr PrintLine
bra Loop
**************************
GetLongREQ:
movem.l d1-a6,-(sp)
move.l #0,_LONG
move.l ReqBase,a6
lea _LONG,a1
move.l a0,a2
move.l #0,a3
lea GetLong_TAGLIST,a0
move.l #TextATTR,3*4(a0)
move.l ScreenBase,1*4(a0)
jsr _LVORtGetLongA(a6)
tst.l d0
bne Ok_REQ
move.l #-1,_LONG
Ok_REQ: movem.l (sp)+,d1-a6
move.l _LONG,d0
rts
_LONG: dc.l 0
**************************
KopjujMem:
lea ZRUDLO,a0
bsr AdresReq1
beq Loop
move.l d0,d2
lea DOCELOWY,a0
bsr AdresReq1
beq Loop
move.l d0,d3
move.l d2,d0
move.l d3,d1
sub.l d0,d1
tst.l d1
bne OkAdres2
lea Adres0,a1
bsr ReqRequest
bra Loop
OkAdres2:
lea TITLE_LongByte,a0
bsr GetLongREQ
cmp.l #-1,d0
beq Loop
cmp.l #0,d0
beq Loop
move.l EXEC.W,a6
move.l d2,a0
move.l d3,a1
jsr _LVOCopyMem(a6)
lea Copy_ok.txt,a0
moveq #1,d2
bsr PrintLine
bra Loop
****************************
Zapisz_PHEX:
bsr AdresReq
beq Loop
move.l d0,d2
Loop_PrintHEX:
move.l d2,d0
bsr PrintHexMem22
add.l #336,d2
move.l #Kont.gad,a0
move.l #Kont.txt,a1
bsr ReqRequestGAD_1
tst.l d0
bne Loop_PrintHEX
bra Loop
*************************
Zapisz_PASCII:
bsr AdresReq
beq Loop
move.l d0,d2
Loop_PrintASCII:
move.l d2,d0
bsr PrintAsciiMem22
add.l #336,d2
move.l #Kont.gad,a0
move.l #Kont.txt,a1