NO

Author Topic: Looking at Ms-Dos Header  (Read 285 times)

Offline HellOfMice

  • Member
  • *
  • Posts: 221
  • Never be pleased, always improve
Looking at Ms-Dos Header
« on: December 22, 2024, 08:02:43 PM »
Here is a small program to look at inside the MS-Dos Header
This program is a part of a bigger program
I found interesting so if you are curious as me...
The project has 2 7Zip files because of sqlite3.dll and a background images that very big
The build result I got is in the file "Build.txt"

--------------------------------
Kenavo

Offline HellOfMice

  • Member
  • *
  • Posts: 221
  • Never be pleased, always improve
Re: Looking at Ms-Dos Header
« Reply #1 on: December 22, 2024, 08:23:10 PM »
After this header you will find the stup program and the Rich header.
The rich Header will learn you which Microsoft tools have been used.
This header is not part of the PE file structure but it can exists on some tools
like Errlook.exe

You can learn more about in https://0xrick.github.io/win-internals/pe1/
« Last Edit: December 22, 2024, 08:28:34 PM by HellOfMice »
--------------------------------
Kenavo

Offline John Z

  • Member
  • *
  • Posts: 924
Re: Looking at Ms-Dos Header
« Reply #2 on: December 23, 2024, 12:22:40 AM »
Thanks HellOfMice!

I  think this is quite useful.

John Z

Offline HellOfMice

  • Member
  • *
  • Posts: 221
  • Never be pleased, always improve
Re: Looking at Ms-Dos Header
« Reply #3 on: December 23, 2024, 06:18:25 AM »
It's a sort of cookie that Microsoft installs. This is still valid today.


Look at this image and the one in the previous post. The image in this comes from a program that you know well
There is no Rich Header
« Last Edit: December 23, 2024, 06:21:49 AM by HellOfMice »
--------------------------------
Kenavo

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2154
Re: Looking at Ms-Dos Header
« Reply #4 on: December 23, 2024, 03:35:03 PM »
You can see it this way too  ;)
May the source be with you

Offline HellOfMice

  • Member
  • *
  • Posts: 221
  • Never be pleased, always improve
Re: Looking at Ms-Dos Header
« Reply #5 on: December 23, 2024, 03:48:58 PM »
Hi Timo,


Good,


I downloaded this program yesterday but when compiling it it said that an include file was missing. :o
Could you resend the whole project


When looking at in depth a file we can have surprise.
What interests me is to know what it means.
Here it is a kind of cookie.
--------------------------------
Kenavo

Offline HellOfMice

  • Member
  • *
  • Posts: 221
  • Never be pleased, always improve
Re: Looking at Ms-Dos Header
« Reply #6 on: December 24, 2024, 08:58:42 AM »
Here is a program, in C, that decrypt the GuidGen.exe Rich Header and the result.
Code: [Select]
536E6144 00000000 : 21358.24900.0
00000000 00000000 : 0.0.0
00CEFFDD 00000001 : 206.65501.1
00C7A09E 00000001 : 199.41118.1
00DF5146 00000001 : 223.20806.1
00E05146 00000013 : 224.20806.19
00E15146 00000009 : 225.20806.9
00DD5146 00000004 : 221.20806.4
00CBFFDD 0000000B : 203.65501.11
00010000 00000100 : 1.0.256
00E1797D 00000003 : 225.31101.3
00DB520D 00000001 : 219.21005.1
00970000 00000001 : 151.0.1
00DE797D 00000001 : 222.31101.1
3BF3635A 00000000 : 15347.25434.0

--------------------------------
Kenavo

Offline HellOfMice

  • Member
  • *
  • Posts: 221
  • Never be pleased, always improve
Re: Looking at Ms-Dos Header
« Reply #7 on: December 24, 2024, 04:57:30 PM »
I discovered that when POASM is in Debug mode it replaces the original MS-DOS header with its own one
Into my program I added a stub, written by TimoVJL. Into this file there is only the MS-DOS header, no stub program.
I needed to debug the program and tooke my program as a file to analyze.
What a surprise I did not recognize the header!
--------------------------------
Kenavo

Offline Vortex

  • Member
  • *
  • Posts: 907
    • http://www.vortex.masmcode.com
Re: Looking at Ms-Dos Header
« Reply #8 on: December 24, 2024, 06:07:45 PM »
Hi Philippe,

ıt's easy to build a DOS stub, you need to pass the KNOWEAS option to the 16-bit linker :

Code: [Select]
\masm32\bin\ml /c /coff Sample.asm
\masm32\bin\ml /c Mystub.asm
\masm32\bin\link16 /KNOWEAS Mystub.obj
\masm32\bin\link /SUBSYSTEM:WINDOWS /STUB:Mystub.exe Sample.obj
Code it... That's all...