• Advertisement
Sign in to follow this  

Reading a window or screen

This topic is 2907 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I'm interested in writing a poker odds calculator for myself. The ones that are out there are very expensive. Some of the existing calculators can automatically detect which cards you have in your hand. Than is, they can somehow read the internet poker window. How do you go about doing this? I've absolutely no idea how it's done and I can't seem to find anything on the web to help me. Cheers. T.

Share this post


Link to post
Share on other sites
Advertisement
I am by no means as experienced as many other people who may answer this but here is my .2c

Those programs probably find the memory space the window lives in and then uses some kind of memory scanner to find the variables of the cards. That is very complicated stuff (in my opinion) and you'd need quiet a bit of experience in c/c++ to be able to do that.

[Update] Google "Cheat Engine" for an example of a memory scanner. I'm unsure if it is open source although.

Share this post


Link to post
Share on other sites
Quote:
Original post by mrobbins
I am by no means as experienced as many other people who may answer this but here is my .2c

Those programs probably find the memory space the window lives in and then uses some kind of memory scanner to find the variables of the cards. That is very complicated stuff (in my opinion) and you'd need quiet a bit of experience in c/c++ to be able to do that.

[Update] Google "Cheat Engine" for an example of a memory scanner. I'm unsure if it is open source although.


Nah, memory is pretty simple to work with once you have the rough idea down. Cheat Engine is open source, though the majority of it is written in Delphi. Ultimately, if you want to read / write memory, Read/WriteProcessMemory() calls will become your best friends.


If you want to read the actual screen (as in read pixels of it) you can create DIB section. GetDC with NULL for a parameter will get a DC for the whole screen. You can just blit your DC into a memory DC and you'll have access to the entirety of it in a nice byte array.

Share this post


Link to post
Share on other sites
I once did that. Just capture the window output and use simple image recognition techniques to identify cards, $ etc :)

Share this post


Link to post
Share on other sites
There is a guy here:http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot

who built a poker bot that can see what the cards are. Although his code is for a bot a lot of it is valid for what you are interested in doing. Infact he does not grab things from the screen but injects code into the dll. He does however discuss a method for "screen scraping" whereby you can deduce what cards are on the screen by checking the colour of certain pixels at certain locations.

I am pretty sure everything you need is at the link i pointed to.

I am also interested in building the same software as you which is why I stumbled on that guys site.

Kind Regards
David

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement