XP ignores file extensions on executables?

Discussion in 'Computer Support' started by Tester, Feb 3, 2007.

  1. Tester

    Tester Guest

    So in other words, if you ever send out malware on purpose (as opposed
    to having malware hijack your system to spread itself) you should use
    a nice innocuous extension like txt or jpg and Windows will still
    treat the file as an executables.

    I am using Windows XPSP2 and the Cygwin.com version of GCC generating
    a Win32 console program. It seems to work the same way with a DOS EXE
    program renamed to something else.

    It doesn't work with .com files presumably because they have no MZ
    signature at the beginning of the file. If you call a .com file a.txt
    and try to open it, notepad will come up.


    C:\temp>type a.c
    #include <stdio.h>
    int main()
    {
    printf("Hello, world.\n");
    return 0;
    }

    C:\temp>gcc a.c

    C:\temp>ren a.exe a.txt

    C:\temp>a.txt
    Hello, world.

    C:\temp>

    --
    Posted via a free Usenet account from http://www.teranews.com
     
    Tester, Feb 3, 2007
    #1
    1. Advertising

  2. Tester

    Guest

    Tester <> wrote:

    >So in other words, if you ever send out malware on purpose (as opposed
    >to having malware hijack your system to spread itself) you should use
    >a nice innocuous extension like txt or jpg and Windows will still
    >treat the file as an executables.


    No you'll get an error, you send one as a .SCR :)

    Windows reads the extension from the registry, and runs what it says
    to.

    >I am using Windows XPSP2 and the Cygwin.com version of GCC generating
    >a Win32 console program. It seems to work the same way with a DOS EXE
    >program renamed to something else.


    Not sure about Cygwin, got it installed just never played with it. But
    some Dos programs would work more from the header than the extension.
    Wav files come to mind. abc.wav named abc.txt would open sound
    blasters wav player.

    >It doesn't work with .com files presumably because they have no MZ
    >signature at the beginning of the file. If you call a .com file a.txt
    >and try to open it, notepad will come up.
    >
    >
    >C:\temp>type a.c
    >#include <stdio.h>
    >int main()
    >{
    >printf("Hello, world.\n");
    >return 0;
    >}
    >
    >C:\temp>gcc a.c
    >
    >C:\temp>ren a.exe a.txt
    >
    >C:\temp>a.txt
    >Hello, world.
    >
    >C:\temp>


    Windows default program for .txt is notepad, strange this should of
    happened - and no matter it's faults it will display any text in an
    executable file.
    --
    Holiday
    http://youtube.com/watch?v=39qc_6DYjso
     
    , Feb 3, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Watchman

    Mozilla Firefox ignores GetRight.

    Watchman, Apr 8, 2004, in forum: Firefox
    Replies:
    1
    Views:
    2,435
    Caffeine Junkie
    Apr 8, 2004
  2. default
    Replies:
    5
    Views:
    477
    Yandos
    Nov 11, 2005
  3. Ultraman Aries

    VC6 Compiler ignores Array indexing?

    Ultraman Aries, Jun 4, 2004, in forum: MCSD
    Replies:
    2
    Views:
    668
    =?Utf-8?B?SSBMb3ZlIEMrKw==?=
    Jun 5, 2004
  4. Norm

    Unknown Executables

    Norm, Feb 1, 2004, in forum: Computer Support
    Replies:
    6
    Views:
    407
    °Mike°
    Feb 1, 2004
  5. Dima
    Replies:
    8
    Views:
    7,816
Loading...

Share This Page