Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Design and Architecture
  4. making a new file extension

making a new file extension

Scheduled Pinned Locked Moved Design and Architecture
7 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moonshaddow
    wrote on last edited by
    #1

    hey, i am trying to make a new file extension, i have looked on the internet and cant find and thing. this is what I'm trying to do. when the user clicks on the .hnh it executes the exe in side of it, along side of the exe is a text file and i am aiming for the exe to write records in the text file inside of the .hnh, if someone could help or point me in the right direction that would be great. also i was not sure where to post this if there is a better place please tell me, thanks

    If at first you don't succeed Redefine success J.Hardy

    R 1 Reply Last reply
    0
    • M moonshaddow

      hey, i am trying to make a new file extension, i have looked on the internet and cant find and thing. this is what I'm trying to do. when the user clicks on the .hnh it executes the exe in side of it, along side of the exe is a text file and i am aiming for the exe to write records in the text file inside of the .hnh, if someone could help or point me in the right direction that would be great. also i was not sure where to post this if there is a better place please tell me, thanks

      If at first you don't succeed Redefine success J.Hardy

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      Huh? You want to nest a file inside a file? Why would you want to hide an exe inside another file type, unless you want a user to execute it without knowing it's executable? I can't imagine any reason for this that isn't a crime. Why not store the executable as an exe file, and its data file as txt? You wouldn't be thinking of writing something malicious would you? If so, this would be a really good time to go somewhere else. If not, please clarify.

      "A Journey of a Thousand Rest Stops Begins with a Single Movement"

      M 1 Reply Last reply
      0
      • R Roger Wright

        Huh? You want to nest a file inside a file? Why would you want to hide an exe inside another file type, unless you want a user to execute it without knowing it's executable? I can't imagine any reason for this that isn't a crime. Why not store the executable as an exe file, and its data file as txt? You wouldn't be thinking of writing something malicious would you? If so, this would be a really good time to go somewhere else. If not, please clarify.

        "A Journey of a Thousand Rest Stops Begins with a Single Movement"

        M Offline
        M Offline
        moonshaddow
        wrote on last edited by
        #3

        the point of it was so the people who use the .hnh dose not have to copy 7 files, just 1 .hnh if that make more sence

        If at first you don't succeed Redefine success J.Hardy

        modified on Tuesday, April 21, 2009 10:05 PM

        D 1 Reply Last reply
        0
        • M moonshaddow

          the point of it was so the people who use the .hnh dose not have to copy 7 files, just 1 .hnh if that make more sence

          If at first you don't succeed Redefine success J.Hardy

          modified on Tuesday, April 21, 2009 10:05 PM

          D Offline
          D Offline
          dybs
          wrote on last edited by
          #4

          Can you package the files together in an installer, and have the user install the program? That way all the need to copy is setup.exe, run it once, and then access the program from the start menu or application menu, or desktop shortcut, or whatever. Dybs

          M 1 Reply Last reply
          0
          • D dybs

            Can you package the files together in an installer, and have the user install the program? That way all the need to copy is setup.exe, run it once, and then access the program from the start menu or application menu, or desktop shortcut, or whatever. Dybs

            M Offline
            M Offline
            moonshaddow
            wrote on last edited by
            #5

            i would like to avoid the installer if possible, i would like them to be able to copy the .hnh file from computer to computer without installing it

            If at first you don't succeed Redefine success J.Hardy

            J 1 Reply Last reply
            0
            • M moonshaddow

              i would like to avoid the installer if possible, i would like them to be able to copy the .hnh file from computer to computer without installing it

              If at first you don't succeed Redefine success J.Hardy

              J Offline
              J Offline
              jmussetter
              wrote on last edited by
              #6

              I don't think you can do that, as far as I recall is only .EXE and .COM files can be executable in Windows/DOS (going all the way back to the beginning of time). I have seen something similar done that is the opposite of what you're describing. Where-in you have an .exe "program" that is labeled as such, and it stores or has extra data written to it after then end of the executable code. So basically the file structure on the drive looks something like this: "[exe header][exe executable code]||[extra data]".exe This way, the OS can run the file, as the header, entry point of program, and all executable code addresses are retained, while the data that needs to be accessed is appended to the end. It would be up to the program to track where the end of the code was for instance: Const FixedProgramLength = (an integer that represents how many bytes the exe code is) Const StartOfDataAddr = FixedProgramLength + 1 The only other way I could think of to make a .hnh file executable would be to make an axillary service that would be running prior (at startup) and somehow initiate the executable code stored within. (Similar in concept to Java .jar files, in that without the Java Runtime library installed and running the OS doesn't know that it's a program of any kind). However, I would venture that the first solution would be the easiest... And besides, as mentioned, there's no good reason that a program should have a different extension that isn't unethecal

              M 1 Reply Last reply
              0
              • J jmussetter

                I don't think you can do that, as far as I recall is only .EXE and .COM files can be executable in Windows/DOS (going all the way back to the beginning of time). I have seen something similar done that is the opposite of what you're describing. Where-in you have an .exe "program" that is labeled as such, and it stores or has extra data written to it after then end of the executable code. So basically the file structure on the drive looks something like this: "[exe header][exe executable code]||[extra data]".exe This way, the OS can run the file, as the header, entry point of program, and all executable code addresses are retained, while the data that needs to be accessed is appended to the end. It would be up to the program to track where the end of the code was for instance: Const FixedProgramLength = (an integer that represents how many bytes the exe code is) Const StartOfDataAddr = FixedProgramLength + 1 The only other way I could think of to make a .hnh file executable would be to make an axillary service that would be running prior (at startup) and somehow initiate the executable code stored within. (Similar in concept to Java .jar files, in that without the Java Runtime library installed and running the OS doesn't know that it's a program of any kind). However, I would venture that the first solution would be the easiest... And besides, as mentioned, there's no good reason that a program should have a different extension that isn't unethecal

                M Offline
                M Offline
                moonshaddow
                wrote on last edited by
                #7

                that sounds great! could you point me to some articles on how to do that please (first solution)

                If at first you don't succeed Redefine success J.Hardy

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups