CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2008
    Posts
    3

    Let's make the complex.... Simple....

    Hello,

    Let me say, I've spent the last 2-3 hours going through CodeGuru fourms. I have searched and read many articals (Which is why I am creating a new one, because this based off of many others). Basically, I am looking for the simple way to hook onto another process running on my computer. The closest I have seen to what I want is the poker bot someone was attempting to read the console.

    I am sort of doing the same thing, as I said close. Basically, I just need something that hooks onto another process, and uses intercepts the DrawText. (I already know GetWindowText() won't work with the program I am using). Many posts conclude with "I have fixed the issue, or found a solution." but never figured to post the answer, so many of the questions lead to a wall for me. I've spent much time looking at examples, but they all seem to complex. I don't normally write in C++. I have done much in C# and Java and now 3 years into my Computer Science major, so I am not new to programming.

    I do not mind reading more, I enjoy reading articals, as long as they are not too complex as I am a beginner on the subject. I appreciate the time you took to read this, and I hope we can get a nice easy tutorial going for the new comers to this catagory.

    P.S. If you have time to explain your code or use comments, when people read this, we could eliminate hundreds of "whats the purpose" questions.

    Thank you again,

    Ken

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Let's make the complex.... Simple....

    This is a fairly sensitive topic as the potential for abuse (spyware, virus, etc) is significant. As such there are certain aspects which would be in violation of the AUP (Acceptable Use Policy) of these forums.

    It is NOT your intentions which are questioned...it is the mis-use that could facilitate others with ill intent.

    If you can explain EXACTLY (not generally) what you are trying to accomplish, then some here might be able to provide information.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Nov 2008
    Posts
    3

    Re: Let's make the complex.... Simple....

    CPU,

    My regards. I did not mean to mis-lead anyone. Sure, i'll explain my intentions. What I want to do is sort of like the poker bots that people have create fourms for (including that 6 page one on API hooking). But, I don't want to do what people have said. I am not looking for a calculator of odds, but rather I want to store players playing Sit N Go (Like SharkScope) on a much much smaller scale. Basically, I want to parse who got 1st, 2nd and 3rd and ill store them in MySQL. This is for a personal option. Not a commerical based idea.

    Now, people claim 99% of functions to read the screen don't work. But, if I use just API Hooking and get the DrawText before it even gets to the program, I should be able to read all the text I ever wanted. Which is what I plan to try to accomplish.

    Sorry for mis-leading. I hope this is ok on the AUP, and is clear.

    Thanks,

    Ken

  4. #4
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Let's make the complex.... Simple....

    Ken...

    Lets assume someone posts a way for you to intercept the call....

    ...what would stop someone ELSE from READING the post, and intercepting calls when someone is running QuickBooks or some other important application.....

    THAT is the issue with this topic!!!!
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  5. #5
    Join Date
    Nov 2008
    Posts
    3

    Re: Let's make the complex.... Simple....

    So simply, this site is not allowed to post any code regarding the build of API Hooking?

  6. #6
    Join Date
    Nov 2007
    Posts
    613

    Re: Let's make the complex.... Simple....

    Such techiques are widely documented by Microsoft. As long as Microsoft is willing to share the information with the public, I think it's ok to use them.

    As about your problem, I can't see any way to intercept DrawText, it's just a function, not a message. You could get the whole graphic content of the window as a bitmap using dll injection and window subclassing to interfere with the WM_PAINT messages. But you'll get a bitmap not a text.

    If the text you're interrested in is from the internet, there is a simple solution, don't use a browser, make your own application to request the web page. When you have the html text, scan it to locate the text you're interrested in.

    It may not work if the text is from an ActiveX control. Obtaining a text from an ActiveX control is virtually impossible due to the variety of the controls. Actually they can be used for the copy protection of the text.

  7. #7
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Let's make the complex.... Simple....

    .....intercept DrawText, it's just a function, not a message.
    And that is the EXACT reason for my post. The information on dealing with messages across process boundaries is very public, as is the hooking into the system event chains.

    Modifying a process to change its actual code (intercepting a function call), is a completely different subject. This aspect is used much more for "nefarious" reasons than "legitimate" ones.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured