delphi 搜索内存偏移函数


本文整理自网络,侵删。

  

//搜索内存偏移函数
//来源C++代码,翻译的
//Code By htrlq
//参数说明
//第一个参数:
//要搜索的内存地址
//第二个参数:
//搜索的字符串
//第三个参数:
//内存大小
//第四个参数:
//搜索的字符串长度


function MemFindStr(strMem,strSub:PChar;iSizeMem,isizeSub:LongWord):Integer;
var
da,i,j:Integer;
tmp,tmp2:Char;
begin
Result:=0;
if isizeSub = 0 then
      da:=lstrlen(strSub)
else
      da:=isizeSub-1;
for i:=0 to iSizeMem-1 do
begin
      for j:=0 to da do
      begin
        tmp2:=strSub[j];
        tmp:=strMem[i+j];
        if tmp <> tmp2 then
        Break;
        if j = da then
        begin
          Result:=i;
          Exit;
        end;
      end;
end;
end;


相关阅读 >>

Delphi jpg图片 旋转 切边 缩放

Delphi playsound(); 停止播放

Delphi webbrowser1 缩放网页

Delphi 检测用户超过多长时间没有操作键盘或鼠标

Delphi使用project manager添加一个java库到你的应用程序

Delphi 简化版的inputquery 中文版输入对话框

Delphi 超短精简进制转换

Delphi10.x dpr文件

Delphi word文档内容批量替换

Delphi 时间与相关类型(2) - tdate、ttime、ttimestamp

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...