Jump to content

How would you make autoit read pixels on Diablo 2?


Recommended Posts

I awnt it to read pixels in a certain area for text, and if the certain text = "ThisText" do this:

send("Blah!")

how would I be able to do this? :P

thanks :(

No, haha I tried. You will have to use Memory Editing, which can get you banned from Diablo II.
Link to comment
Share on other sites

Really? For just reading someones text? :(

other people can do it though, like my friend, but he doesn't use autoit :idea:

Using a pixel would be very tough, as you would have to check for every pixel in every letter, for the amount of text. He is most likely using memory reading and editing, to get the chat message. I can get you the memory functions you need, if you want to take the risk of using memory stuff.

Here was my topic. :P

http://www.autoitscript.com/forum/index.ph...c=61512&hl=

Link to comment
Share on other sites

Blizzard scans Diablo II's memory almost everyday, and If there is a change in the memory or reading it, they could ban you. Heres the code if you want it.

MsgBox(0, "", "Log Into BNET and enter a game...")

$OriginalMsg = DiabloGetChatMessage()
Do
    $NewMsg = DiabloGetChatMessage()
    If Not $OriginalMsg = $NewMsg Then MsgBox(0, "", "New Chat Message...   " & $NewMsg)
    $OriginalMsg = $NewMsg
Until 1+2=1

Func DiabloGetChatMessage()
    Local $Handle = _MemoryOpen(WinGetProcess("Diablo II"))
    Local $pointer1 = _MemoryRead(0x6FBCB830, $Handle, 'dword')
    Local $pointer2 = _MemoryRead($pointer1, $Handle, 'dword')
    Local $Temp = _MemoryReadWideString($pointer2, $Handle, 'ushort[256]')
    _MemoryClose($Handle)
    Return $Temp
EndFunc   ;==>GetLastChatMessage

Func _MemoryOpen($iv_Pid, $iv_DesiredAccess = 0x1F0FFF, $iv_InheritHandle = 1)
    If Not ProcessExists($iv_Pid) Then
        SetError(1)
        Return 0
    EndIf
    Local $ah_Handle[2] = [DllOpen('kernel32.dll')]
    If @error Then
        SetError(2)
        Return 0
    EndIf
    Local $av_OpenProcess = DllCall($ah_Handle[0], 'int', 'OpenProcess', 'int', $iv_DesiredAccess, 'int', $iv_InheritHandle, 'int', $iv_Pid)
    If @error Then
        DllClose($ah_Handle[0])
        SetError(3)
        Return 0
    EndIf
    $ah_Handle[1] = $av_OpenProcess[0]
    Return $ah_Handle
EndFunc   ;==>_MemoryOpen

Func _MemoryRead($iv_Address, $ah_Handle, $sv_Type = 'dword')
    If Not IsArray($ah_Handle) Then
        SetError(1)
        Return 0
    EndIf
    Local $v_Buffer = DllStructCreate($sv_Type)
    If @error Then
        SetError(@error + 1)
        Return 0
    EndIf
    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
    If Not @error Then
        Local $v_Value = DllStructGetData($v_Buffer, 1)
        Return $v_Value
    Else
        SetError(6)
        Return 0
    EndIf
EndFunc   ;==>_MemoryRead

Func _MemoryReadWideString($iv_Address, $ah_Handle, $sv_Type = 'ushort[255]')
    If Not IsArray($ah_Handle) Then
        SetError(1)
        Return 0
    EndIf
    Local $v_Buffer = DllStructCreate($sv_Type)
    If @error Then
        SetError(@error + 1)
        Return 0
    EndIf
    DllCall($ah_Handle[0], 'int', 'ReadProcessMemory', 'int', $ah_Handle[1], 'int', $iv_Address, 'ptr', DllStructGetPtr($v_Buffer), 'int', DllStructGetSize($v_Buffer), 'int', '')
    If Not @error Then
        $tmpString = ""
        For $char = 1 To 255
            $v_Value = DllStructGetData($v_Buffer, 1, $char)
            If $v_Value = 0 Then ExitLoop
            $tmpString = $tmpString & Chr($v_Value)
        Next
        Return $tmpString
    Else
        SetError(6)
        Return 0
    EndIf
EndFunc   ;==>_MemoryReadWideString
Link to comment
Share on other sites

Add this to it...

Func _MemoryClose($ah_Handle)
    If Not IsArray($ah_Handle) Then
        SetError(1)
        Return 0
    EndIf
    DllCall($ah_Handle[0], 'int', 'CloseHandle', 'int', $ah_Handle[1])
    If Not @error Then
        DllClose($ah_Handle[0])
        Return 1
    Else
        DllClose($ah_Handle[0])
        SetError(2)
        Return 0
    EndIf
EndFunc  ;==>_MemoryClose
Link to comment
Share on other sites

  • 1 month later...

Just curious about Windows API, why READING memory (not EDITTING) would be detected? How can a third process know my process is reading the memory of another process?

warden probably looks for suspicous program names that read the memory. just try to get a safe name and you will be fine.

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...