flat assembler
Message board for the users of flat assembler.

Index > Windows > How to get this new message box UI?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
Mat-Quasar



Joined: 02 Mar 2025
Posts: 82
Mat-Quasar 10 Apr 2025, 13:11
Mine set to PE GUI 5.1, but CFF Explorer shows Subsystem Major 5, Minor A (which is 10 decimal, correct?)
And also OS major 1, minor 0. Different from yours.

Isn't it "format PE GUI 5.1"? Or "format PE GUI 5.01"?


Description: Mine
Filesize: 73.71 KB
Viewed: 839 Time(s)

cff.PNG


Post 10 Apr 2025, 13:11
View user's profile Send private message Reply with quote
Ali.Z



Joined: 08 Jan 2018
Posts: 820
Ali.Z 10 Apr 2025, 13:14
nope, 5-A = 5.10 which != to 5.1.

_________________
Asm For Wise Humans
Post 10 Apr 2025, 13:14
View user's profile Send private message Reply with quote
Mat-Quasar



Joined: 02 Mar 2025
Posts: 82
Mat-Quasar 10 Apr 2025, 13:18
Ali.Z wrote:
nope, 5-A = 5.10 which != to 5.1.


Never knew that in FASM, need to set to:

Code:
format PE GUI 5.01    


Now works, but Win95 look. Thanks.
Post 10 Apr 2025, 13:18
View user's profile Send private message Reply with quote
Mat-Quasar



Joined: 02 Mar 2025
Posts: 82
Mat-Quasar 10 Apr 2025, 14:58
Thanks a for your detailed analysis, now I know FASM treats version 5.1 as 5.10. No wonder.
Post 10 Apr 2025, 14:58
View user's profile Send private message Reply with quote
a



Joined: 10 Apr 2025
Posts: 17
Location: Ukraine
a 10 Apr 2025, 15:00
if you compile this:
Code:
format PE GUI 5.1    
then you will see in hex editor that at address 0x000000C8 it produces: 0x05,0x00,0x0A,0x00 (it means dw 5 dw 10)


however if you compile this instead:
Code:
format PE GUI 5.01    
then at address 0x000000C8 it produces: 0x05,0x00,0x01,0x00 (it means dw 5 dw 1)

this is because fasm treats "5.1" as "5.10", I guess that makes sense but then why it doesn't want to support a 5.001? According to:
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format (look at "MinorSubsystemVersion")
https://upload.wikimedia.org/wikipedia/commons/1/1b/Portable_Executable_32_bit_Structure_in_SVG_fixed.svg
it allows it to go up to a 65535, but if there is a limit in fasm then why not limit it to a 1 digit instead? Why 2? Not sure why Tomasz chose 2 digits.


Last edited by a on 10 Apr 2025, 15:07; edited 3 times in total
Post 10 Apr 2025, 15:00
View user's profile Send private message Reply with quote
a



Joined: 10 Apr 2025
Posts: 17
Location: Ukraine
a 10 Apr 2025, 15:03
Mat-Quasar wrote:
Thanks a for your detailed analysis, now I know FASM treats version 5.1 as 5.10. No wonder.

I have deleted the original comment, However I posted a new one
Post 10 Apr 2025, 15:03
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8406
Location: Kraków, Poland
Tomasz Grysztar 10 Apr 2025, 15:06
The two-digit interpretation was chosen to make "3.1" be converted into 3 and 10 values, as this is how it was done at the time of NT 3.1 and initial releases of PE support (and there was also 3.11, encoded as you'd expect). This backfired when "5.1" followed a different convention, but fasm stuck to the old one.
Post 10 Apr 2025, 15:06
View user's profile Send private message Visit poster's website Reply with quote
a



Joined: 10 Apr 2025
Posts: 17
Location: Ukraine
a 10 Apr 2025, 15:25
Tomasz Grysztar wrote:
The two-digit interpretation was chosen to make "3.1" be converted into 3 and 10 values, as this is how it was done at the time of NT 3.1 and initial releases of PE support (and there was also 3.11, encoded as you'd expect). This backfired when "5.1" followed a different convention, but fasm stuck to the old one.

I see, I know that fasm is 26 years old (1999) so it does makes sense. Although it would be nice to specify this info in the https://flatassembler.net/docs.php?article=win32
or in the https://flatassembler.net/docs.php?article=manual
Post 10 Apr 2025, 15:25
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1151
Location: Russia
macomics 10 Apr 2025, 15:33
Considering that new exe files are no longer created under Windows 3.1, then it may be worth changing the default interpretation mode to that adopted in XP.

For Windows 3.1, you can do a separate processing so that the record does not change.
Post 10 Apr 2025, 15:33
View user's profile Send private message Reply with quote
a



Joined: 10 Apr 2025
Posts: 17
Location: Ukraine
a 10 Apr 2025, 15:57
macomics wrote:
For Windows 3.1, you can do a separate processing so that the record does not change.

So if it is "format PE GUI 3.1" then it will be dw 3 dw 10 ?
And if it is "format PE GUI 5.1" then it will be dw 5 dw 1 ?
That sounds like a nice idea, it will work just like in the official convention.
It can also treat "5.1" and "5.01" as the same number in order to let the older assembler files to compile in new fasm versions
Post 10 Apr 2025, 15:57
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8406
Location: Kraków, Poland
Tomasz Grysztar 10 Apr 2025, 17:30
fasm 2 already uses the new convention for all cases, it's where I'm more inclined to make slight compatibility changes like this one.
Post 10 Apr 2025, 17:30
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.