Embedded file (C++ and SQL)

This is a discussion on Embedded file (C++ and SQL) within the C++ Programming forums, part of the General Programming Boards category; I have an exe file (my.exe) that needs to be protected from unauthorized users. I want to embed this file ...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    80

    Embedded file (C++ and SQL)

    I have an exe file (my.exe) that needs to be protected from unauthorized users. I want to embed this file within a wrapper file so the user runs the latter instead of the actual executable. When this happens:

    - the user is prompted for username/pass (non-GUI)
    - the combination is compared to the entries within an external sql db
    - if match, then run my.exe, else exit

    I think what gives me difficulty is implementing the sql commands within C++. Is CQL++ useful? I know I may need to install a new lib but which lib is suitable/easy to use? I also don't have a clue on how to embed the executable within the wrapper... I have done plenty of research but I am still in confusion.

    Any help is greatly appreciated.

  2. #2
    Registered User
    Join Date
    Jan 2006
    Location
    Europe/Belgrade
    Posts
    78
    If you use SQL, does it mean that you have some database server? Then you should utilise some C/C++ library for connecting and executing queries on the database server. This library is probably part of the database distribution.

  3. #3
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,593
    If you want an embedded database engine, you might want to check out SQLite. The author provides a proprietary extension for encrypted databases.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  4. #4
    Registered User
    Join Date
    Nov 2005
    Location
    Canada
    Posts
    80
    right, thanks. How would I embed this file anyway? If resource files are what i need to use, then can you give me an example on how to create a .rtc file? I have looked all over the 'net, searching for "c++ resource files" but nothing helpful.
    Last edited by Opel_Corsa; 12-11-2006 at 12:32 AM.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    You do realise that unless you encrypt the embedded exe and obtain a decryption key from an external database server, what you're doing is completely useless, right?
    And even if you encrypt it, it would still be trivial to intercept the decryption key you receive.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

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