📄 opensave.pas
字号:
for k:=0 to tempi-1 do
begin
trainer.readBuffer(trainerdata[i].addressentrys[j].pointers[k].address,sizeof(trainerdata[i].addressentrys[j].pointers[k].address));
trainer.readBuffer(trainerdata[i].addressentrys[j].pointers[k].offset,sizeof(trainerdata[i].addressentrys[j].pointers[k].offset));
end;
trainer.ReadBuffer(trainerdata[i].addressentrys[j].bit,sizeof(trainerdata[i].addressentrys[j].bit));
trainer.ReadBuffer(trainerdata[i].addressentrys[j].memtyp,sizeof(trainerdata[i].addressentrys[j].memtyp));
trainer.Readbuffer(trainerdata[i].addressentrys[j].frozen,sizeof(trainerdata[i].addressentrys[j].frozen));
trainer.Readbuffer(trainerdata[i].addressentrys[j].frozendirection,sizeof(trainerdata[i].addressentrys[j].frozendirection));
trainer.Readbuffer(trainerdata[i].addressentrys[j].setvalue,sizeof(trainerdata[i].addressentrys[j].setvalue));
trainer.ReadBuffer(trainerdata[i].addressentrys[j].userinput,sizeof(trainerdata[i].addressentrys[j].userinput));
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
trainerdata[i].addressentrys[j].value:=x;
freemem(x);
// trainer.Readbuffer(trainerdata[i].addressentrys[j].value,50);
if trainerdata[i].addressentrys[j].userinput then
begin
trainerdata[i].hasedit:=true;
trainerdata[i].editvalue:=trainerdata[i].addressentrys[j].value;
end;
end;
end;
//title
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
edittitle.Text:=x;
freemem(x);
//launch filename
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
edit2.Text:=x;
freemem(x);
//autolaunch
trainer.ReadBuffer(tempb,sizeof(tempb));
checkbox2.Checked:=tempb;
//popup on keypress
trainer.ReadBuffer(tempb,sizeof(tempb));
checkbox1.Checked:=tempb;
//process name
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
combobox1.Text:=x;
freemem(x);
//hotkeytext
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
edithotkey.Text:=x;
freemem(x);
//hotkey+shiftstate
trainer.ReadBuffer(laststate,sizeof(laststate));
trainer.ReadBuffer(lastshiftstate,sizeof(lastshiftstate));
//abouttext
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
memo1.Text:=x;
freemem(x);
trainer.ReadBuffer(temp,4);
if temp=$666 then
begin
//default
//leftside image
trainer.ReadBuffer(temp,4); //size of the image
if temp>0 then
begin
//getmem(image,temp);
//trainer.ReadBuffer(image^,temp);
frmMemorytrainerpreview.Image1.Picture.Bitmap.LoadFromStream(trainer);
end;
//windowwidth
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.Width));
frmMemorytrainerpreview.Width:=temp;
//windowheight
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.height));
frmMemorytrainerpreview.height:=temp;
//leftsidewidth
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.Panel1.Width));
frmMemorytrainerpreview.Panel1.Width:=temp;
//leftsideheight
trainer.readbuffer(temp,sizeof(frmMemorytrainerpreview.Panel1.height));
frmMemorytrainerpreview.Panel1.height:=temp;
end
else
begin
//user defined
frmMemoryModifier.dontshowdefault:=true; //obsolete
frmMemoryModifier.Button7.Click;
//windowwidth
trainer.readbuffer(temp,4);
frmTrainerDesigner.Width:=temp;
//windowheight
trainer.readbuffer(temp,4);
frmTrainerDesigner.height:=temp;
while true do
begin
trainer.ReadBuffer(temp,4);
case temp of
0: begin
//tbutton
with tbutton2.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
//caption
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
caption:=x;
freemem(x);
//onclick
trainer.ReadBuffer(temp,sizeof(tag));
tag:=temp;
parent:=frmTrainerDesigner;
//command
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
command:=x;
freemem(x);
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
1: begin
//cheatlist
with tcheatlist.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
trainer.ReadBuffer(tempc,sizeof(tcolor));
activationcolor:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
color:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
textcolor:=tempc;
trainer.ReadBuffer(tempi,sizeof(integer));
hotkeyleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
descriptionleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editwidth:=tempi;
trainer.ReadBuffer(tempbc,sizeof(tbevelcut));
bevelinner:=tempbc;
trainer.ReadBuffer(tempbc,sizeof(tbevelcut));
bevelouter:=tempbc;
trainer.ReadBuffer(tempi,sizeof(integer));
bevelwidth:=tempi;
trainer.ReadBuffer(tempbk,sizeof(tbevelkind));
bevelkind:=tempbk;
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
2: begin
//tcheat
with tcheat.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
trainer.ReadBuffer(cheatnr,sizeof(integer));
trainer.ReadBuffer(tempc,sizeof(tcolor));
activationcolor:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
color:=tempc;
trainer.ReadBuffer(tempc,sizeof(tcolor));
textcolor:=tempc;
trainer.ReadBuffer(tempi,sizeof(integer));
hotkeyleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
descriptionleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editleft:=tempi;
trainer.ReadBuffer(tempi,sizeof(integer));
editwidth:=tempi;
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
3: begin
//timage
with timage2.create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
trainer.ReadBuffer(tempcursor,sizeof(tcursor));
cursor:=tempcursor;
trainer.ReadBuffer(tempb,sizeof(tempb));
stretch:=tempb;
trainer.ReadBuffer(tempb,sizeof(tempb));
transparent:=tempb;
trainer.ReadBuffer(tempi,sizeof(integer));
tag:=tempi;
trainer.ReadBuffer(temp,4);
if temp>0 then
begin
picture.Bitmap.LoadFromStream(trainer);
end;
//command
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
command:=x;
freemem(x);
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
4: begin
with tlabel2.Create(frmTrainerDesigner) do
begin
trainer.ReadBuffer(temp,sizeof(integer));
left:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
top:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
width:=temp;
trainer.ReadBuffer(temp,sizeof(integer));
height:=temp;
//caption
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
caption:=x;
freemem(x);
//wordwrap
trainer.ReadBuffer(tempb,sizeof(boolean));
wordwrap:=tempb;
//color
trainer.ReadBuffer(tempc,sizeof(tcolor));
font.Color:=tempc;
//command
trainer.ReadBuffer(temp,4);
getmem(x,temp+1);
trainer.ReadBuffer(x^,temp);
x[temp]:=#0;
command:=x;
freemem(x);
//cursor
trainer.ReadBuffer(tempcursor,sizeof(tcursor));
cursor:=tempcursor;
//tag
trainer.ReadBuffer(tempi,sizeof(integer));
tag:=tempi;
trainer.ReadBuffer(tempb,sizeof(tempb));
if tempb then
Font.Style:=[fsUnderline]
else
Font.Style:=[];
parent:=frmTrainerDesigner;
onmousedown:=frmTrainerDesigner.MouseDown;
onmousemove:=frmTrainerDesigner.MouseMove;
onmouseup:=frmTrainerDesigner.MouseUp;
end;
end;
$ffffffff: break;
else raise exception.Create(strunknowncomponent+Inttostr(temp));
end;
end;
end;
end;
//fill in the list of cheats
for i:=0 to length(frmMemoryModifier.trainerdata)-1 do
begin
frmMemoryModifier.recordview.Items.Add.caption:=frmMemoryModifier.trainerdata[i].description;
frmMemoryModifier.recordview.Items[frmMemoryModifier.recordview.Items.count-1].SubItems.add(frmMemoryModifier.trainerdata[i].hotkeytext);
end;
frmMemoryTrainerPreview.UpdateScreen;
if frmtrainerdesigner<>nil then frmtrainerdesigner.updatecheats
end;
procedure LoadTrainer3(trainer:tfilestream);
var temp: dword;
tempb: boolean;
tempc: tcolor;
tempi: integer;
tempbc: tbevelcut;
tempbk: tbevelkind;
tempcursor: tcursor;
i,j,k:integer;
x: pchar;
image: pointer;
// trainerdata1: array of TTrainerData1;
begin
with frmMemoryModifier do
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -