TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: RICHARD HIRNER
date: 1998-03-15 15:38:00
subject: Loading EXEs into RAM

Hello!
Another problem occured:
I am going to write a 16-bit protected mode program with Borland C++ *3.1*.
All I need from you is to know how to load an EXE program into the
memory (protected mode!).
I can imagine there are several steps?:
1) Open EXE file.
2) Read and process EXE header information.
3) Allocate memory for EXE segments.
4) Load each EXE segment to its memory segment. Each segment gets a
   selector and a descriptor.
5) Jump to entry point.
1, 2, 3, 5 work fine. But how do I know where a segment starts and where
it ends (in the file!).
I must need what's the starting offset of seg1, seg2...
Please help, please excuse my bad English...
Richard
... It is a rather pleasant experience to be alone in a bank at night.
--- Blue Wave v2.05 [NR]
---------------
* Origin: Constants aren't (2:310/3)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.