Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > General Coding
You last visited: Today at 04:20

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Send keys & Read Procces Memmory

Discussion on Send keys & Read Procces Memmory within the General Coding forum part of the Coders Den category.

Reply
 
Old   #1
 
ax5's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,050
Received Thanks: 472
Send keys & Read Procces Memmory

Hello, does some one know have to read pointers/memory from a mmorpg game ? and also send keys to it ?
ax5 is offline  
Old 11/17/2010, 23:46   #2
 
ax5's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,050
Received Thanks: 472
Im using VB.NET 2008
ax5 is offline  
Old 11/18/2010, 00:09   #3
 
elite*gold: 42
Join Date: Jun 2008
Posts: 5,426
Received Thanks: 1,888
Send/PostMessage
Read/WriteProcessMemory
MoepMeep is offline  
Old 11/20/2010, 22:53   #4
 
ax5's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,050
Received Thanks: 472
Quote:
Originally Posted by MoepMeep View Post
Send/PostMessage
Read/WriteProcessMemory
????
ax5 is offline  
Old 11/21/2010, 00:59   #5
 
ZeraPain's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 360
Received Thanks: 249
Read Memory (C# / Autoit):



Send Key (Autoit):

ControlSend()

€: nvm, didn't read that you wrote in your 2nd post that you are using vb.net, sorry (better edit your first post next time)
ZeraPain is offline  
Old 11/21/2010, 01:03   #6

 
xEncounter's Avatar
 
elite*gold: 22
Join Date: Nov 2009
Posts: 1,552
Received Thanks: 361
ich glaub das hilft ihm nicht wenn ihr eure sprache sprecht^^. erklärt es ihm auf deutsh und nicht in C.
xEncounter is offline  
Old 11/30/2010, 09:43   #7
 
ax5's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,050
Received Thanks: 472
English please
ax5 is offline  
Old 11/30/2010, 10:24   #8
 
-AmA-'s Avatar
 
elite*gold: 0
Join Date: Dec 2007
Posts: 728
Received Thanks: 460
Code:
Module Memory
    Public Const PROCESS_VM_READ = &H10
    Public Const PROCESS_VM_WRITE = (&H20)
    Public Const PROCESS_VM_OPERATION = (&H8)
    Public Const PROCESS_QUERY_INFORMATION = (&H400)
    Public Const PROCESS_READ_WRITE_QUERY = PROCESS_VM_READ + PROCESS_VM_WRITE + PROCESS_VM_OPERATION + PROCESS_QUERY_INFORMATION
    Public Const PROCESS_ALL_ACCESS = &H1F0FFF
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Int32, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Byte(), ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByVal lpBuffer() As Byte, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
    Public Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As UInteger, ByVal bInheritHandle As Integer, ByVal dwProcessId As UInteger) As IntPtr
    Public Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As IntPtr) As Boolean
    Public Function Game_Hwnd() As Int32
        Dim i As Int32 : Dim foundit As Boolean = False
        For Each p As Process In Process.GetProcessesByName("Halo2") ' Replace that with the games window text
            i = p.Id
            foundit = True : Exit For
        Next
        If foundit = True Then
            Return i
        Else
            MsgBox("Couldn't find Game")
            Return 0
        End If
    End Function
