• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Determining the segment boundary

Hi all,
    I'm now working on a dissembler for DOS/Windows using C. And I want to tart it off from DOS. There are a couple of disassembers in the market now. And I knew that they used PRELOAD method to load the program to memory to decide the segment boundaries before it is transversed. What I want to do is to dump the whole program from disk to disk. that means that the whole program(no matter how big) can be reassembled without errors like being found in the other dissembler like sourcer
1 Solution
Do you have a specific question?
whlukAuthor Commented:
The question is how to determine the segment boundaries in DOS.

In DOS, all segments are unbounded.  In real mode, the 80x86 won't detect segmentation faults.

If you want to figure out where in memory stuff will be, you almost need to execute (or simulate execution of) the program.  The location of the segments gets decided when the SS, DS or CS registers are loaded.  In DOS, this is frequently the result of some calculation.

Featured Post

Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now