#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10

    Python Interaction


    hey I was wondering if it was possible to make a python program that interacts with another such as MSN Messenger, Mozilla FireFox or any already created program. if so what would be the best way to view the programming code of the already created program.
  2. #2
  3. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    Do you mean how would you be able to create a program to either emulate a program such as one's you noted, or to view its code? Well, you can create a program that emulates an internet program by learning how to packet log. In this case since you would be dealing with large softwares, one being created by the worldest largest software company, you would also have to find ways in decrypting the application, assuming that the program is encrypted in the first place. You would then have to learn how to disassemble applications and how to read the assembly language syntax and convert the code to another language, Python in this case. There is no way to "view" the code of any application other than by disassembling it. Unless you have its source code. Is FireFox open source? Again, to create a program like what you mentioned, packet logging and if needed, disassembling would be the best way to go.
  4. #3
  5. Caress me down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Location
    Pennsylvania
    Posts
    289
    Rep Power
    511
    just for example... if i wanted to write a program that would open up say... AOL instint messager. then it would type my username and password in for me and sign me on... i would have to do everything you named up there?
    so you think you can tell heaven from hell
  6. #4
  7. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    Why would you want to open up the program? Then you would need the SendKeys module and some kind of macro module to control mouse movements and key strokes. The way Rc2001 described it, it sounded like he wanted something that controlled the program internally. Maybe he meant externally?

    Off-topic: What does Rc stand for?
  8. #5
  9. Caress me down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2005
    Location
    Pennsylvania
    Posts
    289
    Rep Power
    511
    Originally Posted by †Yegg†
    Why would you want to open up the program? Then you would need the SendKeys module and some kind of macro module to control mouse movements and key strokes. The way Rc2001 described it, it sounded like he wanted something that controlled the program internally. Maybe he meant externally?

    Off-topic: What does Rc stand for?
    my question has nothing to do with what RC had said. i was just woundering how someone could do what i asked.,
    so you think you can tell heaven from hell
  10. #6
  11. Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Dec 2004
    Location
    Meriden, Connecticut
    Posts
    1,797
    Rep Power
    155
    That's also where my response was going. Towards your question.

    "The way Rc2001 described it, it sounded like he wanted something that controlled the program internally. Maybe he meant externally?"
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    35
    if so what would be the best way to view the programming code of the already created program.
    If it's open-source, then download it.

    If it isn't, you can't, bluntly.

    (Or at least, you pretty much can't unless you're incredibly rich, incredibly important, have forever to work on it, or are the government of a large country).

    just for example... if i wanted to write a program that would open up say... AOL instint messager. then it would type my username and password in for me and sign me on... i would have to do everything you named up there?
    If the program is Windows based, and helpful, it will expose itself for COM control. Microsoft Office does this, Internet Explorer does, Media Player does, iTunes does and many other things do.

    Including MSN Messenger:
    http://www.aksel.com/whitepapers/messenger.htm

    I don't think AIM can be controlled like this though - at least, I can't see any helpful looking Google results.

    So the other big method... start the program with the usual array of progam starting methods - the commands module or os.popen, etc.

    Control it with difficulty - probably using the Win32 API to search for a window with the correct title-bar text for AIM, enumerate its text boxes, find the two for username and passwords, set their text, find the button, click on it.

    A lot of a pain, but not too much code...

    See:
    http://www.brunningonline.net/simon/...es/000659.html
    Last edited by sfb; September 5th, 2005 at 06:18 PM.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2005
    Posts
    85
    Rep Power
    10
    ty for the post maybe i wasnt clear but when i meant interact i was thinking more of a plug-in feature...like with MSN Messenger sum1 made a add on that allows a person to leave away messeges n have dynamic sentences that said the users name, let say the code in the addon to make the user name appear was %username%

    then the user could make a sentece

    "hello %username%, i am gone to the store"
    or
    "%username% makes me laugh benches%

    but im not tryin to make a program like this its jus an example n is it possible to make something this complex in python alone

    if all else fails the example about the aol sign-in program is similar to my "interaction" example

    sorry for being unclear the 1st time

IMN logo majestic logo threadwatch logo seochat tools logo