Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant archive_postsperpage - assumed 'archive_postsperpage' (this will throw an Error in a future version of PHP) in ..../archive/index.php on line 456
Pixel Reading By Wesker [Archive] - Forums

PDA

View Full Version : Pixel Reading By Wesker



Wesker
01-25-2013, 04:42 PM
What is PixelReading ?

Well in general its a control on a windows API that will let you know the colors displayed on your screen in real time (explaining further later on)

Any books about it ?

I did find a crappy book about it, and the source has like a bazillion errors, ill scan and post some of the images here, and it would be cool if @Jo3 or @Darkstar uploads the images to the FTP so they won't disappear eventually like most of the images on forums
Book :
Bot Programing : Intelligent Automation for Windows Applications and Games

Before Programming anything prepare yourself with any good online game and fast food, you will find out that programming might be annoying and frustrating, but once we get it working its orgasmic !

http://img543.imageshack.us/img543/2811/dsci0002t.jpg
http://img818.imageshack.us/img818/2681/dsci0003yv.jpg

Yeah baby :D


My Tutorial : I will explain the basics with sample codes, so every1 can understand how to do it, my interest is not to do everything for you, the samples might be buggy, useless for experienced programmers a tutorial should show you how to reach "x" point, not to give the "x", the samples and codes "most" of these have no use, or they are completely stupid, just for educational purposes, the English as in "language" displayed in this tutorial is vague and may not be near the proper use of it, and i dont care <3, thats why im giving code samples.....

Wesker
01-25-2013, 04:43 PM
So if you read the pages of the book, previously posted you will find an attachment to a process, in this case "pinball" this will focus the window and it will only read the application you're targeting, again in this case "pinball" , keep in mind every application or program has a grid of pixels from 0,0 that is the top left corner to the end of it the bottom right corner.