#Region "Memory reading/Writing"
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As Integer, ByVal Size As Integer)
        Try
            Dim GameReadWrite As Integer
            Dim PID As Integer = Game_Hwnd()
            GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

            Dim bytArray() As Byte
            bytArray = BitConverter.GetBytes(Value)
            WriteProcessMemory(GameReadWrite, Address, bytArray, Size, 0)

            CloseHandle(GameReadWrite)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value() As Byte)
        Try
            Dim GameReadWrite As Integer
            Dim PID As Integer = Game_Hwnd()
            GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

            WriteProcessMemory(GameReadWrite, Address, Value, Value.Length, 0)

            CloseHandle(GameReadWrite)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value() As Byte, ByVal Offset As Integer, ByVal Length As Integer)
        Try
            Dim Count1 As Integer
            For Count1 = 0 To Length - 1
                WriteMemory(Address + Count1, Value(Count1 + Offset), 1)
            Next
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As String)
        Try
            Dim Length As Integer = Value.Length
            For I As Integer = 0 To Length - 1
                WriteMemory(Address + I, Asc(Value.Chars(I)), 1)
            Next
            WriteMemory(Address + Length, 0, 1)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As Double)
        Try
            Dim Buffer(0 To 7) As Byte
            Buffer = BitConverter.GetBytes(Value)
            For I As Integer = 0 To 7
                WriteMemory(Address + I, CInt(Buffer(I)), 1)
            Next
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    'Read Memory
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As Double)
        Try
            Dim Buffer(7) As Byte
            Dim Temp As Integer
            For I As Integer = 0 To 7
                ReadMemory(Address + I, Temp, 1)
                Buffer(I) = CByte(Temp)
            Next
            Value = BitConverter.ToDouble(Buffer, 0)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As Integer, ByVal Size As Integer)
        Try
            Dim mValue As Integer

            Dim GameReadWrite As Integer
            Dim PID As Integer = Game_Hwnd()
            GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

            ReadProcessMemory(GameReadWrite, Address, mValue, Size, 0)
            Value = mValue

            CloseHandle(GameReadWrite)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value() As Byte, ByVal Length As Integer)
        Try
            Dim bytArray() As Byte
            Dim Count1 As Integer
            Dim tempInteger As Integer
            ReDim bytArray(Length - 1)
            For Count1 = 0 To Length - 1
                ReadMemory(Address + Count1, tempInteger, 1)
                bytArray(Count1) = CByte(tempInteger)
            Next
            Value = bytArray
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As String)
        Try
            Dim intChar As Integer
            Dim Count1 As Integer
            Dim strTemp As String
            strTemp = String.Empty
            Count1 = 0
            Do
                ReadMemory(Address + Count1, intChar, 1)
                If intChar <> 0 Then strTemp = strTemp & Chr(intChar)
                Count1 += 1
            Loop Until intChar = 0
            Value = strTemp
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As String, ByVal Length As Integer)
        Try
            Dim intChar As Integer
            Dim Count1 As Integer
            Dim strTemp As String
            strTemp = String.Empty
            For Count1 = 0 To Length - 1
                ReadMemory(Address + Count1, intChar, 1)
                strTemp = strTemp & Chr(intChar)
            Next
            Value = strTemp
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
#End Region
    Function ReadInt(ByVal Address As Int32)
        Dim i As Int32
        ReadMemory(Address, i, 4)
        Return i
    End Function
    Sub WriteInt(ByVal Address As Int32, ByVal Value As Int32)
        WriteMemory(Address, Value, 4) ' We'll write a 4 bit to the address
    End Sub
End Module
Search on Google!...

VB ist sowas von scheisse und schreibt so nen schrott code im hintergrund -.-
-AmA- is offline  
Old 12/01/2010, 13:00   #9
 
ax5's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,050
Received Thanks: 472
Quote:
Originally Posted by -AmA- View Post
Code:
Module Memory
    Public Const PROCESS_VM_READ = &H10
    Public Const PROCESS_VM_WRITE = (&H20)
    Public Const PROCESS_VM_OPERATION = (&H8)
    Public Const PROCESS_QUERY_INFORMATION = (&H400)
    Public Const PROCESS_READ_WRITE_QUERY = PROCESS_VM_READ + PROCESS_VM_WRITE + PROCESS_VM_OPERATION + PROCESS_QUERY_INFORMATION
    Public Const PROCESS_ALL_ACCESS = &H1F0FFF
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Int32, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
    Public Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByRef lpBuffer As Byte(), ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As Int32, ByVal lpBuffer() As Byte, ByVal nSize As Int32, ByVal lpNumberOfBytesWritten As Int32) As Long
    Public Declare Function OpenProcess Lib "kernel32.dll" (ByVal dwDesiredAccess As UInteger, ByVal bInheritHandle As Integer, ByVal dwProcessId As UInteger) As IntPtr
    Public Declare Function CloseHandle Lib "kernel32.dll" (ByVal hHandle As IntPtr) As Boolean
    Public Function Game_Hwnd() As Int32
        Dim i As Int32 : Dim foundit As Boolean = False
        For Each p As Process In Process.GetProcessesByName("Halo2") ' Replace that with the games window text
            i = p.Id
            foundit = True : Exit For
        Next
        If foundit = True Then
            Return i
        Else
            MsgBox("Couldn't find Game")
            Return 0
        End If
    End Function
