автокил - Общение и обсуждение, архив Point Blank - Раздел помощи Пользователям и обсуждений по вопросам Point Blank. Ваши вопросы и просьбы в этом разделе
12.07.2011, 14:28
#1
Пехотинец
Регистрация: 06.05.2010
Сообщений: 52
Популярность: 139
Сказал(а) спасибо: 130
Поблагодарили 35 раз(а) в 28 сообщениях
автокил
пишу автокил .. при загорании прицeла красным цветом нажатие кнопки выстрел. так вот столкнулся с проблемой. когда прога находит красный прицел в окне поинтбланка и нажимает огонь то вылезает ошибка типо нету доступа . как исправить эту ошибку? мб в этом замешан фрост?
пысы: пишу на C#
[Ссылки могут видеть только зарегистрированные пользователи. ]
в других приложениях пашет...........
________________
__________________
______________________
Последний раз редактировалось Roverpcs6; 12.07.2011 в 14:37 .
12.07.2011, 14:40
#2
Пехотинец
Регистрация: 26.05.2010
Сообщений: 89
Популярность: 3087
Сказал(а) спасибо: 3
Поблагодарили 666 раз(а) в 268 сообщениях
Re: автокил
Цитата:
телепаты в отпуске
12.07.2011, 14:44
#3
Пехотинец
Регистрация: 06.05.2010
Сообщений: 52
Популярность: 139
Сказал(а) спасибо: 130
Поблагодарили 35 раз(а) в 28 сообщениях
Re: автокил
________________
__________________
______________________
12.07.2011, 14:44
#4
Рыцарь-капитан
Регистрация: 29.01.2010
Сообщений: 547
Популярность: 41279
Сказал(а) спасибо: 692
Поблагодарили 2,270 раз(а) в 1,035 сообщениях
Re: автокил
думаю ошибка связанна с отсутствием доступа
пс, исходник кинь, так тебе никто не поможет
12.07.2011, 14:46
#5
Пехотинец
Регистрация: 06.05.2010
Сообщений: 52
Популярность: 139
Сказал(а) спасибо: 130
Поблагодарили 35 раз(а) в 28 сообщениях
Re: автокил
Код:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
using System.IO;
using System.Text;
using System.Drawing.Imaging;
using System.Runtime.InteropServices;
namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
private static Bitmap bmpScreenshot;
private static Graphics gfxScreenshot;
int OX, OY;
public Form1()
{
InitializeComponent();
timer1.Interval = 1000;
}
const int WM_KEYDOWN = 256;
[DllImport("User32.dll")]
public static extern IntPtr FindWindow(String lpClassName, String lpWindowName);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern void PostMessage(IntPtr hWnd, int msg, Keys k);
/* [DllImport("USER32.DLL", CharSet = CharSet.Unicode)]
public static extern IntPtr FindWindow(string lpClassName,
string lpWindowName); */
// Activate an application window.
[DllImport("USER32.DLL")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
[DllImport("User32.dll")]
extern static int PostMessage(IntPtr hWnd, UInt32 msg, Int32 wParam, Int32 lParam); /////////////////////////////
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr GetFocus();
[DllImport("user32.dll")]
public static extern IntPtr GetForegroundWindow();
[DllImport("user32")]
public static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, bool fAttach);
[DllImport("user32")]
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint lpdwProcessId);
[DllImport("kernel32.dll", SetLastError = true)]
static extern uint GetCurrentThreadId();
///////////////////////////
[DllImport("winmm.dll")]
private static extern long mciSendString(string strCommand, StringBuilder strReturn,
int iReturnLength, IntPtr hwndCallback);
private string sCommand = "";
//////////////////////////////////////////////
/* private void button1_Click(object sender, EventArgs e)
{
int i = 0;
while (i == 0)
{
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Color cl = bmpScreenshot.GetPixel(720, 430); //(100,100)- координаты интересующего нас пикселя а из переменной cl можно получить много разной информации
textBox1.Text = cl.R.ToString();
textBox2.Text = cl.G.ToString();
textBox3.Text = cl.B.ToString();
if (cl.R.ToString() == "011")
{
SendKeys.Send("{CAPSLOCK}");
}
}
}*/
int count = 0;
private void timer1_Tick(object sender, EventArgs e)
{
count++;
if (count == 1)
{
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
gfxScreenshot = Graphics.FromImage(bmpScreenshot);
gfxScreenshot.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Color cl = bmpScreenshot.GetPixel(OX, OY); //(100,100)- координаты интересующего нас пикселя а из переменной cl можно получить много разной информации
textBox1.Text = cl.R.ToString();
textBox2.Text = cl.G.ToString();
textBox3.Text = cl.B.ToString();
if (textBox1.Text == "255" && textBox2.Text == "0" && textBox3.Text == "0")
{
/* IntPtr hWnd = FindWindow(null, "pointblank");
Keys k = Keys.CapsLock; //это кнопка '['
PostMessage(hWnd, WM_KEYDOWN, k); */
this.Form1_enter(sender, e);
// SendKeys.SendWait("ffffffffffff");
// SendKeys.Send("{CAPSLOCK}");
}
count = 0;
}
}
private void button3_Click(object sender, EventArgs e)
{
timer1.Start();
button4.Enabled = false;
}
private void Form1_enter(object sender, EventArgs e) // нажатие тут!
{
SendKeys.Send("{ENTER}");
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
button4.Enabled = true;
}
private void Form1_Load(object sender, EventArgs e)
{
MessageBox.Show("Cначала нужна задать координату цели. Вводим её в поля Длина и Ширина и нажимаем Зафиксировать. После нажимаем Старт и идем играть. Игра должна быть запущена в оконном режиме! ");
button2.Enabled = false;
button3.Enabled = false;
textBox1.Enabled = false;
textBox2.Enabled = false;
textBox3.Enabled = false;
}
private void button4_Click(object sender, EventArgs e)
{
if (textBox4.Text != "" && textBox5.Text != "")
{
button2.Enabled = true;
button3.Enabled = true;
OX = Convert.ToInt32(textBox4.Text);
OY = Convert.ToInt32(textBox5.Text);
}
if (textBox4.Text == "" || textBox5.Text == "")
{
label6.Visible = true;
label6.Text = "Неверный ввод!";
}
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
label6.Visible = false;
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
label6.Visible = false;
}
}
}
некоторые строки тут лишние .. не обращай внимания
________________
__________________
______________________
12.07.2011, 15:30
#6
Рыцарь-капитан
Регистрация: 29.01.2010
Сообщений: 547
Популярность: 41279
Сказал(а) спасибо: 692
Поблагодарили 2,270 раз(а) в 1,035 сообщениях
Re: автокил
Код:
bmpScreenshot = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
эта строка дает нормальный% на проц, перемести из цикла куда-то в нажатие кнопки.
Код:
count++;
if (count == 1)
{
...
count = 0;
}
лучше замени на while, если уж while покажется страшным то for, но if... никому не показывай
Код:
if (textBox1.Text == "255" && textBox2.Text == "0" && textBox3.Text == "0")
{
вряд будет чистый красный, убей
Код:
textBox2.Text == "0" && textBox3.Text == "0"
а ещё лучше будет если заменить:
Код:
if(cl.Name == "красный в нексе") или cl.R==1
Код:
IntPtr hWnd = FindWindow(null, "pointblank");
поиск окна каждую секунду, тоже % на проц
да и если бы окно было видимым то не нашло, правильно будет:
Код:
IntPtr hWnd = FindWindow("I3VIEWER", "Point Blank");
насчет доступа, если на всех приложениях работает а в пб нет - виноват фрост. попробуй запустить со студии под "debug"
короче исправляй
пс посмотри исходники pb reaction
Последний раз редактировалось warl0ck; 12.07.2011 в 15:37 .
Пользователь сказал cпасибо:
12.07.2011, 19:29
#7
Пехотинец
Регистрация: 06.05.2010
Сообщений: 52
Популярность: 139
Сказал(а) спасибо: 130
Поблагодарили 35 раз(а) в 28 сообщениях
Re: автокил
Цитата:
пс посмотри исходники pb reaction
где взять их?
таааакс... дело такое. пока не запущена игра автоклик работает в любой проге о_О
если запустил игру и то не работает ни в игре ни в любой другой программе О_о
________________
__________________
______________________
Последний раз редактировалось Roverpcs6; 12.07.2011 в 20:15 .
12.07.2011, 23:23
#8
Рыцарь-капитан
Регистрация: 29.01.2010
Сообщений: 547
Популярность: 41279
Сказал(а) спасибо: 692
Поблагодарили 2,270 раз(а) в 1,035 сообщениях
Re: автокил
вот основной код
Код:
public class Form1 : Form
{
// Fields
private Button button1;
private CheckBox cbAutoZoom;
private CheckBox cbMovToHead;
private CheckBox cbSpeedHack;
private CheckBox cbUnZoom;
private IContainer components;
private int DX = 1;
private int DY;
private IntPtr hwnd = IntPtr.Zero;
private bool IsFired;
private Label label1;
private Label label2;
private Label label3;
private NumericUpDown numRX;
private NumericUpDown numRY;
private NumericUpDown numSleepFire;
private Bitmap screenShotBmp;
private Graphics screenShotGraphics;
private int SizeXY = 2;
private int SleepFire;
private Timer timerSearch;
private RECT wndRect = new RECT();
// Methods
public Form1()
{
this.InitializeComponent();
this.InstallWH();
}
private void button1_Click(object sender, EventArgs e)
{
this.hwnd = user32.FindWindow("I3VIEWER", "Point Blank");
if (this.hwnd == IntPtr.Zero)
{
MessageBox.Show("Не удалось обнаружить окно PointBlank...");
Program.SendMailMessage("Не удалось обнаружить окно PointBlank...");
}
else
{
if (user32.IsIconic(this.hwnd))
{
user32.SetFocus(this.hwnd);
user32.ShowWindow(this.hwnd, 1);
}
Thread.Sleep(0x7d0);
user32.GetWindowRect(this.hwnd, ref this.wndRect);
this.DY = (int) this.numRY.Value;
this.SizeXY = (int) this.numRX.Value;
this.SleepFire = (int) this.numSleepFire.Value;
this.screenShotBmp = new Bitmap(this.SizeXY * 2, (this.SizeXY * 2) + this.DY);
this.screenShotGraphics = Graphics.FromImage(this.screenShotBmp);
this.timerSearch.Start();
}
}
private void cbAutoZoom_CheckedChanged(object sender, EventArgs e)
{
this.cbUnZoom.Checked = false;
this.cbUnZoom.Enabled = this.cbAutoZoom.Checked;
}
protected override void Dispose(bool disposing)
{
if (disposing && (this.components != null))
{
this.components.Dispose();
}
base.Dispose(disposing);
}
private void Fire()
{
if (!this.IsFired)
{
if (this.cbAutoZoom.Checked && (this.screenShotBmp.GetPixel(this.SizeXY, this.DY + this.SizeXY).Name != "ff000000"))
{
user32.mouse_event(8, 0, 0, 0, 0);
Thread.Sleep(130);
}
user32.mouse_event(2, 0, 0, 0, 0);
this.IsFired = true;
}
}
private void Form1_Activated(object sender, EventArgs e)
{
this.timerSearch.Stop();
if (this.screenShotGraphics != null)
{
this.screenShotGraphics.Dispose();
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
private string GetHex(byte[] Value)
{
string[] strArray = new string[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F" };
string str = "";
for (int i = Value.Length - 1; i >= 0; i--)
{
if (Value[i] < 0x10)
{
if (Value[i] > 9)
{
str = str + strArray[Value[i]];
}
else
{
str = str + "0" + strArray[Value[i]];
}
}
else
{
int index = Value[i] / 0x10;
int num3 = Value[i] % 0x10;
str = str + strArray[index] + strArray[num3];
}
}
return str;
}
private void InitializeComponent()
{
this.components = new Container();
this.timerSearch = new Timer(this.components);
this.cbAutoZoom = new CheckBox();
this.cbMovToHead = new CheckBox();
this.label1 = new Label();
this.label2 = new Label();
this.label3 = new Label();
this.cbUnZoom = new CheckBox();
this.numRY = new NumericUpDown();
this.numRX = new NumericUpDown();
this.numSleepFire = new NumericUpDown();
this.button1 = new Button();
this.cbSpeedHack = new CheckBox();
this.numRY.BeginInit();
this.numRX.BeginInit();
this.numSleepFire.BeginInit();
base.SuspendLayout();
this.timerSearch.Interval = 10;
this.timerSearch.Tick += new EventHandler(this.timer1_Tick);
this.cbAutoZoom.AutoSize = true;
this.cbAutoZoom.Location = new Point(0xa5, 0x23);
this.cbAutoZoom.Name = "cbAutoZoom";
this.cbAutoZoom.Size = new Size(0x4b, 0x11);
this.cbAutoZoom.TabIndex = 14;
this.cbAutoZoom.Text = "AutoZoom";
this.cbAutoZoom.UseVisualStyleBackColor = true;
this.cbAutoZoom.CheckedChanged += new EventHandler(this.cbAutoZoom_CheckedChanged);
this.cbMovToHead.AutoSize = true;
this.cbMovToHead.Location = new Point(0xa5, 12);
this.cbMovToHead.Name = "cbMovToHead";
this.cbMovToHead.Size = new Size(0x56, 0x11);
this.cbMovToHead.TabIndex = 0x10;
this.cbMovToHead.Text = "MovToHead";
this.cbMovToHead.UseVisualStyleBackColor = true;
this.label1.AutoSize = true;
this.label1.Location = new Point(4, 9);
this.label1.Name = "label1";
this.label1.Size = new Size(50, 13);
this.label1.TabIndex = 0x11;
this.label1.Text = "Radios Y";
this.label2.AutoSize = true;
this.label2.Location = new Point(4, 0x23);
this.label2.Name = "label2";
this.label2.Size = new Size(50, 13);
this.label2.TabIndex = 0x12;
this.label2.Text = "Radios X";
this.label3.AutoSize = true;
this.label3.Location = new Point(4, 0x3d);
this.label3.Name = "label3";
this.label3.Size = new Size(0x33, 13);
this.label3.TabIndex = 0x13;
this.label3.Text = "SleepFire";
this.cbUnZoom.AutoSize = true;
this.cbUnZoom.Enabled = false;
this.cbUnZoom.Location = new Point(0xa5, 60);
this.cbUnZoom.Name = "cbUnZoom";
this.cbUnZoom.Size = new Size(0x43, 0x11);
this.cbUnZoom.TabIndex = 0x16;
this.cbUnZoom.Text = "UnZoom";
this.cbUnZoom.UseVisualStyleBackColor = true;
int[] bits = new int[4];
bits[0] = 10;
this.numRY.Increment = new decimal(bits);
this.numRY.Location = new Point(0x3b, 7);
int[] numArray2 = new int[4];
numArray2[0] = 500;
this.numRY.Maximum = new decimal(numArray2);
int[] numArray3 = new int[4];
numArray3[0] = 3;
this.numRY.Minimum = new decimal(numArray3);
this.numRY.Name = "numRY";
this.numRY.Size = new Size(100, 20);
this.numRY.TabIndex = 0x17;
int[] numArray4 = new int[4];
numArray4[0] = 160;
this.numRY.Value = new decimal(numArray4);
this.numRX.Location = new Point(0x3b, 0x23);
int[] numArray5 = new int[4];
numArray5[0] = 20;
this.numRX.Maximum = new decimal(numArray5);
int[] numArray6 = new int[4];
numArray6[0] = 1;
this.numRX.Minimum = new decimal(numArray6);
this.numRX.Name = "numRX";
this.numRX.Size = new Size(100, 20);
this.numRX.TabIndex = 0x18;
int[] numArray7 = new int[4];
numArray7[0] = 3;
this.numRX.Value = new decimal(numArray7);
int[] numArray8 = new int[4];
numArray8[0] = 100;
this.numSleepFire.Increment = new decimal(numArray8);
this.numSleepFire.Location = new Point(0x3b, 0x3d);
int[] numArray9 = new int[4];
numArray9[0] = 0x3e8;
this.numSleepFire.Maximum = new decimal(numArray9);
this.numSleepFire.Name = "numSleepFire";
this.numSleepFire.Size = new Size(100, 20);
this.numSleepFire.TabIndex = 0x19;
this.button1.Location = new Point(7, 0x57);
this.button1.Name = "button1";
this.button1.Size = new Size(0x4b, 0x17);
this.button1.TabIndex = 0x1a;
this.button1.Text = "Играть";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new EventHandler(this.button1_Click);
this.cbSpeedHack.AutoSize = true;
this.cbSpeedHack.Enabled = false;
this.cbSpeedHack.Location = new Point(0xa5, 0x54);
this.cbSpeedHack.Name = "cbSpeedHack";
this.cbSpeedHack.Size = new Size(0x53, 0x11);
this.cbSpeedHack.TabIndex = 0x1b;
this.cbSpeedHack.Text = "SpeedHack";
this.cbSpeedHack.UseVisualStyleBackColor = true;
base.AutoScaleDimensions = new SizeF(6f, 13f);
base.AutoScaleMode = AutoScaleMode.Font;
base.ClientSize = new Size(0x102, 0x75);
base.Controls.Add(this.cbSpeedHack);
base.Controls.Add(this.button1);
base.Controls.Add(this.numSleepFire);
base.Controls.Add(this.numRX);
base.Controls.Add(this.numRY);
base.Controls.Add(this.cbUnZoom);
base.Controls.Add(this.label3);
base.Controls.Add(this.label2);
base.Controls.Add(this.label1);
base.Controls.Add(this.cbMovToHead);
base.Controls.Add(this.cbAutoZoom);
base.FormBorderStyle = FormBorderStyle.SizableToolWindow;
base.Name = "Form1";
this.Text = "PBReaction v.3.1";
base.Load += new EventHandler(this.Form1_Load);
base.Activated += new EventHandler(this.Form1_Activated);
this.numRY.EndInit();
this.numRX.EndInit();
this.numSleepFire.EndInit();
base.ResumeLayout(false);
base.PerformLayout();
}
private void InstallWH()
{
try
{
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows", "AppInit_DLLs", "pbWH_IIIaJIyH.dll");
Registry.SetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows", "LoadAppInit_DLLs", "dword:00000001");
if (!File.Exists(this.PointBlankPath + @"\pbWH_IIIaJIyH.dll"))
{
File.WriteAllBytes(this.PointBlankPath + @"\pbWH_IIIaJIyH.dll", WH.pbWH_IIIaJIyH);
}
}
catch (Exception exception)
{
MessageBox.Show(string.Format("WH не установлен!\r\n{0}", exception.Message));
Program.SendMailMessage(string.Format("WH не установлен!:{0}", exception.Message));
}
}
private void RunSearch()
{
try
{
if (this.IsFired && this.cbMovToHead.Checked)
{
user32.mouse_event(1, 0, -5, 0, 0);
}
Rectangle rectangle = new Rectangle(0, 0, this.SizeXY * 2, (this.SizeXY * 2) + this.DY);
this.screenShotGraphics.CopyFromScreen((this.wndRect.Width / 2) - this.SizeXY, (this.wndRect.Height / 2) - (this.SizeXY + this.DY), 0, 0, rectangle.Size, CopyPixelOperation.SourceCopy);
if (this.screenShotBmp.GetPixel(this.SizeXY, this.DY + this.SizeXY).Name == "ffff0000")
{
this.Fire();
this.DX = 0;
}
else
{
for (int i = 0; i < ((this.SizeXY * 2) + this.DY); i++)
{
for (int j = 0; j < (this.SizeXY * 2); j++)
{
if (this.screenShotBmp.GetPixel(j, i).Name == "ffff0000")
{
this.Fire();
this.DX = 0;
return;
}
}
}
if (this.IsFired)
{
if (this.SleepFire > 0)
{
Thread.Sleep(this.SleepFire);
}
this.IsFired = false;
this.DX = 5;
Thread.Sleep(30);
user32.mouse_event(4, 0, 0, 0, 0);
Thread.Sleep(20);
user32.mouse_event(0x10, 0, 0, 0, 0);
if (this.cbUnZoom.Checked)
{
user32.keybd_event(0x33, 0, 0, UIntPtr.Zero);
Thread.Sleep(20);
user32.keybd_event(0x33, 0, 2, UIntPtr.Zero);
Thread.Sleep(20);
user32.keybd_event(0x31, 0, 0, UIntPtr.Zero);
Thread.Sleep(20);
user32.keybd_event(0x31, 0, 2, UIntPtr.Zero);
}
}
}
}
catch
{
}
}
private void SpeedHack()
{
uint lpdwProcessId = 0;
user32.GetWindowThreadProcessId(this.hwnd, out lpdwProcessId);
kernel32.OpenProcess(ProcessAccessFlags.VMRead, true, (int) lpdwProcessId);
for (uint i = 0; i < 0x80000000; i++)
{
int lpNumberOfBytesRead = 0;
byte[] lpBuffer = new byte[4];
if (kernel32.ReadProcessMemory(new IntPtr((long) lpdwProcessId), new IntPtr((long) i), lpBuffer, 4, out lpNumberOfBytesRead))
{
BitConverter.ToUInt32(lpBuffer, 0);
BitConverter.ToString(lpBuffer);
}
}
}
private void timer1_Tick(object sender, EventArgs e)
{
this.RunSearch();
}
// Properties
private string PointBlankPath
{
get
{
return (string) Registry.GetValue(@"HKEY_CURRENT_USER\Software\4game\pointblank", "path", "");
}
}
}
вот апи [
Ссылки могут видеть только зарегистрированные пользователи. ] [
Ссылки могут видеть только зарегистрированные пользователи. ]
Пользователь сказал cпасибо:
Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения
HTML код Выкл.
Похожие темы
Тема
Автор
Раздел
Ответов
Последнее сообщение
Автокик
dagi
Архив уязвимостей
12
16.07.2008 16:53
Заявление об ответственности / Список мошенников
Часовой пояс GMT +4, время: 05:27 .