Results 1 to 9 of 9
  1. #1
    AlbiZik's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    17
    My Mood
    Fine

    Question Module with negative values

    I'm using VB.NET language;
    I use a module, and I want to know how to put a negative value like -100 in my Textbox1
    The code used with my Textbox1 is :
    memoryh4x(&HBE9C4C, TextBox1.Text, 4)
    When I compile, if I put a negative value (like "-100") in my Textbox1, my tool crash because the "-" is not recognized.
    How I can do ?

    THIS MODULE WAS NOT MADE BY ME AND I'M SORRY BUT I CAN'T REMEMBER WHERE I'VE FOUND IT AND WHO IS THE AUTHOR !
    Code:
    Module Module1
    
    #Region "Declarations"
    
        Private Declare Function OpenProcess Lib "kernel32" Alias "OpenProcess" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Integer, ByVal dwProcessId As Integer) As Integer
        Private Declare Function WriteProcessMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        Private Declare Function WriteFloatMemory Lib "kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Single, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        Private Declare Function ReadFloat Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByRef buffer As Single, ByVal size As Int32, ByRef lpNumberOfBytesRead As Int32) As Boolean
        Private Declare Function ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Integer, ByVal lpBaseAddress As Integer, ByRef lpBuffer As Integer, ByVal nSize As Integer, ByRef lpNumberOfBytesWritten As Integer) As Integer
        Private Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Integer) As Integer
    
        Private string1 As Long
        Private string2 As Integer
        Private RBuff1 As Long
        Private RBuff2 As Single
        Private RBuff3 As Integer
    
    #End Region
    
    #Region "Check Process/ReadDll"
    
        Private Function readdll(ByVal modulename As String)
            Dim procmodule As ProcessModule
            Dim constant1 As Integer
            Dim constant2 As Long
            Dim constant3 As Process() = Process.GetProcessesByName("iw5mp")
            If constant3.Length = 0 Then
                Return 0
            End If
            For Each procmodule In constant3(0).Modules
                If modulename = procmodule.ModuleName Then
                    constant1 = procmodule.BaseAddress
                End If
            Next
            constant2 = constant1
            Return constant2
        End Function
    
        Public Function IsProcessOpen(ByVal name As String) As Boolean
    
            For Each clsProcess As Process In Process.GetProcesses
    
                If clsProcess.ProcessName.Contains(name) Then
    
    
                    Return True
    
                End If
            Next
            ' Do nothing 
            Return False
        End Function
    
    
    #End Region
    
    #Region "Hacks"
    
        'WriteMemory
        Private Function WriteMemory(ByVal Address As Integer, ByVal Value As Long, ByVal Bytes As Integer)
            Dim iw4mpLookUp As Process() = Process.GetProcessesByName("iw5mp")
            If iw4mpLookUp.Length = 0 Then
                End
            End If
            Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, iw4mpLookUp(0).Id)
            WriteProcessMemory(processHandle, Address, Value, Bytes, Nothing)
            CloseHandle(processHandle)
    
            Return Nothing
        End Function
    
        'WriteFloat
        Private Function WriteFloat(ByVal Address As Integer, ByVal Value As Single)
            Dim iw4mpLookUp As Process() = Process.GetProcessesByName("iw5mp")
            If iw4mpLookUp.Length = 0 Then
                End
            End If
            Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, iw4mpLookUp(0).Id)
            WriteFloatMemory(processHandle, Address, Value, 4, Nothing)
            CloseHandle(processHandle)
    
            Return Nothing
        End Function
    
        'NOP
        Private Function NOP(ByVal Address As Integer, ByVal value As Integer)
            Dim iw4mpLookUp As Process() = Process.GetProcessesByName("iw5mp")
            If iw4mpLookUp.Length = 0 Then
                End
            End If
            Dim processHandle As IntPtr = OpenProcess(&H1F0FFF, 0, iw4mpLookUp(0).Id)
            WriteProcessMemory(processHandle, Address, value, 1, Nothing)
            CloseHandle(processHandle)
    
            Return Nothing
        End Function
    
    #End Region
    
    #Region "Functions"
    
        Public Function memoryh4x(ByVal address As String, ByVal value As Long, ByVal bytes As Byte)
            If IsProcessOpen("iw5mp") Then
    
                string1 = readdll("cshell.dll")
                string2 = "&H" & Hex(string1 + address)
                WriteMemory(string2, value, bytes)
            End If
            Return Nothing
        End Function
    
        Public Function floath4x(ByVal address As String, ByVal value As Long)
            If IsProcessOpen("iw5mp") Then
    
                string1 = readdll("cshell.dll")
                string2 = "&H" & Hex(string1 + address)
                WriteFloat(string2, value)
            End If
            Return Nothing
        End Function
    
        Public Function noph4x(ByVal address As String, ByVal value As Long)
            If IsProcessOpen("iw5mp") Then
                string1 = readdll("cshell.dll")
                string2 = "&H" & Hex(string1 + address)
                NOP(string2, value)
    
    
            End If
            Return Nothing
        End Function
    
    #End Region
    End Module
    When my tool "MW3 Leaderboard Editor" will be finished, I think I'll post the source code.
    I'm sure this will be help people and I'm sure is that I think this will help the novice as I was before too (I'm probably still).

  2. #2
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,715
    My Mood
    Cheerful
    Can you show the whole error?

  3. #3
    AlbiZik's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    17
    My Mood
    Fine
    Yes but I'm french so it's writting in french
    I translate the error message only because the rest is not important.
    So :
    La conversion de la chaîne "" en type 'Long' n'est pas valide.
    Do in English (I think my translation is not very well)
    The conversion from string "" to type 'Long' is not valid.

    I am absolutely sure that error come from the "-"
    Attached Thumbnails Attached Thumbnails
    Error.png  


  4. #4
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,715
    My Mood
    Cheerful
    Quote Originally Posted by AlbiZik View Post
    Yes but I'm french so it's writting in french
    I translate the error message only because the rest is not important.
    So :

    Do in English (I think my translation is not very well)


    I am absolutely sure that error come from the "-"
    It seems that you're sending an empty string from the textbox to your mem. class..
    Make sure that the fourth textbox on your form is actually called TextBox4.

    I hope you can understand me..

  5. #5
    AlbiZik's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    17
    My Mood
    Fine
    Yes, but I've already verified this, when I put a postitive value like 100 it's working nice, but if I put a negative value like -100 I get this error message :/

  6. #6
    Horror's Avatar
    Join Date
    Oct 2010
    Gender
    male
    Location
    51,4.
    Posts
    6,940
    Reputation
    574
    Thanks
    5,004
    My Mood
    Twisted
    Use a numericUpDown or whatever it's called. I believe that allows values below 0 ?
     

    Minion+ : February 2014 - January 2015
    Counter Strike: Global Offensive Minion : November 2014 - January 2015
    Alliance of Valiant Arms Minion : August 2014 - January 2015
    Need For Speed World Minion : January 2014 - January 2015
    Rust Minion : January 2014 - January 2015
    Call of Duty Minion : January 2013 - January 2015
    Editor : December 2012 - April 2013
    Donator : March 2014 - Current
    Member : October 2010 - Current

    Previously known as "Isaakske".

  7. The Following User Says Thank You to Horror For This Useful Post:

    AlbiZik (06-04-2014)

  8. #7
    AlbiZik's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    17
    My Mood
    Fine
    Can you explain more please, I'm not sure I've understand ^^

  9. #8
    Lovroman's Avatar
    Join Date
    Sep 2012
    Gender
    male
    Posts
    9,430
    Reputation
    611
    Thanks
    9,715
    My Mood
    Cheerful
    Quote Originally Posted by AlbiZik View Post
    Can you explain more please, I'm not sure I've understand ^^
    If I'm not wrong, Horror was reffering to this: http://msdn.microsoft.com/en-us/libr...(v=vs.90).aspx i.e. this:

  10. The Following User Says Thank You to Lovroman For This Useful Post:

    AlbiZik (06-04-2014)

  11. #9
    AlbiZik's Avatar
    Join Date
    May 2013
    Gender
    male
    Posts
    23
    Reputation
    10
    Thanks
    17
    My Mood
    Fine
    Thanks it's working now !
    But, can you explain to me, why with a NumericUpDown it's working and with a Textbox it's not working ?

Similar Threads

  1. [Help] Pointer of address with static value
    By NoLabel in forum General Game Hacking
    Replies: 1
    Last Post: 02-24-2013, 01:30 PM
  2. [WTS] Selling Steam Account With A Value Of 861.81$ and With 70 Game !!!
    By Johny. in forum Selling Accounts/Keys/Items
    Replies: 3
    Last Post: 11-11-2012, 07:31 AM
  3. Flash game with dynamic values (knights of glory)
    By ahmedh87 in forum Hack Requests
    Replies: 0
    Last Post: 11-09-2012, 12:26 PM
  4. [Help]Problem with Drawing + Value
    By HazXoD3D in forum Visual Basic Programming
    Replies: 0
    Last Post: 03-20-2010, 07:47 PM
  5. Negative values
    By BooYa in forum Assembly
    Replies: 4
    Last Post: 10-22-2009, 04:33 PM