Ai
1 Star 0 Fork 0

phy0292/cheat-engine

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
changelist.pas 1.99 KB
一键复制 编辑 原始数据 按行查看 历史
unit changelist;
{
changelist is a helper class for the hexview
it keeps a list of entries containing lastvalue and timestamp of the last time it changed
}
{$mode delphi}
interface
uses
{$IFNDEF STANDALONEHV}
{$ifdef darwin}
macport,
{$endif}
{$ifdef windows}
windows,
{$endif}
{$ENDIF}
Classes, SysUtils;
type TChangeList=class
private
lastaddress: ptrUint;
list: array of record
value: string;
LastChange: dword; //tickcount of the last time it was changed
end;
procedure SetValue(i: integer; value: string);
function GetValue(i: integer): string;
function getLastChange(i: integer): dword;
public
procedure ClearLastChange;
procedure Clear;
procedure Initialize(address: ptrUint; size: integer);
property Values[index: integer]: string read getValue write setValue;
property LastChange[index: integer]: dword read getLastChange;
end;
implementation
function TChangeList.getLastChange(i: integer): dword;
begin
result:=list[i].LastChange;
end;
procedure TChangeList.SetValue(i: integer; value: string);
begin
if (list[i].value<>'') and (list[i].value<>value) then
list[i].LastChange:=Gettickcount;
list[i].value:=value;
end;
function TChangeList.GetValue(i: integer): string;
begin
result:=list[i].value;
end;
procedure TChangeList.ClearLastChange;
var i: integer;
begin
for i:=0 to length(list)-1 do
list[i].Lastchange:=0;
end;
procedure TChangeList.clear;
var i: integer;
begin
for i:=0 to length(list)-1 do
begin
list[i].value:='';
list[i].Lastchange:=0;
end;
end;
procedure TChangeList.Initialize(address: ptrUint; size: integer);
{
sets the size of the list, returns true if a Clear might be needed
}
var i: integer;
begin
if size>0 then
begin
if (address<>lastaddress) or (length(list)<>size) then
begin
lastaddress:=address;
setlength(list,size);
clear;
end;
end;
end;
end.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/phy0292/cheat-engine.git
git@gitee.com:phy0292/cheat-engine.git
phy0292
cheat-engine
cheat-engine
master

搜索帮助