Please help

This is a discussion on Please help within the C++ Programming forums, part of the General Programming Boards category; Please help I'm trying to write a program to open a games .exe file but I dont know what function ...

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

    Question Please help

    Please help
    I'm trying to write a program to open a games .exe file but I dont know what function or how to do it thanks in advance.

  2. #2
    Chief Code Coloniser!
    Join Date
    Apr 2005
    Posts
    121
    I'm not quite sure what you mean, but i'll take a guess and say that you're looking to read/write to/from an exe file.

    Rather than go through the steps involved in doing this using C++ code, I'd first like to clarify your reasons for doing it. Are you looking to write a patcher? Or do you think that "opening the file" is going to give you some form of human readable information that you can then "adjust" to make changes to that exe?

    If you mean the former, then you need to do some reading on file I/O (of which there are numerous tutorials on the internet, and probably on this site too!), using binary mode instead of text mode.

    If you mean the latter, then you're going to be disappointed, because EXE files aren't really human readable (unless of course you're an ASM coder ).

    Hope that helps.

  3. #3
    Registered User
    Join Date
    Apr 2005
    Posts
    3
    No all im trying to do is open the .exe file so i can play the game. A sort of shortcut type of thing to open the game

  4. #4
    Chief Code Coloniser!
    Join Date
    Apr 2005
    Posts
    121
    Right, so you mean you want to run the exe. Try to be a little more specific next time you post

    The dirtiest way is to use system(), but there are other options such as ShellExecute() that are part of the Windows API.

    Good luck.

  5. #5
    Registered User
    Join Date
    Apr 2005
    Posts
    3
    ok thanx very much

Popular pages Recent additions subscribe to a feed

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