关于类型的转换(字符串转换为内存地址)(100分)

  • 主题发起人 主题发起人 DelphiVip
  • 开始时间 开始时间
D

DelphiVip

Unregistered / Unconfirmed
GUEST, unregistred user!
-----------------------------------------------------------------<br>ReadProcessMemory(ProcessID, Pointer($01992450), @ECX, 4, Num);<br>-----------------------------------------------------------------<br>现在我想变形下.<br><br>a:string;<br>a:='$01992450';<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br>读取内存地址: ReadProcessMemory(ProcessID, Pointer(a), @ECX, 4, Num);<br><br>这样不可以,如何将内存地址指向a的内容呢?.
 
ReadProcessMemory(ProcessID, Pointer(strtoint(a)), @ECX, 4, Num);<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>var a:string;<br>begin<br>&nbsp; &nbsp; &nbsp;a := '$01992450';<br>&nbsp; &nbsp; &nbsp;Memo1.Lines.add(Format('%p', [Pointer(strtoint(a))]));<br>end;
 
已经测试,还是没用... - -! <br>a := '$01992450';<br>ReadProcessMemory(ProcessID, Pointer(strtoint(a)), @ECX, 4, Num);<br><br>当strtoint(a)时 被转换成10 进制 <br><br>Pointer(十进制数) 能找到地址吗?
 
i := Integer('$01992450');//字符串$01992450的地址<br>s := string(i); //还原字符串
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
1K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
900
SUNSTONE的Delphi笔记
S
I
回复
0
查看
724
import
I
后退
顶部