From: Herbert Kleebauer on
hutch-- wrote:
>
> The plot thickens, for Herbert to get his ERRRMAYYYYZING 922 byte exe
> file he created a dos memory image COM file with a compressed version
> of a 1024 byte PE file with a message box and a dos stub with,
>
> "Nice to meet somebody who is still using DOS,
> but his program requires Win32."
>
> written in it. It is written to disk with the name ___.com

Do you know a better way to make a program with less than
1024 bytes which displays a message box in Win32? With
your assembly programming skills and the "sheer brutal
power of MASM" this shouldn't be problem. And as I already
said, I'm always keen on learning something new.
From: Herbert Kleebauer on
Jim Carlock wrote:

Currently I only have Win98, XP has to wait till Monday.
But you can ignore anything before gver.exe (the purpose
of the batch and gver.com is only to generate the Win32
binary gver.exe and the content of this binary file
is independent from the used OS version).

And to run gver.exe you don't even need cmd.exe (delete
cmd.exe) and you still can start gver.exe by double click
in Windows Explorer.

Here the output you should get according the Windows
documentation:

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
For DOS:

dwPlatformId=ffffffff


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
FOR Windows:


dwMajorVersion
--------------
Major version number of the operating system. This member can be one of
the following values.

Operating System Meaning
Windows 95 4
Windows 98 4
Windows Me 4
Windows NT 3.51 3
Windows NT 4.0 4
Windows 2000 5
Windows XP 5
Windows Server 2003 family 5

dwMinorVersion
--------------
Minor version number of the operating system. This member can be one of
the following values.

Operating System Meaning
Windows 95 0
Windows 98 10
Windows Me 90
Windows NT 3.51 51
Windows NT 4.0 0
Windows 2000 0
Windows XP 1
Windows Server 2003 family 2


dwBuildNumber
-------------
Build number of the operating system.

Windows Me/98/95: The low-order word contains the build number of the
operating system. The high-order word contains the major
and minor version numbers.

dwPlatformId
------------
Operating system platform. This member can be one of the following values.

Value Meaning
0 VER_PLATFORM_WIN32s Win32s on Windows 3.1.
1 VER_PLATFORM_WIN32_WINDOWS Windows 95, Windows 98, or Windows Me.
2 VER_PLATFORM_WIN32_NT Windows NT, Windows 2000, Windows XP,
or Windows Server 2003 family.

szCSDVersion
------------
Pointer to a null-terminated string, such as "Service Pack 3", that
indicates the latest Service Pack installed on the system. If no Service
Pack has been installed, the string is empty.

Windows Me/98/95: Pointer to a null-terminated string that indicates
additional version information. For example, " C"
indicates Windows 95 OSR2 and " A" indicates Windows 98
Second Edition.


:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::



> On XP32 I ended up with (Win95 Compatibility Mode):
>
> C:\tmp\klee>gver.exe
> set ver_major=00000004
> set ver_minor=00000000
> set ver_build=000003b6
> set ver_platf=00000001
> set ver_csd=
>
> Windows XP (Windows NT 4 Service Pack 5 Compatibility Mode)
> reports:
>
> C:\tmp\klee>gver.exe
> set ver_major=00000004
> set ver_minor=00000000
> set ver_build=00000565
> set ver_platf=00000002
> set ver_csd=Service Pack 5
>
> And for a regular cmd.exe (no compatibility selected) prompt:
>
> C:\tmp\klee>gver.exe
> set ver_major=00000005
> set ver_minor=00000001
> set ver_build=00000a28
> set ver_platf=00000002
> set ver_csd=Service Pack 2
>
> Also, note that if you right-click upon cmd.exe in the
> %systemroot%\system32 folder, then click on the Compatibility
> tab, you should see that you can not change the Compatibility
> mode there. That's why I copied it to another folder. I just
> checked to see if the name change is required, but it's not,
> so I changed the name to make things here easier to understand.
>
> Hope this more accurately describes everything.
>
> --
> Jim Carlock
> North Carolina Swimming Pool Builders
> http://www.aquaticcreationsnc.com/
From: Herbert Kleebauer on
Frank Kotler wrote:
> "gver.exe" produces the expected results. Well:
>
> set ver_major=00000007
> set ver_minor=0000000a
> set ver_build=000000fd
> set ver_platf=ffffffff
> set ver_csd=
>
> Strictly speaking, this doesn't match the output of "ver":
>
> FreeCom version 0.82 pl 3 XMS_Swap [Mar 06 2004 10:49:37]
>
> But it wasn't promised to run under dosemu.

The DOS part of the code uses int21 ah=30 to get the
OS version:

dosmain:move.w s6,-(sp)
move.w (sp)+,s0
move.b #$30,m0
trap #$21
move.b m0,r1
move.l #_text+20,r6
bsr.w bin2hex
move.b r1,r0
bsr.w bin2hex
move.b m3,r0
bsr.w bin2hex

move.w #_text,r1
move.b #$09,m0
trap #$21
move.w #$4c01,r0
trap #$21

_text: dc.b "set ver_major=00000000",$0d,$0a
dc.b "set ver_minor=00000000",$0d,$0a
dc.b "set ver_build=00000000",$0d,$0a
dc.b "set ver_platf=ffffffff",$0d,$0a
dc.b "set ver_csd= ",'$'

bin2hex:move.w #2,r2
lsl.w #8,r0
_10: eor.b r0,r0
rol.w #4,r0
and.b #$0f,r0
add.b #$90,r0
adj_dec_add r0
addc.b #$40,r0
adj_dec_add r0
or.b #$20,r0
move.b r0,(r6.w)
inc.w r6
dbf.w r2,_10
addq.w #22,r6
rts.w
From: Dirk Wolfgang Glomp on
Am Fri, 07 Sep 2007 04:32:53 -0700 schrieb hutch--:

>> No, I posted pure binary code. Sometime it happens that
>> a binary byte is displayed as a 'a' or 'Z'.
>
> Your talking nonsense, ascii does not display binary, it displays
> ascii.

Your newsreader displays only asciis?

Dirk
From: Phil Carmody on
Dirk Wolfgang Glomp <dirk(a)freecrac.dyndns.org> writes:
> Am Fri, 07 Sep 2007 04:32:53 -0700 schrieb hutch--:
>
> >> No, I posted pure binary code. Sometime it happens that
> >> a binary byte is displayed as a 'a' or 'Z'.
> >
> > Your talking nonsense, ascii does not display binary, it displays
> > ascii.

Did this guy ever go to school and learn how to use English?
I wonder what he thinks ASCII code 97 or 90 will be displayed as.

> Your newsreader displays only asciis?

It matters not, if all the binary values in your post are printable
ASCII values.

Phil
--
Dear aunt, let's set so double the killer delete select all.
-- Microsoft voice recognition live demonstration