Skip to content

Instantly share code, notes, and snippets.

Created March 24, 2012 00:06
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save kumatti1/2176573 to your computer and use it in GitHub Desktop.
Option Explicit
Private Declare Sub RtlMoveMemory Lib "Kernel32.dll" (ByVal Destination&, ByVal Source&, ByVal length&)
Sub hoge()
Dim vtbl&()
Dim pVtbl&, pObj&, size&, i&
Dim unk As stdole.IUnknown
ReDim vtbl(0 To 25) '適当
size = (UBound(vtbl) + 1) * 4
Set unk = Application
pObj = ObjPtr(unk)
RtlMoveMemory VarPtr(pVtbl), pObj, 4
RtlMoveMemory VarPtr(vtbl(0)), pVtbl, size
For i = 0 To UBound(vtbl)
' Debug.Print Hex$(vtbl(i)); vbCrLf
Debug.Print vtbl(i); vbCrLf
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment