Nice little C++ question
Results 1 to 8 of 8

Thread: Nice little C++ question

  1. #1
    Join Date
    Jun 2003

    Question Nice little C++ question

    Hey guys:

    I, being my curious self, am just wondering:
    How is it that a C++ programm can interface with other programs? Is it possible?

    I'll give an example: These dictionary password crackers. Correct me if I'm wrong, they are doing the equivalent of entering random words and letters into the password prompt.... except they type and hit the button a gazillion times.... correct? (I just gave it as an example)

    I'm just interested in knowing what statements are used for that.

    Edit*{More comfortable: Use the word "interact" instead of "interface". BTW: To all (and most) people who know more about programs than me, EMphaSIS on "Correct me if I'm wrong }
    \"I ONLY DRINK THE BLOOD OF MY ENEMIES....and maybe a strawberry yoohoo....and a...Pina Co-la-da!...
    If you like pina coladas....ugh!, gettin\' caught in the rain....ugh!\"

  2. #2
    Senior Member
    Join Date
    Jun 2003
    Hi dude

    I have the following to say

    1. You are missing your point as to what kind of interfacing you want ?
    (a) Interfacing other programs like assembly,perl,...?
    (b) The password crackers example,.....don't agree.

  3. #3

    plz i need help!!

    plz can anyone direct me to an online web-page design class where i could learn web designing.

  4. #4
    Ninja Code Monkey
    Join Date
    Nov 2001
    Washington State
    1,027 has an assortment of online classes in all kinds of topics. Not very expensive at that.

    As for the c++ question, it depends on what os you're running and how you'd like to go about it. In windows you may have your c++ prog talk to others via COM, or you may use the windows api functions to find a specific window on the screen and enter text into it, or possibly the program itself exposes an interface that you can talk to. There are probably other methods as well.

    I'm not sure how it works for unix/linux and the other operating dev experience on those is very limited.
    "When I get a little money I buy books; and if any is left I buy food and clothes." - Erasmus
    "There is no programming language, no matter how structured, that will prevent programmers from writing bad programs." - L. Flon
    "Mischief my ass, you are an unethical moron." - chsh
    Blog of X

  5. #5
    Join Date
    Jul 2002
    Correct me if I'm wrong, they are doing the equivalent of entering random words and letters into the password prompt
    I'll preface this by saying that I know little about c++ programming, so what I have to say will be somewhat general, rather than specifically related to c++.
    When you said that dictionary password crackers do the equivalent of actually entering the words, you were correct, but I believe it is only simulated. For example, password files in *nix use hash algorithms like md5 or des to hide the actual passwords. Since it is a one way algorithm (there is no way to reverse it to get the plaintext from the ciphertext) the way to authenticate user's passwords is to hash the one he supplies and compare the result with the one stored in the file.
    A dictionary attack on this system would use the publicly available encryption algorithms, integrated into a program that reads sequential passwords from a dictionary file, and after hashing them, compares them to known passwords.

    As for actually interacting with other programs, all I know about are pipe in *nix or > in dos to redirect output.

    Hope this helps
    Darwin\'s rollin\' over in his coffin, The fittest are surviving much lest often,
    Now everything seems to be reversing, And it\'s worsening!
    --nofx, American Errorist

  6. #6
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Beverwijk Netherlands
    On what OS and Compiler (collection) are you gonna wanna interface with a program..

    On MS VC++ I start external programs with parameters all the time..
    On Linux GCC it's just as easy.. and Google should help you along just fine..

    perhaps add gcc or microsoft or borland to your google query..
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  7. #7
    Senior Member
    Join Date
    Jul 2002
    If I read his post correctly, I *think* what he meant is to mimic (in C++) what usually expect script (in *nix) does. He did give an example of password crackers.

    If that's the case, it depends to how the other program accepts input.

    - If it accepts input via keyboard, then you need to set focus to the other program and simulate keystrokes.
    - If it accepts input via parameters/arguments, then like the_Jinx said, call that external program with parameters.
    -If it accepts input via standard input, then like a)sna said, use pipe to redirect output from your program to the other program.
    - Etc etc...

    Hope this helps.

    Peace always,
    Always listen to experts. They\'ll tell you what can\'t be done and why. Then go and do it. -- Robert Heinlein
    I\'m basically a very lazy person who likes to get credit for things other people actually do. -- Linus Torvalds

  8. #8
    Senior Member tampabay420's Avatar
    Join Date
    Aug 2002
    Are you talking about API? You can make API calls to the Kernel, that can manipulate data in other forms/apps/windows/etc…
    yeah, I\'m gonna need that by friday...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts