информационная безопасность
без паники и всерьез
 подробно о проектеRambler's Top100
Где водятся OGRыSpanning Tree Protocol: недокументированное применениеАтака на Internet
BugTraq.Ru
Русский BugTraq
 Анализ криптографических сетевых... 
 Модель надежности двухузлового... 
 Специальные марковские модели надежности... 
 Три миллиона электронных замков... 
 Doom на газонокосилках 
 Умер Никлаус Вирт 
главная обзор RSN блог библиотека закон бред форум dnet о проекте
bugtraq.ru / форум / programming
Имя Пароль
ФОРУМ
все доски
FAQ
IRC
новые сообщения
site updates
guestbook
beginners
sysadmin
programming
operating systems
theory
web building
software
hardware
networking
law
hacking
gadgets
job
dnet
humor
miscellaneous
scrap
регистрация





Легенда:
  новое сообщение
  закрытая нитка
  новое сообщение
  в закрытой нитке
  старое сообщение
  • Напоминаю, что масса вопросов по функционированию форума снимается после прочтения его описания.
  • Новичкам также крайне полезно ознакомиться с данным документом.
Да ты прав... 12.12.01 16:34  Число просмотров: 1031
Автор: Heromantor Статус: Незарегистрированный пользователь
<"чистая" ссылка>
Мда старею,забываю....

Since an EXE file may be loaded on any segment, all absolute segment
references (such as FAR CALLs, long address pointers, and references such
as MOV AX,data_seg) must be adjusted to work for the memory location in
which they are loaded. Here are the steps used by the DOS program loader
(fn 4bH ) to load an EXE file:

1. Create a PSP via DOS Fn 26H.

2. Read 1cH bytes of the EXE file (the formatted portion of the EXE
header) into a local memory area.

3. Determine the load module size:
size=((wPageCnt*512)-(wHdrSize*16))-wPartPage

4. Determine file offset of load module = (wHdrSize * 16)

5. Select a segment addr, START_SEG, for loading (usually PSP+10H)

6. Allocate enough memory to hold the load module, honoring the
settings in wMaxMem and wMinMem.

7. Read the load module into memory starting at START_SEG:0000

8. LSEEK to the start of the relocation table (wTablOff)

9. For each relocation item (wReloCnt):
a. read the item as two 16-bit words (I_OFF,I_SEG)
b. add RELO_SEG=START_SEG+I_SEG (find the address of
relocation ref)
c. fetch the word at RELO_SEG:I_OFF (read current value)
d. add START_SEG to that word (perform the segment fixup)
e. store the sum back at its original address (RELO_SEG:I_OFF)

10. Allocate memory for the program according to wMaxMem and wMinMem

11. Initialize registers and execute the program:
a. ES = DS = PSP
b. Set AX to indicate the validity of drive IDs in command line
c. SS = START_SEG+ReloSS, SP = ExeSP
d. CS = START_SEG+ReloCS, IP = ExeIP
<programming> Поиск 






Rambler's Top100
Рейтинг@Mail.ru


  Copyright © 2001-2024 Dmitry Leonov   Page build time: 0 s   Design: Vadim Derkach