BBS: Inland Empire Archive Date: 11-16-92 (14:24) Number: 327 From: JOHN GALLAS Refer#: NONE To: ADAM NIKIC Recvd: NO Subj: File header *.EXE Conf: (2) Quik_Bas
AN>Does anyone can send in this echo the format of *.EXE file produced by
AN>QuickBasic 4.5 compiler?
Well, if you want to read in what the EXE does or something like that,
you can't.. but I do have some code to read the header of an exe file:
TYPE EXEHEADER
exSignature AS INTEGER ' Always MZ for one of DOS's forefathers.
exExtraBytes AS INTEGER ' Number of bytes in last page.
exPages AS INTEGER ' Number of whole and part pages.
exRelocItems AS INTEGER
exHeaderSize AS INTEGER
exMinAlloc AS INTEGER
exMaxAlloc AS INTEGER
exInitSS AS INTEGER
exInitSP AS INTEGER
exCheckSum AS INTEGER
exInitIP AS INTEGER
exInitCS AS INTEGER
exRelocTable AS INTEGER
exOverlay AS INTEGER
END TYPE
DIM e AS EXEHEADER
OPEN COMMAND$ FOR BINARY AS #1 'change COMMAND$ to the name of
GET #1, , e 'the exe file
PRINT e.exSignature
PRINT e.exExtraBytes
PRINT e.exPages
PRINT e.exRelocItems
PRINT e.exHeaderSize
PRINT e.exMinAlloc
PRINT e.exMaxAlloc
PRINT e.exInitSS
PRINT e.exInitSP
PRINT e.exCheckSum
PRINT e.exInitIP
PRINT e.exInitCS
PRINT e.exRelocTable
PRINT e.exOverlay
CLOSE
END
* OLX 2.1 TD * He's got a MAGNET! Everbody, BACKUP!!! -Cmdr. Data
--- RyPacker v2.5a
* Origin: The Ghost Mode - An RyBBS System! (612)-688-0026 (1:282/3006)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET