Board index » delphi » help with non-text file reading
er...@phoenix.net
![]() Delphi Developer |
Fri, 24 Jul 1998 03:00:00 GMT
|
er...@phoenix.net
![]() Delphi Developer |
Fri, 24 Jul 1998 03:00:00 GMT
help with non-text file readingI would like to be able to read in a non-text file (such as an .EXE file) and |
Bruno Bougi
![]() Delphi Developer |
Mon, 27 Jul 1998 03:00:00 GMT
Re:help with non-text file readingQuoteer...@phoenix.net wrote: Var F : file of byte; begin Now you can use Read(F,B); So it's al(l?)most the same as reading a text-file. |
Thomas Petzk
![]() Delphi Developer |
Mon, 27 Jul 1998 03:00:00 GMT
Re:help with non-text file readingQuoteer...@phoenix.net wrote: -- Hi Eriko, you can read it either byte after byte as suggested, but this takes a very Thomas... <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
burro..
![]() Delphi Developer |
Mon, 27 Jul 1998 03:00:00 GMT
Re:help with non-text file readingHi there If using windows libraries, check wvsprintf for quick decimal to binary For file manipulation, check OpenFile, _lRead, -lWrite... etc. Thanking you James Burroughs ARS Administrator Service desk / Hulpburo (7I5G) Information Technology / Inligtings Tegnologie Telkom S.A. eMAIL : BURROUJH @ TELKOM09 Internet: Burro...@Telkom09.Telkom.Co.Za ph : +27(012)311-4280 (Service Desk) ph : +27(012)311-2461 (Direct) Fax : +27(012)324-4478 Pager : +27(012)341-7607 Code:24342 ~~~~~~~~~~~~~~~~~~~ ORIGINAL MESSAGE STARTS ~~~~~~~~~~~~~~~~~~~ I would like to be able to read in a non-text file (such as an .EXE file) change each character to HEX (along with formatting the output and other simple stuff) and finally save the HEX values into another file. The problem is that I am fairly new to Pascal programming but I do have a programs under my belt. I would appreciate any help anyone can offer, in email or posted here. I'm running both BP7 and TPW 1.5 (and Delphi 1.0) and would prefer a to the TPW (wincrt or otherwise) version though any and all responses appreciated. ~~~~~~~~~~~~~~~~~~~ ORIGINAL MESSAGE ENDS ~~~~~~~~~~~~~~~~~~~ |
s..
![]() Delphi Developer |
Tue, 28 Jul 1998 03:00:00 GMT
Re:help with non-text file readingQuoteIn article <NEWTNews.823587945.7754.er...@phoenix.net>, er...@phoenix.net writes: should get you started: ------------------>8 cut here 8<--------------------- const function Num2Hex( x: byte ) : string ; begin {$I- } if IOResult <> 0 then repeat (* convert and write hex equivalents of 16 bytes *) (* skip to next line *) until ( EOF( InFile )) or ( ReadCnt = 0 ) ; Close( InFile ) ; Let me know if this has any serious problems or you have any questions. HTH -* Stephen *- |