Changing Hex Value

Discussion in 'Programming General' started by jeff223, Jul 26, 2009.

Changing Hex Value
  1. Unread #1 - Jul 26, 2009 at 9:50 PM
  2. jeff223
    Joined:
    Jul 26, 2009
    Posts:
    42
    Referrals:
    0
    Sythe Gold:
    0

    jeff223 Member

    Changing Hex Value

    I was attempting to create a little program that would change ONE hex value of a specific program to a certain value, but don't really know how to do it. Could someone give me an example code with a button or something? Thanks in advance!
     
  3. Unread #2 - Jul 27, 2009 at 8:59 PM
  4. SuF
    Joined:
    Jan 21, 2007
    Posts:
    14,212
    Referrals:
    28
    Sythe Gold:
    1,234
    Discord Unique ID:
    203283096668340224
    <3 n4n0 Two Factor Authentication User Community Participant Spam Forum Participant Sythe's 10th Anniversary

    SuF Legend
    Pirate Retired Global Moderator

    Changing Hex Value

    Like a memory editor?
     
  5. Unread #3 - Jul 27, 2009 at 9:05 PM
  6. Jimmy
    Joined:
    Jun 24, 2008
    Posts:
    2,421
    Referrals:
    10
    Sythe Gold:
    25

    Jimmy Ghost
    Retired Sectional Moderator $5 USD Donor

    Changing Hex Value

    I made one of these in Java a few weeks ago(I was bored, Lol). Unfinished, and not too sure if it'll be much help to you (Java isn't very much like vB), but here's the download. NOTE: It's not the nicest program (kinda sloppy), but it works (somewhat). You get the idea, :p

    http://rapidshare.de/files/47966377/Hex_Editor.zip.html
     
  7. Unread #4 - Jul 28, 2009 at 7:09 AM
  8. Darthatron
    Joined:
    May 22, 2006
    Posts:
    1,612
    Referrals:
    3
    Sythe Gold:
    0

    Darthatron Massive Troll
    Retired Sectional Moderator Visual Basic Programmers

    Changing Hex Value

    You want to edit the actual file or the memory?
     
  9. Unread #5 - Aug 3, 2009 at 2:20 AM
  10. Cody
    Joined:
    May 10, 2005
    Posts:
    3,052
    Referrals:
    5
    Sythe Gold:
    30

    Cody Grand Master
    Visual Basic Programmers

    Changing Hex Value

    Add this to your module... Code is not by me

    Code:
    Public Const PROCESS_ALL_ACCESS = &H1F0FFF
    Dim f1holder As Integer
    Dim timer_pos As Long
    
    Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal SomeValueIsStoredHere As Long, lpdwProcessId As Long) As Long
    Public Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
    Public Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
    Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
    Public Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
    
    Public Function WriteALong(TheGame As String, TheAddress As Long, ThisIsTheValue As Long)
    Dim SomeValueIsStoredHere As Long
    Dim SomeValueIsStoredHereToo As Long
    Dim SomeValue As Long
    SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
    GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
    SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
    If (SomeValue = 0) Then
        Exit Function
    End If
    WriteProcessMemory SomeValue, TheAddress, ThisIsTheValue, 4, 0&
    CloseHandle hProcess
    End Function
    
    Public Function ReadALong(TheGame As String, TheAddress As Long, TheValue As Long)
    Dim SomeValueIsStoredHere As Long
    Dim SomeValueIsStoredHereToo As Long
    Dim SomeValue As Long
    SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
    GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
    SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
    If (SomeValue = 0) Then
        Exit Function
    End If
    ReadProcessMem SomeValue, TheAddress, TheValue, 4, 0&
    CloseHandle hProcess
    End Function
    
     
    
    Public Function ReadAFloat(TheGame As String, TheAddress As Long, TheValue As Single)
    Dim SomeValueIsStoredHere As Long
    Dim SomeValueIsStoredHereToo As Long
    Dim SomeValue As Long
    SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
    GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
    SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
    If (SomeValue = 0) Then
        Exit Function
    End If
    ReadProcessMem SomeValue, TheAddress, TheValue, 4, 0&
    CloseHandle hProcess
    End Function
    
     
    
    Public Function WriteAFloat(TheGame As String, TheAddress As Long, ThisIsTheValue As Single)
    Dim SomeValueIsStoredHere As Long
    Dim SomeValueIsStoredHereToo As Long
    Dim SomeValue As Long
    SomeValueIsStoredHere = FindWindow(vbNullString, TheGame)
    GetWindowThreadProcessId SomeValueIsStoredHere, SomeValueIsStoredHereToo
    SomeValue = OpenProcess(PROCESS_ALL_ACCESS, False, SomeValueIsStoredHereToo)
    If (SomeValue = 0) Then
        Exit Function
    End If
    WriteProcessMemory SomeValue, TheAddress, ThisIsTheValue, 4, 0&
    CloseHandle hProcess
    End Function

    Original Code by Diamondo25

    Get your HEX code with cheat engine... I hope you know how to do this.. If not reply and i will show you how.

    Use this in your form

    &HA00000 = HEX CODE
    999999 = VALUE TO CHANGE TO

    Code:
    Call WriteALong("TITLE OF APP", &HA00000, 99)
    

    There are TONS more functions in that module.. look at em :)
     
< Scion Needs A Dev | lil question about client i am working on... >

Users viewing this thread
1 guest


 
 
Adblock breaks this site