show us your memory class
I try to make a fps unlocker for call of duty ghost but i got this error meassage : 'constant expression not representable in type 'integer''
vb.net source code:
Public Class Form1
Dim a As New WriterClass
Dim t As New WriterClass
Private Sub LdThemeGhost1_Click(sender As Object, e As EventArgs) Handles LdThemeGhost1.Click
Timer1.Start()
End Sub
'Fov'
Private Sub LdTrackBarBlue1_Scroll(sender As Object) Handles LdTrackBarBlue1.Scroll
a.Process_Handle("iw6mp64_ship")
a.WriteFloat(a.ReadInteger64(&H1419AB640) + &HC, (LdTrackBarBlue1.Value))
Label1.Text = "" &
Format(LdTrackBarBlue1.Value, "#.")
End Sub
End Class
'Thx to help me and tell me how can i fix it ...'
LINDRA
show us your memory class
Click Here to visit the official MPGH wiki! Keep up with the latest news and information on games and MPGH! To check out pages dedicated to games, see the links below!
dd/mm/yyyy
Member - 31/01/2015
Premium - 12/09/2016
Call of Duty minion - 05/11/2016 - 05/11/2019
BattleOn minion - 28/02/2017 - 05/11/2019
Battlefield minion - 30/05/2017 - 05/11/2019
Other Semi-Popular First Person Shooter Hacks minion - 21/09/2017 - 17/09/2019
Publicist - 07/11/2017 - 02/08/2018
Cock Sucker - 01/12/2017 - Unknown
Minion+ - 06/03/2018 - 05/11/2019
Fortnite minion - 08/05/2018 - 05/11/2019
Head Publicist - 08/10/2018 - 10/01/2020
Developer Team - 26/10/2019 - 10/01/2020
Former Staff - 10/01/2020
Imports System.Runtime.InteropServices
Imports System.Text
Public Class WriterClass
Dim ProcList As Process()
#Region "Basic Stuff"
<DllImport("kernel32.dll")> _
Private Shared Function ReadProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <[In](), Out()> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("kernel32.dll")> _
Private Shared Function WriteProcessMemory(hProcess As IntPtr, lpBaseAddress As IntPtr, <[In](), Out()> buffer As Byte(), size As UInt32, ByRef lpNumberOfBytesWritten As IntPtr) As Int32
End Function
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function GetKeyState(ByVal virtualKeyCode As Keys) As Short
End Function
Private pHandel As IntPtr
Private ProcessModule As ProcessModule
Public BaseAddress As Integer
Public Function Process_Handle(ProcessName As String) As Boolean
Try
ProcList = Process.GetProcessesByName(ProcessName)
If ProcList.Length = 0 Then
Return False
Else
pHandel = ProcList(0).Handle
ProcessModule = ProcList(0).MainModule
BaseAddress = ProcessModule.BaseAddress
Return True
End If
Catch ex As Exception
Console.WriteLine("Process_Handle - " + ex.Message)
Return False
End Try
End Function
Private Function Read(Address As Integer, Length As Integer) As Byte()
Dim Buffer As Byte() = New Byte(Length - 1) {}
Dim Zero As IntPtr = IntPtr.Zero
ReadProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
Return Buffer
End Function
Private Sub Write(Address As Integer, Value As Integer)
Dim Buffer As Byte() = BitConverter.GetBytes(Value)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
#End Region
'This is the part you want to edit
#Region "Write Functions (Integer & String)"
Public Sub WriteInteger(Address As Integer, Value As Integer)
Write(Address, Value)
End Sub
Public Sub WriteString(Address As Integer, Text As String)
Dim Buffer As Byte() = New ASCIIEncoding().GetBytes(Text)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Text.Length)
End Sub
Public Sub WriteFloat(Address As Integer, Float As Single)
Dim Buffer As Byte() = BitConverter.GetBytes(Float)
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, 4, Zero)
End Sub
Public Sub WriteBytes(Address As Integer, Bytes As Byte())
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Bytes, CUInt(Bytes.Length), Zero)
End Sub
Public Sub WriteNOP(Address As Integer)
Dim Buffer As Byte() = New Byte() {&H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90, &H90}
Dim Zero As IntPtr = IntPtr.Zero
WriteProcessMemory(pHandel, New IntPtr(Address), Buffer, UInt32.Parse(Buffer.Length), Zero)
End Sub
#End Region
#Region "Read Functions (Integer & String)"
Public Function ReadInteger(Address As Integer, Optional Length As Integer = 4) As Integer
Return BitConverter.ToInt32(Read(Address, Length), 0)
End Function
Public Function ReadFloat(Address As Integer, Optional Length As Integer = 4) As Double
Return BitConverter.ToSingle(Read(Address, Length), 0)
End Function
Public Function ReadString(Address As Integer, Optional Length As Integer = 4) As String
Return New ASCIIEncoding().GetString(Read(Address, Length))
End Function
Public Function ReadBytes(Address As Integer, Length As Integer) As Byte()
Return Read(Address, Length)
End Function
#End Region
#Region "Extra"
Public Function HotKey(Key As Keys) As Boolean
Return Convert.ToBoolean(GetKeyState(Key))
End Function
Private Check_res As Boolean = True
Public Function Check_Value(Value As String) As Integer
For Each a As Char In Value
If Char.IsNumber(a, 0) Then
Check_res = True
Else
Check_res = False
Return 0
Exit For
End If
Next
Return Convert.ToInt32(Value)
End Function
#End Region
End Class