Jump to content

DllStructGetPtr,DllStructGetdata,DllStructGetSize,DllStructSetData,DllStructCreate


SeKaSoft
 Share

Recommended Posts

Greetings to everyone

DllStructGetPtr,DllStructGetdata,DllStructGetSize,DllStructSetData,DllStructCreate 
I really need these functions for C#, can you help me?

Quote

Func _memorypointerwrite($address, $handle, $offset, $data, $type = "dword", $8byte = False)
        Local $buffer_data, $i
        $pointercount = UBound($offset) - 1
        If $8byte Then
            $buffer = DllStructCreate("LONG_PTR")
        Else
            $buffer = DllStructCreate("dword")
        EndIf
        For $i = 0 To $pointercount
            If ($i == $pointercount) Then
                $buffer = DllStructCreate($type)
                DllStructSetData($buffer, 1, $data)
                $address = "0x" & Hex(Int(($buffer_data) + $offset[$i]))
                $pointerwrite = _winapi_writeprocessmemory($handle, $address, DllStructGetPtr($buffer), DllStructGetSize($buffer), $v_data)
                Return $address
            ElseIf ($i == 0) Then
                _winapi_readprocessmemory($handle, $address, DllStructGetPtr($buffer), DllStructGetSize($buffer), $v_data)
                $buffer_data = DllStructGetData($buffer, 1)
            Else
                $address = "0x" & Hex(Int(($buffer_data) + $offset[$i]))
                _winapi_readprocessmemory($handle, $address, DllStructGetPtr($buffer), DllStructGetSize($buffer), $v_data)
                $buffer_data = DllStructGetData($buffer, 1)
            EndIf
        Next
        If @error Then
            Return -1
        EndIf
        Return True
    EndFunc

 

Edited by SeKaSoft
Link to comment
Share on other sites

22 hours ago, SeKaSoft said:

I really need these functions for C#, can you help me?

Is not in the forum rules but, this is an AutoIt forum. You should ask at a C# forum. You will find more people using C# at such forum than you'll find here.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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