/ Forside / Teknologi / Udvikling / VB/Basic / Nyhedsindlæg
Login
Glemt dit kodeord?
Brugernavn

Kodeord


Reklame
Top 10 brugere
VB/Basic
#NavnPoint
berpox 2425
pete 1435
CADmageren 1251
gibson 1230
Phylock 887
gandalf 836
AntonV 790
strarup 750
Benjamin... 700
10  tom.kise 610
Access memmory from VB?
Fra : Casper Bang


Dato : 28-02-01 22:08

In VB, how do I access the memmory at a given offset and read/write the hex
values?

Thanks,
Casper



 
 
J French (01-03-2001)
Kommentar
Fra : J French


Dato : 01-03-01 10:00

I guess this is what you want :-


Private Declare Sub MoveMemory _
Lib "KERNEL32" _
Alias "RtlMoveMemory" _
(ByVal Dest As Any, _
ByVal Source As Any, _
ByVal Bytes As Long)

Private Declare Sub MoveString _
Lib "KERNEL32" _
Alias "RtlMoveMemory" _
(Dest As Any, _
ByVal Source As String, _
ByVal Bytes As Long)


Private Sub Poke(MemLoc&, B As Byte)
Call MoveMemory(MemLoc, VarPtr(B), 1)
End Sub

Private Function Peek(MemLoc&) As Byte
Dim Q As Byte
Call MoveMemory(VarPtr(Q), MemLoc, 1)
Peek = Q
End Function

Private Sub Command1_Click()
Dim A%

A = 255
MsgBox Str$(Peek(VarPtr(A)))
Poke VarPtr(A), 1
MsgBox Str$(A)
End Sub



On Wed, 28 Feb 2001 22:07:52 +0100, "Casper Bang" <casper@jbr.dk>
wrote:

>In VB, how do I access the memmory at a given offset and read/write the hex
>values?
>
>Thanks,
>Casper
>
>


Hai Li (07-03-2001)
Kommentar
Fra : Hai Li


Dato : 07-03-01 10:51

Please take a look at http://www.zealsoftstudio.com/memaccess/


> On Wed, 28 Feb 2001 22:07:52 +0100, "Casper Bang" <casper@jbr.dk>
> wrote:
>
> >In VB, how do I access the memmory at a given offset and read/write the hex
> >values?
> >
> >Thanks,
> >Casper
> >
> >
>

--
_____________________________________________
Hai Li mailto:haili@public.bta.net.cn
Zeal SoftStudio (P.R. China)
http://www.zealsoftstudio.com (English)
http://www.nease.net/~zealsoft/ (Chinese)


Søg
Reklame
Statistik
Spørgsmål : 177558
Tips : 31968
Nyheder : 719565
Indlæg : 6408929
Brugere : 218888

Månedens bedste
Årets bedste
Sidste års bedste