#Region "Memory reading/Writing"
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As Integer, ByVal Size As Integer)
        Try
            Dim GameReadWrite As Integer
            Dim PID As Integer = Game_Hwnd()
            GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

            Dim bytArray() As Byte
            bytArray = BitConverter.GetBytes(Value)
            WriteProcessMemory(GameReadWrite, Address, bytArray, Size, 0)

            CloseHandle(GameReadWrite)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value() As Byte)
        Try
            Dim GameReadWrite As Integer
            Dim PID As Integer = Game_Hwnd()
            GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

            WriteProcessMemory(GameReadWrite, Address, Value, Value.Length, 0)

            CloseHandle(GameReadWrite)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value() As Byte, ByVal Offset As Integer, ByVal Length As Integer)
        Try
            Dim Count1 As Integer
            For Count1 = 0 To Length - 1
                WriteMemory(Address + Count1, Value(Count1 + Offset), 1)
            Next
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As String)
        Try
            Dim Length As Integer = Value.Length
            For I As Integer = 0 To Length - 1
                WriteMemory(Address + I, Asc(Value.Chars(I)), 1)
            Next
            WriteMemory(Address + Length, 0, 1)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub WriteMemory(ByVal Address As Integer, ByVal Value As Double)
        Try
            Dim Buffer(0 To 7) As Byte
            Buffer = BitConverter.GetBytes(Value)
            For I As Integer = 0 To 7
                WriteMemory(Address + I, CInt(Buffer(I)), 1)
            Next
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    'Read Memory
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As Double)
        Try
            Dim Buffer(7) As Byte
            Dim Temp As Integer
            For I As Integer = 0 To 7
                ReadMemory(Address + I, Temp, 1)
                Buffer(I) = CByte(Temp)
            Next
            Value = BitConverter.ToDouble(Buffer, 0)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As Integer, ByVal Size As Integer)
        Try
            Dim mValue As Integer

            Dim GameReadWrite As Integer
            Dim PID As Integer = Game_Hwnd()
            GameReadWrite = OpenProcess(PROCESS_READ_WRITE_QUERY, False, PID)

            ReadProcessMemory(GameReadWrite, Address, mValue, Size, 0)
            Value = mValue

            CloseHandle(GameReadWrite)
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value() As Byte, ByVal Length As Integer)
        Try
            Dim bytArray() As Byte
            Dim Count1 As Integer
            Dim tempInteger As Integer
            ReDim bytArray(Length - 1)
            For Count1 = 0 To Length - 1
                ReadMemory(Address + Count1, tempInteger, 1)
                bytArray(Count1) = CByte(tempInteger)
            Next
            Value = bytArray
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As String)
        Try
            Dim intChar As Integer
            Dim Count1 As Integer
            Dim strTemp As String
            strTemp = String.Empty
            Count1 = 0
            Do
                ReadMemory(Address + Count1, intChar, 1)
                If intChar <> 0 Then strTemp = strTemp & Chr(intChar)
                Count1 += 1
            Loop Until intChar = 0
            Value = strTemp
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
    Public Sub ReadMemory(ByVal Address As Integer, ByRef Value As String, ByVal Length As Integer)
        Try
            Dim intChar As Integer
            Dim Count1 As Integer
            Dim strTemp As String
            strTemp = String.Empty
            For Count1 = 0 To Length - 1
                ReadMemory(Address + Count1, intChar, 1)
                strTemp = strTemp & Chr(intChar)
            Next
            Value = strTemp
        Catch Ex As Exception
            'ShowError(Ex)
        End Try
    End Sub
