Results 1 to 5 of 5
  1. #1
    ikillindreams's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United Stats
    Posts
    190
    Reputation
    10
    Thanks
    556
    My Mood
    Aggressive

    Question How do i write values greater then 255 in VB.NET?

    I am trying to add Experience to my Simple Prestige Hack but i cannot use the same code i did for the prestige to modify the experience.

    Code:
    WriteProcessMemory(processHandle, Address(0), vBuffer(0), 4, 0)
    That is how i write my data. It gets the Process (iw5mp) and then gets the Address (Exp) and Then gets the vBuffer

    Code:
     vBuffer(0) = Convert.ToByte(TextBox1.Text)
    which is wear i get my error. I cannot write a value greater then 255 to a byte.

    How would i write a value greater then 255 to the Experience address in VB.NET?

    I'm Using Framework 4.5

  2. #2
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    If you can't write values higher than 255 using a single byte.. use 2 bytes... then you can go up to 65.535 or 4 bytes (Integer).. up to 4.294.967.295 (considering it is unsigned ofc)

    byte[] bytes = BitConverter.GetBytes(int.parse(textbox.Text))


    CoD Minion from 09/19/2012 to 01/10/2013

  3. #3
    ikillindreams's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United Stats
    Posts
    190
    Reputation
    10
    Thanks
    556
    My Mood
    Aggressive
    Code:
     Dim bits(0 To 1) As Byte
           
     bits = BitConverter.GetBytes(Int32.Parse(TextBox2.Text))
     vBuffer(0) = Convert.ToInt64(bits)
    Returns this error

    Code:
    Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.
    What else should i try?

  4. #4
          ( ° ͜ʖ͡°)╭∩╮
    Former Staff
    MarkHC's Avatar
    Join Date
    Nov 2011
    Gender
    male
    Location
    127.0.0.1
    Posts
    2,750
    Reputation
    66
    Thanks
    14,529
    My Mood
    Angelic
    Quote Originally Posted by ikillindreams View Post
    Code:
     Dim bits(0 To 1) As Byte
           
     bits = BitConverter.GetBytes(Int32.Parse(TextBox2.Text))
     vBuffer(0) = Convert.ToInt64(bits)
    Returns this error

    Code:
    Unable to cast object of type 'System.Byte[]' to type 'System.IConvertible'.
    What else should i try?
    You should try to learn how to use Google

    from MSDN:
    Code:
    Public Shared Function GetBytes ( _
    	value As Long _
    ) As Byte()
    
    Dim value As Long
    Dim returnValue As Byte()
    
    returnValue = BitConverter.GetBytes(value)
    Then use WriteProcessMemory to write the returnValue array
    Last edited by MarkHC; 12-01-2012 at 06:28 AM.


    CoD Minion from 09/19/2012 to 01/10/2013

  5. #5
    ikillindreams's Avatar
    Join Date
    Jun 2011
    Gender
    male
    Location
    United Stats
    Posts
    190
    Reputation
    10
    Thanks
    556
    My Mood
    Aggressive
    Code:
     Public Shared Function Tolong( _
    value As Int32 _
    ) As Long
    
        End Function
        Public Shared Function GetBytes( _
    value As Long _
    ) As Byte()
        End Function
    
            Dim value As Long
            Dim returnValue As Byte()
    
            Address(0) = &H1DBD238 'This is the equivalent of 01DBD238 in cheatengine
    
            value = Tolong(Convert.ToInt32(TextBox2.Text))
            returnValue = BitConverter.GetBytes(value)
    
    
            VirtualProtectEx(processHandle, Address(0), 4, PAGE_READWRITE, 0)
            WriteProcessMemory(processHandle, Address(0), vBuffer(0), 4, 0)

    I do not get an error anymore but it does not change my Experience level

    Edit: I would assume its the "value = Tolong(Convert.ToInt32(TextBox2.Text))" That is incorrectly reading my experience level in the textbox

Similar Threads

  1. [Help] how can i write & read multi-pointer and offset ??? [VB.net]
    By zokz in forum Visual Basic Programming
    Replies: 1
    Last Post: 06-23-2012, 04:41 AM
  2. how do i write in korean
    By mastero89 in forum WarRock Korea Hacks
    Replies: 2
    Last Post: 04-15-2009, 06:56 AM
  3. How Do I Write ASM To A Process?
    By radnomguywfq3 in forum C++/C Programming
    Replies: 12
    Last Post: 12-11-2007, 09:13 PM
  4. [Help] How to write value NOP
    By jaqq3000 in forum Visual Basic Programming
    Replies: 9
    Last Post: 12-02-2007, 11:46 AM
  5. How to write value "NOP"
    By w00t? in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-10-2007, 12:32 PM