Running a text file as an EXE file

  • Thread starter Thread starter wylbur37
  • Start date Start date
It will be treated as a com or bat file. No MZ then it can't be an exe
file. The actual tests for com/bat are not public info.

"ZM" used to/may still be allowed as well.
 
You clearly have no idea what an EXE is. The observation you have made from
the run dialog and the command prompt is one of the computer reaslising that
it's not a valid EXE and then just doing nothing. Doing what you did CANNOT
have any affect on Windows at all in any shape or form because, despite the
EXE extension you gave the file, it's not a program. Never will be either
becuase you cannot make an EXE that way.
 
That's not an oddity at all. Windows recognises a file, not by its
extension, but by its contents. The extension is there to help pass the file
to the right program that needs it, but that doesn't mean the extension
matches the contents.

Here's a tip for those wanting to send an EXE via Messenger (because it
won't allow EXEs): change the extension to .txt, send it, and then the
recipient can change it back to .exe. Messenger isn't interested in the
contents of the file, and only recognises the file by its extension.
Messenger will allow a TXT file without any problems.
 
Incorrect. If the contents of the file IS a valid program, it's irrelevant
what the extension is.
 
XP does NOT have a DOS box. It does not have DOS at all. It is a command
prompt. Very different.
 
To help aleviate your curiosity, I can tell you that your "EXE" file was not
a valid program, and therefor your observation was of Windows doing nothing.
You cannot make a program that way.

BTW: What was it you were trying to do? Or was it just an experiment?
 
To be honest, this is the most bizzarre thing I've ever heard anyone trying
to do in Windows. And what is more, to carry out a detailed analysis of the
resulting behaviour (hard drive being accessed, command prompt window
appearing briefly) which is no more than: "nothing happened".

Is this why you purchased a computer? Do you do anything else with it? I
hope so.
 
Lindsay said:
XP does NOT have a DOS box. It does not have DOS at all. It is a command
prompt. Very different.

But if one knows DOS commands, they have most of cmd whipped.
 
Lindsay said:
You clearly have no idea what an EXE is. The observation you have made from
the run dialog and the command prompt is one of the computer reaslising that
it's not a valid EXE and then just doing nothing. Doing what you did CANNOT
have any affect on Windows at all in any shape or form because, despite the
EXE extension you gave the file, it's not a program. Never will be either
becuase you cannot make an EXE that way.

Save the text below in a file with the name demo.exe and execute it.
(Be sure to not insert trailing spaces at least in the first two
lines). Don't worry, it isn't harmful, just displays a Windows
Messagebox. An other test you can do (in W2k/XP) is, write a text
file demo.txt with the single word MYTH (in upper case letters) and
enter at the command prompt:
start demo.txt
Then replace the word MYTH by MZTH and again type
start demo.txt


Bj@jzh`0X-`/PPPPPPa(DE(DM(DO(Dh(Ls(Lu(LX(LeZRR]EEEUYRX2Dx=
0DxFP,0Xx.t0P,=XtGsB4o@$?PIyU WwX0GwUY Wv;ovBX2Gv0ExGIuht6
p{sAayHJ`LAKHUqd}{Bn~A=_kBxawEw?FtAS}@cyqBxQ?sqZBxyIhxHM`L
PNL}sq?w`G?zIH`LOKyHsaLAMoWK`wAmbAAqbAAubAJ?wQAizAAayA`L]K
@s1WAayAq`LRyBvNAxE?pDt@jj?zEynAtAyO?pEojijyEybAtAzO?pEojj
jyEyVAtA{ONkjJ@Gu]r?p{EjimhkbT_jbDdgsTJn_Sta_SnssT1cmPm11D
lnbT???????A?[?Ck??O????FEB?LQPO@_YDCF@?~~F{@_EC?DQO_aQ_1M
F??MyALHsq@w`G`LKLbhMTs_dPl_nPsddTnr_SadlTxcnTgv_Sh_nPr_rP
khsTt_kPmhrTC_fPkRNDaILO_stDrhgTqo_SqfnT_l`DpdqTqhtT_rdDmh
VTmqr?cIL?DO?S@KECO?@OudxH_FQo@N??D@J?A?K?QHQ_OFO?P_F?OE?@
EAF?EQC?FQC?AF_?ADQ?OCQ?POE?OEO?ODQ?OIQ?{EO?ORQCQOE?smYOsw
dTPcFKAFO?QAF?E_L?~Q_BQO_@OCDGWDQOHQO?FOK@{EOOHQO?EOm@QOG?
RTTSrQDDcmqOEkkDQO_@dLFS`rrTAdfT@wnTDJ?SDMQTqrK@kcmSCEk`FQ
O?hwDTqOsTdbnT?rrDg?iP?OmQ}g?c??OC~?ipO?T?i??PT~?K?OGOhL?S
lhmT_ltDmhVTkdcT_?`@ll_?@_lOdrrTkalT_qdDqtOT`_dP_cmDlhRTdk
oTll_?__l?Q~QKQ~[K0x
 
David said:
0AF7:0100 222E2E5C AND CH,[5C2E]
0AF7:0104 2E CS:
0AF7:0105 2E CS:
0AF7:0106 5C POP SP
0AF7:0107 64 DB 64
0AF7:0108 69 DB 69
0AF7:0109 736B JNB 0176
0AF7:010B 775C JA 0169
0AF7:010D 7573 JNZ 0182
0AF7:010F 725C JB 016D
0AF7:0111 62 DB 62
0AF7:0112 69 DB 69
0AF7:0113 6E DB 6E
0AF7:0114 5C POP SP
0AF7:0115 7065 JO 017C
0AF7:0117 726C JB 0185
0AF7:0119 207732 AND [BX+32],DH
0AF7:011C 63 DB 63
0AF7:011D 312E706C XOR [6C70],BP

It appears as a valid program, at least until the first jump.

If you capture the text into a file, be sure to leave out the
quotes at each end. According to your listing, you seem to have
included the first quote (x'22').
(Check afterwards to make sure the file is exactly 32 bytes long).
 
John said:
In both cases it caused the printer to spit out an identical page of
garbage and then hang the DOS box.

At the time I ran it, my printer wasn't connected.

Also, the DOS box didn't hang afterwards.

When you say "an identical page of garbage",
do you mean the garbage that resulted from running the program in the
Command Prompt was exactly the same as the garbage from running it
in the Windows Start-Run textbox?
 
Sjouke said:
Well, if only that were true....
In a command window,ececute
copy /b notepad.exe a.wav
(or any other program exe you have).
then type a.wav.
Surprise!!!!!
windows ignores the extension does not
try to run it as a wav file but starts
a.wav as an exe,voila!! notepad starts.
So dont think that you can rely on the
extention to aviod crapware/malware.

In Windows 98, extension dictates operation. Typing a.wav at the prompt only
gives the usual bad command or filename message. Also, the start command
sees the extension and attempts to open it with the default .wav player.
 
wylbur37 said:
At the time I ran it, my printer wasn't connected.

That in itself could be system dependant. Behaviour may be different for LPT
or USB printer connected.
Also, the DOS box didn't hang afterwards.

That's part of the random behaivour that occurs from this exercise.
When you say "an identical page of garbage",
do you mean the garbage that resulted from running the program in the
Command Prompt was exactly the same as the garbage from running it
in the Windows Start-Run textbox?

Why does it matter? We have seen it unassembled but no explanation offered
for what it actually does. Basically, when run, it jumps outside the program
to execute whatever random code happens to be in another part of memory.
There likely would have been a different result the second time if he had
rebooted or ran several other programs first.
 
Todd Vargo said:
In Windows 98, extension dictates operation. Typing a.wav at the prompt
only
gives the usual bad command or filename message. Also, the start command
sees the extension and attempts to open it with the default .wav player.

Not universally true. 4DOS.COM has been an EXE file for ages and it runs as
an EXE in all MS OS' I've tried.

Any extension outside the internal knowledge of the command processor will
be an issue in the Windows world because the OS then depends on the file's
association to process it.

In XP et samo, try typing "assoc .wav"(enter) in a command prompt window
first to see what the association is in your system, then "assoc
..wav=exefile"(enter) to change the association and then "a.wav"(enter) to
see what happens when the command interpreter executes the test file.

Similarly, this test should be doable in DOS with a command processor that
allows file extension associations, such as 4DOS.

Martin
 
wylbur37 said:
At the time I ran it, my printer wasn't connected.

Also, the DOS box didn't hang afterwards.

When you say "an identical page of garbage",
do you mean the garbage that resulted from running the program in the
Command Prompt was exactly the same as the garbage from running it
in the Windows Start-Run textbox?

Yes the printouts and the computer's behavior were identical when run in
both a DOS box or from start/run. By a DOS box I meant XP's emulation of
DOS as someone else was kind enough to point out.

The point is your text file could also represent random op codes as
David Candy's listing showed. The result of running the file as an
executable did one thing on my system but would probably do something
different (or nothing) on another. Someone else offered a text file that
was structured in such a way that it could double as an executable. That
one would likely run the same way on anyone's Windows system because it
was deliberately designed to do so. As far as Windows or any operating
system is concerned both text characters and op codes and their
arguments are just numbers. If that was the point of your posting you
now know that it can be done but not by random selection of just any
text file.

John
 
Lindsay said:
To be honest, this is the most bizzarre thing I've ever heard anyone trying
to do in Windows. And what is more, to carry out a detailed analysis of the
resulting behaviour (hard drive being accessed, command prompt window
appearing briefly) which is no more than: "nothing happened".

Is this why you purchased a computer? Do you do anything else with it? I
hope so.


Learning starts with asking questions. Windows isn't the point of the
discussion it just happens to be the vehicle. This is a DOS group and I
for one give him credit for taking notice of the difference.

John
 
John said:
Learning starts with asking questions. Windows isn't the point of the
discussion it just happens to be the vehicle. This is a DOS group and I
for one give him credit for taking notice of the difference.

FWIW, *THIS* is crossposted to both DOS and Windows groups.
 
It is still a legal program. Though it keeps setting the stack pointer to 0, which means any pushing or function/interupt calls will start corrupting the interupt table. Interupt 0 is the address that handles devide by 0 errors and will be the first to get overwritten with a random address.

0B3F:0100 2E CS:
0B3F:0101 2E CS:
0B3F:0102 5C POP SP
0B3F:0103 2E CS:
0B3F:0104 2E CS:
0B3F:0105 5C POP SP
0B3F:0106 64 DB 64
0B3F:0107 69 DB 69
0B3F:0108 736B JNB 0175
0B3F:010A 775C JA 0168
0B3F:010C 7573 JNZ 0181
0B3F:010E 725C JB 016C
0B3F:0110 62 DB 62
0B3F:0111 69 DB 69
0B3F:0112 6E DB 6E
0B3F:0113 5C POP SP
0B3F:0114 7065 JO 017B
0B3F:0116 726C JB 0184
0B3F:0118 207732 AND [BX+32],DH
0B3F:011B 63 DB 63
0B3F:011C 312E706C XOR [6C70],BP
-
--
--------------------------------------------------------------------------------------------------
How to lose a war in Iraq
http://webdiary.com.au/cms/?q=node/1335#comment-48641
=================================================
wylbur37 said:
David said:
0AF7:0100 222E2E5C AND CH,[5C2E]
0AF7:0104 2E CS:
0AF7:0105 2E CS:
0AF7:0106 5C POP SP
0AF7:0107 64 DB 64
0AF7:0108 69 DB 69
0AF7:0109 736B JNB 0176
0AF7:010B 775C JA 0169
0AF7:010D 7573 JNZ 0182
0AF7:010F 725C JB 016D
0AF7:0111 62 DB 62
0AF7:0112 69 DB 69
0AF7:0113 6E DB 6E
0AF7:0114 5C POP SP
0AF7:0115 7065 JO 017C
0AF7:0117 726C JB 0185
0AF7:0119 207732 AND [BX+32],DH
0AF7:011C 63 DB 63
0AF7:011D 312E706C XOR [6C70],BP

It appears as a valid program, at least until the first jump.

If you capture the text into a file, be sure to leave out the
quotes at each end. According to your listing, you seem to have
included the first quote (x'22').
(Check afterwards to make sure the file is exactly 32 bytes long).
 
It is only a windows question despite the text file being a dos com program. The question is what does NT do with Com files.

Note prior to 2000/XP all dos programs ran in the OS/2 sub system as OS/2 runs dos better than NTVDM.
 
David said:
Anything typed in command.com is executed by cmd.exe.

There is an exception to this if command.com has been used to load a
TSR, in which case all the commands are executed by command.com itself.
This behaviour can be changed for ntvdm by adding the NTCMDPROMPT
command to the config.nt file.

Also, it is possible to make command.com handle all built-in commands
itself in DOS-mode and only allow DOS applications to be run by adding
the DOSONLY command to config.nt.

Just a tip if anyone want to change this behaviour.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

EXE files not running 4
exe files open as text files 5
All .exe files openning in notepad 4
exe , com cant run 1
.exe file with C# 9
Exe files running and using cpu 3
No .exe files will run 3
Cant run exe files 3

Back
Top