#End Region
    Function ReadInt(ByVal Address As Int32)
        Dim i As Int32
        ReadMemory(Address, i, 4)
        Return i
    End Function
    Sub WriteInt(ByVal Address As Int32, ByVal Value As Int32)
        WriteMemory(Address, Value, 4) ' We'll write a 4 bit to the address
    End Sub
End Module
Search on Google!...

VB ist sowas von scheisse und schreibt so nen schrott code im hintergrund -.-
thanks
ax5 is offline  
Old 12/02/2010, 00:20   #10
 
Endecs's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 2,256
Received Thanks: 2,342
And you can use to send keys sendkeys.send("this is a example text") or if you will use hotkeys so strg+v sendkeys.sendwait("^v")
Endecs is offline  
Old 12/12/2010, 09:11   #11
 
ax5's Avatar
 
elite*gold: 0
Join Date: May 2009
Posts: 1,050
Received Thanks: 472
Quote:
Originally Posted by Vb.net View Post
And you can use to send keys sendkeys.send("this is a example text") or if you will use hotkeys so strg+v sendkeys.sendwait("^v")
well can some one send me a working file ?
ax5 is offline  
Old 12/12/2010, 15:57   #12
 
elite*gold: 0
Join Date: Jul 2010
Posts: 388
Received Thanks: 196
Quote:
Originally Posted by ax5 View Post
well can some one send me a working file ?
No. If you wanna code, code. Advice has been given. If you want a done tool or done code, google and download.
SmackJew is offline  
Reply


Similar Threads Similar Threads
[Tutorial] How to send keys to 2moons while its inactive
02/23/2020 - Dekaron Exploits, Hacks, Bots, Tools & Macros - 19 Replies
This is useful for fighting things with lots of hp or simply spamming something while you're afk. First of all, download auto hot key which can be found here. AutoHotkey - Free Mouse and Keyboard Macro Program with Hotkeys and AutoText And install it. Open Notepad, and copy + paste this That is a sample script and what that does is it sends the key 3 to the process 2moons every second 3 times and then it does the same with the key 2 and 1. You should have the hang of it now.
WindowsInputSimulator (or how to send keys to s4)
10/07/2010 - S4 League - 8 Replies
I don't know how many of you have used this but.. I was playing around with it. void WaveDashThing() { System.Threading.Thread.Sleep(2000); InputSimulator.SimulateKeyPress(VirtualKeyCode.SPA CE); InputSimulator.SimulateKeyDown(VirtualKeyCode.VK_A ); InputSimulator.SimulateKeyPress(VirtualKeyCode.SPA CE); InputSimulator.SimulateKeyUp(VirtualKeyCode.VK_A);
Send Keys to minimized PW-Window
07/21/2010 - Perfect World - 3 Replies
I want to learn how to send keys to a PW-Window, but it is minimized (because of the other functions my prog has).. i am programming in vb.net (i know.. not the best language but i am getting along with it quite good) so if anyone knows a simple function or can help me with this.. pls tell me :) greetz
Deaparately trying to send Keys to the AR window...
04/26/2009 - Ace Online / AirRivals - 0 Replies
I'm currently trying to code a joystick-support for AirRivals. It doesn't work for one (crazy) reason: The game-window only seems to accept its input from the hardware-based keyboard. Just thought it can be good to consult the "underground", although I'm not wanting to hack AR or to write a bot, but if I send Key-messages to the AR-Handle (using the Windows-API-function postmessage/keybd_event), nothing happens, except if it's a system Key like , or ... for example if I try to send a small...
How do I: Click or Send Keys to a minimized window
04/08/2006 - General Coding - 6 Replies
I am making a bot for ConquerOnline, and I need to know how to send clicks or keys to a minimized window, like COPartner does. Thanks for any help.



All times are GMT +2. The time now is 04:20.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.