Option Base 0
'code: golds7n
Private Declare Sub CopyMemory Lib "kernel32.dll" Alias "RtlMoveMemory" (ByVal Destination As Any, ByVal Source As Any, ByVal Length As Long)
Private Declare Function GetModuleHandle Lib "kernel32.dll" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Private Declare Function CloseHandle Lib "kernel32.dll" (ByVal hObject As Long) As Long
Private Declare Function SetWindowPos Lib "user32.dll" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Function GetPointH() As Long
Dim lHandle As Long
Dim i As Long
Dim k As Long
Dim a() As Byte
Dim fLong As Long
Dim keyLen As Long
Dim key() As Byte
Const fkey = "F3A58BC883E103F3A4E8" 'point-h sign
keyLen = Len(fkey) / 2
ReDim key(1 To keyLen)
For k = 1 To keyLen
key(k) = CByte("&H" & Mid(fkey, k * 2 - 1, 2))
Next
lHandle = GetModuleHandle("user32.dll")
ReDim a(&H60000)
CopyMemory VarPtr(a(0)), lHandle, UBound(a) + 1
fLong = 0
i = LBound(a)
Do While i < UBound(a)
For k = 1 To keyLen
If a(i + k - 1) <> key(k) Then
Exit For
End If
Next
If k > keyLen Then
fLong = i
Exit Do
End If
i = i + 1
Loop
CloseHandle lHandle
Erase a
GetPointH = fLong + lHandle
End Function
Private Sub cmdfind_Click()
TxtAddr = Hex(GetPointH())
End Sub