Jump to content

DllStructGetPtr,DllStructGetdata,DllStructGetSize,DllStructSetData,DllStructCreate


Recommended Posts

Posted (edited)

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

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
  • Recently Browsing   0 members

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