exe file

This is a discussion on exe file within the C++ Programming forums, part of the General Programming Boards category; i have a client file of a game server and when u open it (in notepad for example) u see ...

  1. #1
    Registered User
    Join Date
    Apr 2005
    Posts
    98

    exe file

    i have a client file of a game server and when u open it (in notepad for example) u see all those weird characters, but you can also see some normal text.
    why this specific text is shown proparly? and how can i do that some text of my c++ file will be displayed like that? (i want it so it can be edited easily in the .exe file)

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    > why this specific text is shown proparly?
    Code:
    int main ( ) {
      printf( "hello world\n" );
    }
    Compile it and look through the executable. Sooner or later, you'll find a "hello world" string.

    If you want text to be easily changed, then put it in a text file.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    98
    > If you want text to be easily changed, then put it in a text file.
    yes, but i have my own reasons why i want to edit it in the .exe file. =P
    is there another way? beause in the client file i have you can edit the ip you want it to connect when u simply open it with notepad, so it means the ip u edit isn't an output, it's a variable...

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    Well find another way then.
    Because to edit an exe file, you need a hex editor, and considerably more skill than the average user.

    > beause in the client file i have you can edit the ip you want it to connect when u simply open it
    Any half decent program allows command line parameters, use those.
    myprog.exe -s some.ip.address.here
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Apr 2005
    Posts
    98
    sorry, didn't understand what u just said =/
    what is this line? (myprog.exe -s some.ip.address.here)
    i type it in the command window? and what does it?

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    That's an example of what any self-respecting program should allow you to do.
    In this case, the "-s" meant "use this server".


    Make various changes to the operation of the program.
    Say for example
    notepad.exe myfile.txt

    > (i want it so it can be edited easily in the .exe file)
    Whatever this program is (whether you created it or not), find out / make it accept command line parameters.
    You're free to determine what "-letter" options you want.

    Console commands use "/" as an option separator - just type "dir /?" at a console prompt to get the idea.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    Registered User
    Join Date
    Apr 2005
    Posts
    98
    oh i see... thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sequential file program
    By needhelpbad in forum C Programming
    Replies: 80
    Last Post: 06-08-2008, 01:04 PM
  2. To find the memory leaks without using any tools
    By asadullah in forum C Programming
    Replies: 2
    Last Post: 05-12-2008, 07:54 AM
  3. Dikumud
    By maxorator in forum C++ Programming
    Replies: 1
    Last Post: 10-01-2005, 06:39 AM
  4. Batch file programming
    By year2038bug in forum Tech Board
    Replies: 10
    Last Post: 09-05-2005, 03:30 PM
  5. Unknown Memory Leak in Init() Function
    By CodeHacker in forum Windows Programming
    Replies: 3
    Last Post: 07-09-2004, 09:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21