Unit HardDisk; <br>INTERFACE <br>FUNCTION GetHardDiskNaam : STRING; <br>FUNCTION GetHardDiskSerieNummer : STRING; <br>FUNCTION GetHardDiskControlleNummer : STRING; <br>PROCEDURE GetHardDiskGegevens; <br>CONST <br> CodeerTabel : ARRAY[0..24] OF BYTE = <br>(3,1,2,1,4,1,3,2,6,4,6,5,1,2,6,4,2,6,3,4,6,2,4,1,2); <br>TYPE <br> CharArray = ARRAY[0..24] OF CHAR; <br>VAR <br> HardDiskGegevens : ARRAY[1..256] OF INTEGER; <br> HardDiskNaam : CharArray; <br> SerieNummer : CharArray; <br> ControlleNummer : CharArray; <br> C_HardDiskNaam: STRING; <br> C_HardDiskSerieNummer : STRING; <br> C_HardDiskControlleNummer : STRING; <br> C_LicentieNaam: STRING; <br>IMPLEMENTATION <br>FUNCTION GetHardDiskNaam : STRING; <br>VAR <br> Teller : INTEGER; <br> Lus : INTEGER; <br>BEGIN <br> GetHardDiskNaam := ''; <br> Teller := 1; <br> FOR Lus := 1 TO 18 DO <br> BEGIN <br> HardDiskNaam[Teller] := CHR( ( HardDiskGegevens[27+Lus] DIV 256 )); <br> Inc(Teller); <br> HardDiskNaam[Teller] := CHR( ( HardDiskGegevens[27+Lus] MOD 256 )); <br> Inc(Teller); <br> END; <br> GetHardDiskNaam := HardDiskNaam; <br>END; <br>FUNCTION GetHardDiskSerieNummer : STRING; <br>VAR <br> Teller : INTEGER; <br> Lus : INTEGER; <br>BEGIN <br> GetHardDiskSerieNummer := ''; <br> Teller := 1; <br> FOR Lus := 1 TO 8 DO <br> BEGIN <br> SerieNummer[Teller] := CHR( ( HardDiskGegevens[10+Lus] DIV 256 )); <br> Inc(Teller); <br> SerieNummer[Teller] := CHR( ( HardDiskGegevens[10+Lus] MOD 256 )); <br> Inc(Teller); <br> END; <br> GetHardDiskSerieNummer := SerieNummer; <br>END; <br>FUNCTION GetHardDiskControlleNummer : STRING; <br>VAR <br> Teller : INTEGER; <br> Lus : INTEGER; <br>BEGIN <br> GetHardDiskControlleNummer := ''; <br> Teller := 1; <br> FOR Lus := 1 TO 3 DO <br> BEGIN <br> ControlleNummer[Teller] := CHR( ( HardDiskGegevens[23+Lus] DIV 256 )); <br> Inc(Teller); <br> ControlleNummer[Teller] := CHR( ( HardDiskGegevens[23+Lus] MOD 256 )); <br> Inc(Teller); <br> END; <br> GetHardDiskControlleNummer := ControlleNummer; <br>END; <br>PROCEDURE GetHardDiskGegevens; <br>VAR <br> Lus : INTEGER; <br>BEGIN <br> WHILE ( Port[$1f7] <> $50) DO ; <br> Port[$1F6] := $A0 ; <br> Port[$1F7] := $EC ; <br> WHILE ( Port[$1f7] <> $58 ) DO ; <br> FOR Lus := 1 TO 256 DO <br> BEGIN <br> HardDiskGegevens[Lus] := Portw[$1F0] ; <br> END; <br>END; <br>END. <br><br>