DOS/16bit/medium/huge model: Is it possible to force functions or data to segments? #1140
Replies: 3 comments 1 reply
-
I am not sure if I understand correctly what you need. Anyway any far item can be anywhere because access is by far pointer, therefore segment is not important. |
Beta Was this translation helpful? Give feedback.
-
that is 100% clear - usually im only working with tiny(single seg, near/near) or small model(one data, one code segment, near,near)
i tell you the complete story maybe you can then better see my needs - maybe i only need WLink to solve that
this 100% equal binary thing is to prevent translation errors that happen very easily while reversing - resulting in a nearly 100% recovery of the original code (without correct symbol names etc. but definitily code-identical) simliar projects: https://github.com/lethal-guitar/Duke2Reconstructed, https://github.com/smitelli/cosmore, https://github.com/asiekierka/reconstruction-of-zzt i have no real idea how the part 4 can be reached my idea was to generate some sort of example with multiple segments in Watcom C (because of the good documentation etc.) |
Beta Was this translation helpful? Give feedback.
-
Thanks for more explanation, I think now I understand better. Below is references to OW documentation which should help you with selection of suitable method, it is not single way. OW Linker DOS memory layout - DOSSEG directive Anyway it is necessary to know name and class for each segment or design it. |
Beta Was this translation helpful? Give feedback.
-
im working on a reverse engineering project of a medium and a huge model exe and want to prepare a test-project for playing around with code/segment ordering before going on the big project - so something that contains multiple segments for code[data]
so for example: i hope to get a simple medium(huge) model dos exe that contains multiple code segments with a single function each
and/or multiple data segments - that mean multiple segments in the relocation table for code+data
`
[func1.c]
int far func1(){ return 0; }
[func2.c]
int far func2(){ return 1; }
[func3.c]
int far func3(){ return 2; }
[main.c]
int func1();
int func2();
int func3();
int main()
{
return func1()+func2()+func3();
}
`
is that even possible with Watcom C or will the compiler "optimize" combine/merge segment freely on its own?
so something like:
put func1 in segmentX
put func2 in segmentY
put variable ABC in segmentZ
Beta Was this translation helpful? Give feedback.
All reactions