So what we know at the moment is that everything you see on the screen is made of pixels (http://en.wikipedia.org/wiki/Pixel ) and what we need to make a bot pixel based, is make a grid that the players can use, we will start by making a simple program a non-finish screen recorder if you will....

I'm using VB 2012.net ..

Way to lazy to post all the images so here it goes :

You will need :
Picture Box
3 Buttons
2 Timers
clipboard


copypaste cats :


Public Class Form1

Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Timer1.Stop()
Timer2.Stop()
Clipboard.Clear()
End Sub

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Timer2.Stop()
Timer1.Start()
End Sub

Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Timer1.Stop()
Timer2.Start()
End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
SendKeys.Send("{PRTSC}")
Dim clip As IDataObject = Clipboard.GetDataObject()
If clip.GetDataPresent(GetType(System.Drawing.Bitmap) ) Then
Dim ScreenCapture As Bitmap = CType(clip.GetData(GetType(System.Drawing.Bitmap)) , Bitmap)
PictureBox1.BackgroundImage() = ScreenCapture
End If
End Sub

Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
SendKeys.Send("%{PRTSC}")
Dim clip As IDataObject = Clipboard.GetDataObject()
If clip.GetDataPresent(GetType(System.Drawing.Bitmap) ) Then
Dim ScreenCapture As Bitmap = CType(clip.GetData(GetType(System.Drawing.Bitmap)) , Bitmap)
PictureBox1.BackgroundImage() = ScreenCapture
End If
End Sub

End Class

What the program will do : starts a timer, that will press printscreen or alt+printscreen, so you can tell the difference between that action, but then if your going to do this action in a game might slow you down and it may cause a bug if the game uses alt keys, or in a browser if the bot is checking the screen with this method and u press F$ to "heal or something" the computer might do alt+f4+printscreen there for your closing the window, and ur character dies, congratz o/

http://tpforums.org/forum/attachment.php?attachmentid=72&d=1361173628
http://www.2shared.com/file/PgiIp8Bd/Pixelbot1-proyect.html

So after this demo we got 2 kind of screens :

http://img690.imageshack.us/img690/9189/pixelbot1.gif

1.- Full screen
2.- Window screen

This task got us to the point where ill explain that this images are made of pixels (captain obvious, but some people don't know this, for them are just images) well let me break it down to you, all the images are made of pixels, when you buy a monitor it has measures such as 800x600, 1024 × 768 and so on, or you might notice some wallpapers have a length 1024 × 768, 1600x1200 and so on, this are the amount of pixels in the screen that forms a rectangle

http://img706.imageshack.us/img706/7209/47805142.png

Where 0,0 is x=0 y=0 and then x=380 y=221 how the computer works, and loads bits its from point a to b (0,0 to 380,221) so it draws a line like it was a loading bar, if you ever worked with flash, or seen a loading bar in a youtube video, webpage or videogame

http://www.math.wsu.edu/~kentler/Fall97_101/Images/3_1/xy_coors.gif

Wesker
01-25-2013, 04:43 PM
Getting Sizes


Ingredients :
PictureBox
2 Labels
Timer

Presing Alt+PRTSC or just PRTSC will set up your clipboard and it will read whatever your pressing or getting the bitmap at

copypaste cats :


Public Class Form1

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim clip As IDataObject = Clipboard.GetDataObject()
If clip.GetDataPresent(GetType(System.Drawing.Bitmap) ) Then
Dim ScreenCapture As Bitmap = CType(clip.GetData(GetType(System.Drawing.Bitmap)) , Bitmap)
Dim widthWindow As Integer = ScreenCapture.Width()
Dim heightWindow As Integer = ScreenCapture.Height()
PictureBox1.BackgroundImage() = ScreenCapture
Label1.Text = "X ->" & widthWindow
Label2.Text = "Y ->" & heightWindow
End If
End Sub
End Class


Download Exe Here (http://tpforums.org/forum/attachment.php?attachmentid=72&d=1361173628)
http://www.2shared.com/file/X0uEG4Qh/PixelBot2_exe.html

http://img94.imageshack.us/img94/7708/pixelbot2.gif

So we ask the clipboard to send us the width and height again for all the smart people on the forum, there are many ways you might get the same result, this is a tutorial, that a newbie should understand we are not getting into the API just yet...... Might seem very slow but believe me if you can't handle this simple stuff, you won't be able to do shit with the gui, ill explain further later on every single piece of the code........

Resizing Windows/Apps/Crap

Well it's a good idea to resize our applications or whatever we will work with, so it remains the same size while we use it, and eventually do it every time we open an application, when you're working with pixels, we will need the same amount of pixels on the screen, to get the proper "response" of our program/tool/(w/e)


Ingredients :

3 TextBox
1 Button


CopyCats


Public Class Form1

Public Declare Function SetWindowsPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As IntPtr, ByVal hWndInsertAfter As IntPtr, ByVal x As Integer, ByVal y As IntPtr, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
Public Const NOMOVE = &H2

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Button1.Enabled = False
Dim xName As String = TextBox1.Text
Dim xnum As Integer = TextBox2.Text
Dim ynum As Integer = TextBox3.Text
Dim pe() As Process = Process.GetProcessesByName(xName)
Dim n As Integer
If pe.Length > 0 Then
For n = 0 To pe.Length - 1
SetWindowsPos(pe(n).MainWindowHandle, IntPtr.Zero, 0, 0, xnum, ynum, NOMOVE)
Next
End If
Button1.Enabled = True
End Sub
End Class

Download Exe Here (http://tpforums.org/forum/attachment.php?attachmentid=71&d=1361173497)

It will search the recent window or procces name thats recent and resize it, it wont move its actual position




<due to the new tier in league of legends im going to postpone the tutorial a few days

Wesker
01-25-2013, 04:44 PM
Making a Bot For Windows Pinball

Pinball : http://mspinball.weebly.com/download.html

Wesker
01-25-2013, 04:44 PM
issues and problems u might get

Wesker
01-25-2013, 04:45 PM
i dont know but i might need another kkkkk, ill post this in a week or so, just making the space for it

Wesker
01-25-2013, 04:54 PM
exe's here

Xleniz
01-26-2013, 03:15 AM
Kkkkkkk, i gave up pixel reading already, it had to loop 100000000000000 positions.
No good idea.

Fire Onix1
01-26-2013, 01:54 PM
Wesker, I can't execute your "PinballBot.exe", corrupted file at winXP 32

Blequi
01-26-2013, 03:07 PM
What the program will do : starts a timer, that will press printscreen or alt+printscreen, so you can tell the difference between that action, but then if your going to do this action in a game might slow you down and it may cause a bug if the game uses alt keys, or in a browser if the bot is checking the screen with this method and u press F$ to "heal or something" the computer might do alt+f4+printscreen there for your closing the window, and ur character dies, congratz o/


Why timers to hit print screen and get image data from clipboard? It's really intrusive in the sense that will disturb the user alot.

I never tried a pixel reading approach for any task, but I for sure I won't hit print screen + clipboard for nothing. Instead, I would transfer data between 2 graphics objects BitBlt'ing them.

ex:


Bitmap GetRectangleAt(IntPtr mainWindowHandle, int x, int y, int width, int height)
{
Bitmap bmp = new Bitmap(width, height);

using (Graphics bmpGraphics = Graphics.FromImage(bmp))
using (Graphics windowGraphics = Graphics.FromHwnd(mainWindowHandle))
{
IntPtr bmpHDC = bmpGraphics.GetHdc();
IntPtr windowHDC = windowGraphics.GetHdc();

BitBlt(bmpHDC, 0, 0, width, height, windowHDC, x, y, SRCCOPY);

bmpGraphics.ReleaseHdc(bmpHDC);
windowGraphics.ReleaseHdc(windowHDC);
}

return bmp;
}


This function I've posted does the job. Receives the main window handle of a window and a rectangle where the copy needs to be made and returns a bitmap of this rectangle. This way you don't mess clipboard and don't need set the window to foreground.

Wesker
01-26-2013, 05:07 PM
Why timers to hit print screen and get image data from clipboard? It's really intrusive in the sense that will disturb the user alot.

I never tried a pixel reading approach for any task, but I for sure I won't hit print screen + clipboard for nothing. Instead, I would transfer data between 2 graphics objects BitBlt'ing them.

ex:


Bitmap GetRectangleAt(IntPtr mainWindowHandle, int x, int y, int width, int height)
{
Bitmap bmp = new Bitmap(width, height);

using (Graphics bmpGraphics = Graphics.FromImage(bmp))
using (Graphics windowGraphics = Graphics.FromHwnd(mainWindowHandle))
{
IntPtr bmpHDC = bmpGraphics.GetHdc();
IntPtr windowHDC = windowGraphics.GetHdc();

BitBlt(bmpHDC, 0, 0, width, height, windowHDC, x, y, SRCCOPY);

bmpGraphics.ReleaseHdc(bmpHDC);
windowGraphics.ReleaseHdc(windowHDC);
}

return bmp;
}


This function I've posted does the job. Receives the main window handle of a window and a rectangle where the copy needs to be made and returns a bitmap of this rectangle. This way you don't mess clipboard and don't need set the window to foreground.

brosky im starting from principals, not the code u will use, if u read my first post u should do it with the api, but well bouth work ok :/ this tutorial might take some time i play 1 day i write other :D

+ i said that hitting alt+prtsc could close ur program window if u press F4 :/ , just relax and chill, btw the code of the book is not complete yet..... im not an octopus....

Wesker
01-26-2013, 05:09 PM
Wesker, I can't execute your "PinballBot.exe", corrupted file at winXP 32

ur probably doing it wrong, or you wrote wrong the name of the process list.....



Kkkkkkk, i gave up pixel reading already, it had to loop 100000000000000 positions.
No good idea.

why whould you loop so many ?

Diego
01-28-2013, 09:09 AM
I worked on a project like this long time ago, using hard-coded pixels however it does the job, implemented anti paralyze, auto haster, auto healer, auto ssa, mana bar, etc, etc

Healing example: http://code.google.com/p/safebot-for-tibia/source/browse/%20safebot-for-tibia/Player/Player.cs
Client Class: http://code.google.com/p/safebot-for-tibia/source/browse/%20safebot-for-tibia/Client/Client.cs

You just need to get the X, Y Coords on the red spot using paint or whatever, works on any Tibia Version available.

http://www.tibiaviewer.com/images/sbhowto.png

Wesker
01-28-2013, 04:47 PM
if u do it by %'2 its easier to just cast the spell, you read the hole bar < > if theres no brown haste, if theres white dwarf ring, and so on, but ill check it later kuz, im palying league LOL

DarkstaR
01-29-2013, 07:28 PM
Why timers to hit print screen and get image data from clipboard? It's really intrusive in the sense that will disturb the user alot.

I never tried a pixel reading approach for any task, but I for sure I won't hit print screen + clipboard for nothing. Instead, I would transfer data between 2 graphics objects BitBlt'ing them.

ex:


Bitmap GetRectangleAt(IntPtr mainWindowHandle, int x, int y, int width, int height)
{
Bitmap bmp = new Bitmap(width, height);

using (Graphics bmpGraphics = Graphics.FromImage(bmp))
using (Graphics windowGraphics = Graphics.FromHwnd(mainWindowHandle))
{
IntPtr bmpHDC = bmpGraphics.GetHdc();
IntPtr windowHDC = windowGraphics.GetHdc();

BitBlt(bmpHDC, 0, 0, width, height, windowHDC, x, y, SRCCOPY);

bmpGraphics.ReleaseHdc(bmpHDC);
windowGraphics.ReleaseHdc(windowHDC);
}

return bmp;
}


This function I've posted does the job. Receives the main window handle of a window and a rectangle where the copy needs to be made and returns a bitmap of this rectangle. This way you don't mess clipboard and don't need set the window to foreground.

This is all correct. The proper, and fast, way to do it is this. All the super high-level .NET crap (and the grabbing from clipboard, lol) just wraps this and slows it down a few orders of magnitude - Working with the raw device context is much faster. Furthermore, copying from the HDC allow you so get the image of windows that are in the background (not minimized, though).

Wesker
01-30-2013, 01:41 AM
This is all correct. The proper, and fast, way to do it is this. All the super high-level .NET crap (and the grabbing from clipboard, lol) just wraps this and slows it down a few orders of magnitude - Working with the raw device context is much faster. Furthermore, copying from the HDC allow you so get the image of windows that are in the background (not minimized, though).

with great powarssss becomes a great responsability to read the note of the first god damm post.............


+ who said the code was wrong ?

Wesker
02-06-2013, 04:38 PM
today posting the rest of the book pages, problems with my uploads so tomorrow

uploading links in a few hrs

Wesker
02-11-2013, 06:37 PM
pages update it, if theres a page missing post the number and ill upload it as soon as i can, cheers :)

XtrmJash
02-14-2013, 07:44 PM
http://img12.imageshack.us/img12/9007/scan0039ka.jpg

Hmph?

Wesker
02-14-2013, 11:57 PM
http://img12.imageshack.us/img12/9007/scan0039ka.jpg

Hmph?

¬¬ did u report the image for copyright ¬¬

bs i should see that coming up, so ill include the tutorial i might even type all that shitt

uploading to the forum :D, back in a few mins

XtrmJash
02-15-2013, 06:59 PM
¬¬ did u report the image for copyright ¬¬

bs i should see that coming up, so ill include the tutorial i might even type all that shitt

uploading to the forum :D, back in a few mins

Nope, I've been watching this thread since you uploaded to imgshack, cause I know they look for scanned images of books, and multiple uploads of similar images, so your images will have looked suspicious. It was just a matter of time until they decided they'd had enough... As I've said before, what you're doing here is illegal. The purpose of this forum is completely legit, as is most if not all of the code here.

Wesker
02-15-2013, 07:13 PM
Nope, I've been watching this thread since you uploaded to imgshack, cause I know they look for scanned images of books, and multiple uploads of similar images, so your images will have looked suspicious. It was just a matter of time until they decided they'd had enough... As I've said before, what you're doing here is illegal. The purpose of this forum is completely legit, as is most if not all of the code here.

Based on the copyright scanning pages of any book is not illegal, re-selling the content without the author's permission its illegal, making a bot it illegal, your reading the costumers memory, you're reading the program memory, you're injecting into the developers code, you're sending packages and reading them, not to mention making a bot is a form of piracy, but then again i live in Mexico changes are ,im not gonna be screwed over anything

http://en.wikipedia.org/wiki/Copyright#Fair_use_and_fair_dealing

Copyright does not prohibit all copying or replication. In the United States, the fair use doctrine, codified by the Copyright Act of 1976 as 17 U.S.C. Section 107, permits some copying and distribution without permission of the copyright holder or payment to same. The statute does not clearly define fair use, but instead gives four non-exclusive factors to consider in a fair use analysis. Those factors are:
the purpose and character of your use
the nature of the copyrighted work
what amount and proportion of the whole work was taken, and
the effect of the use upon the potential market for or value of the copyrighted work.[31]


Later acts amended US Copyright law so that for certain purposes making 10 copies or more is construed to be commercial, but there is no general rule permitting such copying. Indeed making one complete copy of a work, or in many cases using a portion of it, for commercial purposes will not be considered fair use. The Digital Millennium Copyright Act prohibits the manufacture, importation, or distribution of devices whose intended use, or only significant commercial use, is to bypass an access or copy control put in place by a copyright owner.[16] An appellate court has held that fair use is not a defense to engaging in such distribution.


+ the book is from the year 2010, which is outdated and therefor since i only made 1 copy and a part 1 of the whole work in the book is not illegal at all, + in Mexico you can make several copies as long as you don't profit from them


Companies take them down because they could hold the entire copy of a book in several users, and then they will be pressed charges or just taken like the megaupload BS

XtrmJash
02-15-2013, 08:25 PM
Based on the copyright scanning pages of any book is not illegal, re-selling the content without the author's permission its illegal, making a bot it illegal, your reading the costumers memory, you're reading the program memory, you're injecting into the developers code, you're sending packages and reading them, not to mention making a bot is a form of piracy, but then again i live in Mexico changes are ,im not gonna be screwed over anything

http://en.wikipedia.org/wiki/Copyright#Fair_use_and_fair_dealing

Copyright does not prohibit all copying or replication. In the United States, the fair use doctrine, codified by the Copyright Act of 1976 as 17 U.S.C. Section 107, permits some copying and distribution without permission of the copyright holder or payment to same. The statute does not clearly define fair use, but instead gives four non-exclusive factors to consider in a fair use analysis. Those factors are:
the purpose and character of your use
the nature of the copyrighted work
what amount and proportion of the whole work was taken, and
the effect of the use upon the potential market for or value of the copyrighted work.[31]


Later acts amended US Copyright law so that for certain purposes making 10 copies or more is construed to be commercial, but there is no general rule permitting such copying. Indeed making one complete copy of a work, or in many cases using a portion of it, for commercial purposes will not be considered fair use. The Digital Millennium Copyright Act prohibits the manufacture, importation, or distribution of devices whose intended use, or only significant commercial use, is to bypass an access or copy control put in place by a copyright owner.[16] An appellate court has held that fair use is not a defense to engaging in such distribution.


+ the book is from the year 2010, which is outdated and therefor since i only made 1 copy and a part 1 of the whole work in the book is not illegal at all, + in Mexico you can make several copies as long as you don't profit from them


Companies take them down because they could hold the entire copy of a book in several users, and then they will be pressed charges or just taken like the megaupload BS

Let me reiterate some of those "laws" and expand upon them:

Indeed making one complete copy of a work, or in many cases using a portion of it, for commercial purposes will not be considered fair use.

the effect of the use upon the potential market for or value of the copyrighted work.

These two laws basically state that making a copy of a portion of work for commercial purposes will not be considered fair use, though as stated, the deciding court would consider:


the purpose and character of your use
the nature of the copyrighted work
what amount and proportion of the whole work was taken, and
the effect of the use upon the potential market for or value of the copyrighted work.


The purpose and nature is basically to give away free information which would otherwise be paid for.
The nature of the copyrighted work is a tutorial, and publishing sections of it in such quantities will be considered a minor violation of this.
The amount and proportion is reasonably large, the exemptions are in place primarily for students who are using quotations from material in their studies, so they do not encounter legal issues.
The effect upon the potential market is that instead of encouraging people to buy the book, you're encouraging them to read your pirated copy.

What you're doing is illegal, in a quite obvious way. The laws stated on wikipedia are very vague. It will state in either the first few pages or the last few pages of the book that it is against the law to publish copies of the contents of the book without obtaining permission from the publisher, and that is what the court will primarily consider. A lot of material which is designed for reference allows the publishing of some content, for the purpose of advertising and gaining an advantage over customers as they become enticed into a purchase contract. What you're doing is encouraging the opposite.

Consider Amazon when you're talking about this, they publish a few pages from each book they sell, with the intention that readers can find out if the book is what they are looking for. There is a good reason why they publish the pages that they do, that reason being that those pages specify or expose the contents of the book, so that people can see if it contains something which they are looking for (e.g they can see if it is a tutorial, reference, or novel, etc. They can also see if it is about the specific subject which they are researching, and in many cases they will be able to see some information like, in programming, languages used, which sometimes aren't specified on the cover.)

Wesker
02-15-2013, 09:11 PM
not ilegal kuz like i said the book has bugs, and i will show how to improve and so on, etc bla bla, information that is not relevant adm sinc eim vb.net 2012 but seriusly who gives a shitt lol, even if its illegal i dont care