flat assembler
Message board for the users of flat assembler.

Index > DOS > .exe header DW 14h is IP starting point, but FAILS me Why?

Author
Thread Post new topic Reply to topic
bitdog2u



Joined: 31 Jan 2023
Posts: 78
bitdog2u 26 Sep 2026, 22:12
I was trying to write a program that would read the in file .EXE header and determine where the IP starting point is, and DW at 20 bytes in -14h, worked sometimes but failed other times. Do I need to add up the size of any relocated sectors or something? What am I missing here?
Post 26 Sep 2026, 22:12
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 21154
Location: In your JS exploiting you and your system
revolution 27 Sep 2026, 03:20
Offset 20 is the initial IP (e_ip)
Offset 22 is the initial CS (e_cs)
Post 27 Sep 2026, 03:20
View user's profile Send private message Visit poster's website Reply with quote
bitdog2u



Joined: 31 Jan 2023
Posts: 78
bitdog2u 27 Sep 2026, 15:44
Offset 22 was zero also, yet IP started 500 bytes in, so I started experimenting, Offset 8, times 16 added to, offset 20 gave me the number I needed, and since it is for my .COM based disassembler I added 100h, and now it seems to line up with the labels so I can find the IP entry point of a .DIS .EXE file easily. I tested it on 10 files and it did ok. Only time will tell, but I'm not exactly stuck anymore. I don't really have full and accurate PSP EXE header info available to me, so I'm a bit lost in trial and error. I was using EXEHEADR.COM in my DIS104.ZIP to get offset info. Thanks for trying for me Revolution, I don't get much usable feed back. I got input switches for DIS.com & input path, plus a couple more bug fixes. Is there any upgrades you want ? Is Candyman still active/alive ?
Post 27 Sep 2026, 15:44
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.