Category : Pascal Source Code
Archive   : QK3KER.ZIP
Filename : QK3HEX.PAS

 
Output of file : QK3HEX.PAS contained in archive : QK3KER.ZIP
(* ******************************************************************** *)
(* ExeHex - Dump a EXE file into a HEX file. *)
(* Author - Victor Lee , Queen's University, Kingston, Ontario, CANADA *)
(* Network id - VIC at QUCDN *)
(* Date - 1986 Feb 12 *)
(* - 1988 April 28 *)
(* Note : See HexExe to convert HEX file into EXE file. *)
(* ******************************************************************** *)
Program ExeHex ;
type blocks = array [1..128] of char ;
S2 = string[2] ;
var
i : byte ;
ExeName,HexName : string[14] ;
FN : string[8] ;
abyte : byte ;
Afile : file of byte ;
Bfile : Text ;
count,Rcount : integer ;
label exit ;

function hex(num:byte) : S2;
var digit :byte ;
hex1 : char ;
begin (* hex *)
digit := num and $0F ;
if digit > 9 then digit := digit + 7 ;
hex1 := chr($30 + digit) ;
digit := (num and $F0) div $10 ;
if digit > 9 then digit := digit + 7 ;
hex := concat(chr($30+digit),hex1);
end;


Begin (* hex Dump *)
Writeln('Enter Name of EXE File to Dump into HEX file ');
Readln(FN);
ExeName := FN + '.EXE' ;
HexName := FN + '.HEX' ;
Assign (Afile,ExeName);
Assign (Bfile,HexName);
Reset(Afile);
Rewrite(Bfile);
count := 0 ;
Rcount := 0 ;
Writeln('Converting File: ',ExeName,' file size =',FileSize(Afile));
Write(' 32 bytes make a 64 byte Record . Record count = ');
While True Do
Begin (* write a line *)
For i := 1 to $20 do
Begin (* dump file *)
if Eof(Afile) then goto exit;
read(Afile,abyte);
count := count + 1 ;
(* write(hex(abyte)); *)
write(Bfile,hex(abyte));
End;
Writeln(Bfile);
Rcount := Rcount + 1 ;
Write(RCount ,' ');
End ; (* write a line *)
exit :
Close(Bfile) ;
Writeln('Number of 64 byte records =',Rcount +1);
Writeln('New file ',HexName,' created. File size is ',count*2);
End. (* hex Dump *)


  3 Responses to “Category : Pascal Source Code
Archive   : QK3KER.ZIP
Filename : QK3HEX.PAS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/