Strptr Can Be Fully Replaced Without Any Problems
KarCrack made some error Try This
'KERNEL32
Private Declare Function VarPtr__ Lib "KERNEL32" Alias "MulDiv" (ByRef a As Any, Optional ByVal b As Long = 1, Optional ByVal c As Long = 1) As Long
'MSVBVM60
Private Declare Sub GetMem4 Lib "MSVBVM60" (ByVal lPtr As Long, ByRef ret As Long)
'USER32
Private Declare Function MessageBoxW Lib "USER32" (ByVal hWnd As Long, ByVal lpText As Long, ByVal lpCaption As Long, ByVal wType As Long) As Long
Private Sub Form_Load()
Dim cadena As String
Dim ptr1 As Long
Dim ptr2 As Long
cadena = "karcrack"
ptr1 = StrPtr(cadena)
'StrPtr__
Call GetMem4(VarPtr__(cadena) + 8, ptr2)
MsgBox (ptr1 = ptr2)
Call MessageBoxW(0, ptr2, 0, 0)
Call MessageBoxW(0, ptr1, 0, 0)
End Sub
STPRT Get the BSTR Address(where the string is stored) so is simple get it
Readmemory(Varptr + 8) = BSTR
enjoy
This won't work on every situation I just tried.