flat assembler
Message board for the users of flat assembler.

Index > DOS > MZ

Author
Thread Post new topic Reply to topic
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp 02 Jun 2009, 16:16
for my dos os, i have tried to make magic numbers to tell what the version of the file is and all that dtuff, but wheni compile it i have to check the 3rd letter (past the jmp code and everything else)
but wheni open an exe from windows the first letters are MZ how can i get my files to do that? does windos jump past the mz into the code?

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 02 Jun 2009, 16:16
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20300
Location: In your JS exploiting you and your system
revolution 02 Jun 2009, 23:14
.exe files are not .com files. .exe files always start with 'MZ', it is part of what makes it an .exe file. The OS gets the entry point address from the .exe header at the beginning of the file.
Post 02 Jun 2009, 23:14
View user's profile Send private message Visit poster's website Reply with quote
neville



Joined: 13 Jul 2008
Posts: 507
Location: New Zealand
neville 03 Jun 2009, 04:34
and the initial execution address is found in the header at CS=byte 16h, IP=byte 14h. The EXE header format can be found at http://www.frontiernet.net/~fys/exehdr.htm

_________________
FAMOS - the first memory operating system
Post 03 Jun 2009, 04:34
View user's profile Send private message Visit poster's website Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp 03 Jun 2009, 04:42
thank just what i needed, thanks guys

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 03 Jun 2009, 04:42
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 04 Jun 2009, 14:06
GhostXoPCorp wrote:
file is and all that dtuff, but wheni compile


Please try to make less bugs in your posts Idea

MZ EXE format was invented for DOS. Later OS/2, Win16, Win32 and Win64 set up their EXE formats on the top of MZ, they indeed skip the MZ stub.

Quote:
have to check the 3rd letter (past the jmp


NO.
Post 04 Jun 2009, 14:06
View user's profile Send private message Reply with quote
avcaballero



Joined: 02 Feb 2004
Posts: 203
Location: Madrid - Spain
avcaballero 04 Jun 2009, 15:48
missed place.. Laughing
Post 04 Jun 2009, 15:48
View user's profile Send private message Visit poster's website Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp 04 Jun 2009, 16:07
sorry, i have problems with stuff like that, at the time in my head "stuff"
was spelled right, but on the monitor, it wasnt, thanks though i will keep a better look at that



dos386: yes, i do, with my dos i made my file formats have to do that, i just wanted to know how i could get it from this:

(example not real opcode) zeros just fill in the spaces for where the code would go

000VTEP rest of code
vtep is VolTroX Executable Program
how can i get it like this
VTEP000 rest of code

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 04 Jun 2009, 16:07
View user's profile Send private message Reply with quote
HyperVista



Joined: 18 Apr 2005
Posts: 691
Location: Virginia, USA
HyperVista 05 Jun 2009, 20:18
As an historical side note on the origins of "MZ" in the PE Header, 'MZ' are the initials of the Microsoft developer who wrote the PE file format, Mark Zbikowski.
Wiki Link
Post 05 Jun 2009, 20:18
View user's profile Send private message Visit poster's website Reply with quote
GhostXoPCorp



Joined: 13 Dec 2008
Posts: 199
Location: 01F0:0100
GhostXoPCorp 05 Jun 2009, 20:45
thanks i will read up on that

_________________
Oh that divide overflow. Just jumps out of the bushes every time to scare the day lights out of me.
Post 05 Jun 2009, 20:45
View user's profile Send private message Reply with quote
pal



Joined: 26 Aug 2008
Posts: 227
pal 05 Jun 2009, 21:58
HyperVista wrote:

As an historical side note on the origins of "MZ" in the PE Header, 'MZ' are the initials of the Microsoft developer who wrote the PE file format, Mark Zbikowski.


Is that a verified fact? I swear that is just what people assume even though there is no citation behind it. There is a mixture of assumptions, some say it is the initials, some say it is meaningless.


Last edited by pal on 16 Jul 2009, 15:32; edited 1 time in total
Post 05 Jun 2009, 21:58
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr 16 Jul 2009, 14:41
pal,

This is excerpt from MS-DOS 3.30 sources (inc\exe.inc):
Code:
;
; EXE file header
;

EXE_file    STRUC
exe_signature    DW  ?                   ; must contain 4D5A  (yay zibo!)
exe_len_mod_512 DW  ?                       ; low 9 bits of length
exe_pages     DW  ?                   ; number of 512b pages in file
exe_rle_count DW  ?                   ; count of reloc entries    
It does not prove anything, though. And I highly doubt that MZ was involved in PE file format, which is based on COFF from VAX/VMS.
Post 16 Jul 2009, 14:41
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.