Thread: Get the program's address

  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

    Get the program's address

    How can I get the programs address (C++, Win32, GUI)?
    For example if the program is in "C:\Program Files\booga.exe", how can I get the same string inside that program?

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,218
    Are you looking for GetCommandLine()?
    If you understand what you're doing, you're not learning anything.

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Thanks...
    That will do it.

  4. #4
    Madly in anger with you
    Join Date
    Nov 2005
    Posts
    211
    Code:
    char lpFilename[MAX_PATH];
    GetModuleFileName(NULL, lpFilename, sizeof lpFilename);

    Intel Core 2 Quad Q6600 @ 2.40 GHz
    3072 MB PC2-5300 DDR2
    2 x 320 GB SATA (640 GB)
    NVIDIA GeForce 8400GS 256 MB PCI-E

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linux raw socket programming
    By cnb in forum Networking/Device Communication
    Replies: 17
    Last Post: 11-08-2010, 08:56 AM
  2. Replies: 15
    Last Post: 09-30-2008, 02:12 AM
  3. I am very new . . . :(
    By Eternalglory47 in forum C++ Programming
    Replies: 6
    Last Post: 09-05-2008, 11:29 AM
  4. Replies: 10
    Last Post: 09-04-2008, 01:27 PM
  5. MSN Vital Information
    By iain in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 09-22-2001, 08:55 PM