Jump to content

Writing Memory


Recommended Posts

Ok, I really don't understand any of the read and write memory functions in AutoIt. It would be greatly appreciated if someone could write one for me or something? Here is all the information you will need:

Process Name: WoW.exe
Address: 8A1F04
Value To Write: 1

All I need is to write to that. Nothing else, no freezing or anything. It would be really appreciated if anyone could give me help in any way. Thanks.

Link to comment
Share on other sites

I doubt that adress is the same for me as it was for you since i cant see any pointers, and i also doubt blizzard would not use like a gazzilion pointers.

UDF:Crypter a file encrypt / decrypt tool with no need to remember a password again. Based on Caesar cipher using entire ASCII Table.Script's: PixelSearch Helper, quick and simple way to create a PixelSeach.Chatserver - simplified, not so complicated multi-socket server.AutoIT - Firewall, simple example on howto create a firewall with AutoIt.
Link to comment
Share on other sites

Don't be so quick to judge, Jokke. I got that address from a friend. He told me to change the value to 1, and I would have a Mountain Climbing Hack, and it worked. Aslo worked for about a thousand others who tried it. But my objective is to get it to work in Autoit, automatically so the noobies won't have to do as much.

Link to comment
Share on other sites

I did some research, but couldn't find any functions for reading/writing to memory, except w0uters, but his way is way too confusing. I know the program called Syndrome written in AutoIt has a working one, unfortunatley i deleted the source code off my computer and edgeofnowhere deleted theirs too. >< any information and anything is appreciated now.. desperate for help..

--Edit--

Can't spell

Edited by =sinister=
Link to comment
Share on other sites

Based off of W0uters. My own little spin off.

#include-once

;--Memory Functions--
Func _OpenProcess($hWnd, $use_pid=0)
    If $use_pid = 0 Then
        Local $pid = DllCall("user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $hWnd, "int_ptr", 0)
        If IsArray($pid) Then
            $pid = $pid[2]
        Else
            SetError(-1)
            Return
        EndIf
    Else
        Local $pid = $hWnd
    EndIf
    
    Local $pHandle = DllCall("kernel32.dll", "int", "OpenProcess", "int", 0x1F0FFF, "int", 0, "int", $pid)
    If IsArray($pHandle) And $pHandle[0] > 0 Then
        $pHandle = $pHandle[0]
    Else
        SetError(-2)
        Return
    EndIf
    
    Return $pHandle
EndFunc

Func _CloseHandle($pHandle)
    DllCall("kernel32.dll", "int", "CloseHandle", "int", $pHandle)
EndFunc

Func _ReadMemory($pHandle, $Address, $size)
    Local $ret = DllCall("kernel32.dll", "int", "ReadProcessMemory", "int", $pHandle, "int", $Address, "int_ptr", 0, "int", $size, "int", 0)
    If IsArray($ret) Then
        If $ret[0] = 1 Then
            $ret = $ret[3]
        Else
            SetError(-2)
            Return
        EndIf
    Else
        SetError(-1)
        Return
    EndIf

    
    Return $ret
EndFunc

Func _ReadFloat($pHandle, $Address)
    Local $floatReturn = 0
    Local $float = DllStructCreate("float")
    Local $ret = DllCall("kernel32.dll", "int", "ReadProcessMemory", "int", $pHandle, "int", $Address, "ptr", DllStructGetPtr($float), "int", 4, "int", 0)
    If IsArray($ret) Then
        If $ret[0] = 1 Then
            $floatReturn = DllStructGetData($float, 1)
        Else
            SetError(-1)
        EndIf
    Else
        SetError(-2)
    EndIf
    
    Return $floatReturn
EndFunc

Func _ReadString($pHandle, $Address, $length)
    Local $ret, $tmpStr = ""
    For $i = 0 To $length - 1
        $ret = DllCall("kernel32.dll", "int", "ReadProcessMemory", "int", $pHandle, "int", $Address + $i, "int_ptr", 0, "int", 1, "int", 0)
        If IsArray($ret) Then
            If $ret[0] = 1 Then
                If $ret[3] > 0 Then
                    $tmpStr = $tmpStr & Chr($ret[3])
                Else
                    ExitLoop
                EndIf
            Else
                SetError(-2)
                Return
            EndIf
        Else
            SetError(-1)
            Return
        EndIf
    Next
    
    Return $tmpStr
EndFunc

Func _WriteMemory($pHandle, $Address, $value, $size)
    Local $ret = DllCall("kernel32.dll", "int", "WriteProcessMemory", "int", $pHandle, "int", $Address, "int_ptr", $value, "int", $size, "int", 0)
    If IsArray($ret) Then
        If $ret[0] = 1 Then
            Return True
        Else
            SetError(-2)
            Return False
        EndIf
    Else
        SetError(-1)
        Return False
    EndIf
    
    Return True
EndFunc

Func _WriteFloat($pHandle, $Address, $value)
    Local $float = DllStructCreate("float")
    DllStructSetData($float, 1, $value)
    Local $ret = DllCall("kernel32.dll", "int", "WriteProcessMemory", "int", $pHandle, "int", $Address, "ptr", DllStructGetPtr($float), "int", 4, "int", 0)
    If IsArray($ret) Then
        If $ret[0] = 1 Then
            Return True
        Else
            SetError(-2)
            Return False
        EndIf
    Else
        SetError(-1)
        Return False
    EndIf
EndFunc

Func _WriteString($pHandle, $Address, $string)
    Local $ret
    Local $length = StringLen($string)
    For $i = 0 To $length       
        $ret = DllCall("kernel32.dll", "int", "WriteProcessMemory", "int", $pHandle, "int", $Address + $i, "int_ptr", Asc(StringMid($string, $i + 1, 1)), "int", 1, "int", 0)
        If IsArray($ret) Then
            If $ret[0] = 0 Then
                SetError(-2)
                Return False
            EndIf
        Else
            SetError(-1)
            Return False
        EndIf
    Next
    
    Return True
EndFunc

[font="Verdana"]Valik:Get it straight - I'm not here to say please, I'm here to help - if my help's not appreciated then lotsa luck, gentlemen.[/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...