VB编程:利用地址偏移访问内存-42_彭世瑜_新浪博客

81 阅读1分钟

1、运行效果

VB编程:利用地址偏移访问内存-42
\

\

2、程序代码;

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

\

Private Sub Form_Load()

    Dim i As Long

    Dim j As Long

    i = 1234

    j = 4321

    CopyMemory ByVal VarPtr(i), ByVal VarPtr(i) - 4, 4

    Text1.Text = i

End Sub