Results 1 to 4 of 4
  1. #1
    Str8Soulja00's Avatar
    Join Date
    Dec 2007
    Posts
    9
    Reputation
    10
    Thanks
    5

    [Tutorials]Array of Bytes

    This was written by Cobra and Str8Soulja

    Put this in your module
    Puts a string into a byte array.


    Code:
    Public Sub ByteStringToByteArray(strString As String, ByRef byteArray() As Byte)
    Dim current_byte    As Byte
    Dim c, d, intSize   As Integer
    Dim strTemp         As String
    
            ReDim byteArray(0) As Byte
            
            For c = 1 To Len(strString)
                If (Mid(strString, c, 1) <> " ") Then
                    strTemp = strTemp & Mid(strString, c, 1)
                End If
            Next c
            
            intSize = Round(Len(strTemp) / 2)
            ReDim Preserve byteArray(intSize) As Byte
            
            d = 0
            For c = 1 To Len(strTemp) Step 2
                current_byte = Val("&H" + Mid(strTemp, c, 2))
                byteArray(d) = current_byte
                d = d + 1
            Next c
    End Sub

    This writes a byte string to the desired offset.

    Code:
    Public Sub WriteByteString(lngAddress As Long, strValue As String, Optional ByRef NumberOfBytesWritten As Long = 0)
    Dim hwnd, processHandle, processId As Long
    Dim bytValue() As Byte
        
        hwnd = FindWindow(vbNullString, CurrentProcess)
        If (hwnd = 0) Then Exit Sub
        
        GetWindowThreadProcessId hwnd, processId
        processHandle = OpenProcess(PROCESS_ALL_ACCESS, False, processId)
        ByteStringToByteArray strValue, bytValue
        WriteProcessMemory processHandle, lngAddress, bytValue(0), UBound(bytValue), NumberOfBytesWritten
        CloseHandle processHandle
    End Sub
    Put this in form load
    Code:
    CurrentProcess = "WarRock"
    'Put this in your button or hotkey
    '90 90 90 is how you can nop stuff

    Code:
    Call WriteByteString(&Haddie,90 90 90)

  2. The Following 3 Users Say Thank You to Str8Soulja00 For This Useful Post:

    g36gunner (01-01-2008),K2 Nemico (12-31-2007),wr194t (12-31-2007)

  3. #2
    Otoom's Avatar
    Join Date
    Dec 2007
    Posts
    30
    Reputation
    10
    Thanks
    1
    Wouldnt really call it a tutorial.
    More like code snippets.

    Thanks though.

  4. #3
    brownsfan91's Avatar
    Join Date
    May 2007
    Location
    warren, ohio
    Posts
    1,964
    Reputation
    13
    Thanks
    95
    Quote Originally Posted by Str8Soulja00 View Post
    This was written by Cobra and Str8Soulja

    Put this in your module
    Puts a string into a byte array.


    Code:
    Public Sub ByteStringToByteArray(strString As String, ByRef byteArray() As Byte)
    Dim current_byte    As Byte
    Dim c, d, intSize   As Integer
    Dim strTemp         As String
     
            ReDim byteArray(0) As Byte
     
            For c = 1 To Len(strString)
                If (Mid(strString, c, 1) <> " ") Then
                    strTemp = strTemp & Mid(strString, c, 1)
                End If
            Next c
     
            intSize = Round(Len(strTemp) / 2)
            ReDim Preserve byteArray(intSize) As Byte
     
            d = 0
            For c = 1 To Len(strTemp) Step 2
                current_byte = Val("&H" + Mid(strTemp, c, 2))
                byteArray(d) = current_byte
                d = d + 1
            Next c
    End Sub

    This writes a byte string to the desired offset.

    Code:
    Public Sub WriteByteString(lngAddress As Long, strValue As String, Optional ByRef NumberOfBytesWritten As Long = 0)
    Dim hwnd, processHandle, processId As Long
    Dim bytValue() As Byte
     
        hwnd = FindWindow(vbNullString, CurrentProcess)
        If (hwnd = 0) Then Exit Sub
     
        GetWindowThreadProcessId hwnd, processId
        processHandle = OpenProcess(PROCESS_ALL_ACCESS, False, processId)
        ByteStringToByteArray strValue, bytValue
        WriteProcessMemory processHandle, lngAddress, bytValue(0), UBound(bytValue), NumberOfBytesWritten
        CloseHandle processHandle
    End Sub
    Put this in form load
    Code:
    CurrentProcess = "WarRock"
    'Put this in your button or hotkey
    '90 90 90 is how you can nop stuff

    Code:
    Call WriteByteString(&Haddie,90 90 90)
    this is all ****** talk; go eat some chicken

  5. #4
    K2 Nemico's Avatar
    Join Date
    Jul 2007
    Gender
    male
    Posts
    160
    Reputation
    8
    Thanks
    29
    thanks dude. this will be hlepful in asm hack making...

Similar Threads

  1. [Help Request] how to find array of bytes =-/
    By rippantera in forum Piercing Blow Help
    Replies: 6
    Last Post: 10-26-2011, 10:32 AM
  2. Array-Of-Byte Scan
    By master131 in forum C++/C Programming
    Replies: 7
    Last Post: 03-22-2011, 12:22 AM
  3. [RELEASE||HELP]Compression and Encryption of Byte Arrays
    By topblast in forum Visual Basic Programming
    Replies: 0
    Last Post: 12-24-2010, 01:21 AM
  4. [Help]Concatenate byte arrays
    By freedompeace in forum C++/C Programming
    Replies: 6
    Last Post: 10-14-2010, 11:01 AM
  5. [Tutorial]Convert Bits 2 Bytes
    By NextGen1 in forum Visual Basic Programming
    Replies: 7
    Last Post: 01-19-2010, 08:53 PM