⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit2.pas.svn-base

📁 这是一段游戏修改工具的源代码.ring3功能由dephi开发,驱动是C开发.希望对大家有帮助
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
  else if memrec[j].VarType=5 then raise Exception.Create(IntToHex(address,8)+'^'+IntToStr(memrec[j].bit)+' with length of '+IntToStr(nrofbits)+' bits, is already in the list!') else                                   raise Exception.Create(IntToHex(address,8)+' is already in the list!');  updatescreen;  updatelist;  scrollbar1.Position:=scrollbar1.Max-numberoflines+2;end;procedure TMainForm.SpeedButton3Click(Sender: TObject);var i: Integer;    morein: boolean;begin  morein:=false;  for i:=0 to foundlist.Items.Count-1 do    try      if foundlist.Selected[i] then AddToRecord(i);    except      if foundlist.SelCount=1 then raise exception.Create('This address is already in the list') else morein:=true;    end;  if morein then showmessage('One or more addresses where already in the list');  FControl.SetFocus;end;procedure TMainForm.Deletethisrecord1Click(Sender: TObject);var i,j: Integer;    comfirm: Word;    deletegroup: grouptype;    IsGroup: boolean;    multiplegroups: boolean;begin  //delete selectedrecord  isgroup:=false;  multiplegroups:=false;  for i:=1 to 4 do deletegroup[i]:=false;  i:=0;  j:=0;  while (i<numberofrecords) do  begin    if selected[i] then    begin      inc(j);      if memrec[i].Group>0 then      begin        if isgroup and (deletegroup[memrec[i].Group]) then multiplegroups:=true;        deletegroup[memrec[i].Group]:=true;        isgroup:=true;      end;    end;    inc(i);  end;  comfirm:=MrNo;  if j>1 then comfirm:=Messagedlg('Delete these addresses?', mtWarning, [mbYes, mbNo], 0);  if j=1 then comfirm:=Messagedlg('Delete this address?', mtWarning, [mbYes, mbNo], 0);  if j=0 then exit;  if comfirm=mrNo then exit;  if isgroup and not multiplegroups then comfirm:=Messagedlg('Also delete the group this address is a member of?', mtConfirmation, [mbYes, mbNo], 0);  if isgroup and multiplegroups then comfirm:=Messagedlg('Also delete the groups of the addresses you selected?', mtConfirmation, [mbYes, mbNo], 0);  deleterecords;  if comfirm=mrYes then deletegroups(deletegroup);end;procedure TMainForm.ScrollBar1Change(Sender: TObject);begin  updatescreen;  updatelist;  end;procedure TMainForm.NewScanClick(Sender: TObject);var FromAdd,ToAdd:Dword;    error: Integer;//    Tim,Tim2: TTimeStamp;    Vtype,SType: Integer;    Processhandle2: Thandle;    i: integer;    value: string;    templist: TStringlist;    res: word;    extra: boolean;    lastscantype: integer;begin  if not processopened then exit;  try  screen.Cursor:=crhourglass;//first makesure all files used are closed (normaly not needed but there is this weird bug files are not closed...)//  addressfile, memoryfile: File;//  newAddressfile,newmemoryfile: File;  advanced:=false;  undoscan.enabled:=false;  lastscantype:=scantype.ItemIndex;  VType:=GetVarType;  SType:=GetScanType;  foundlist.Clear;  if not nextscanbutton.Enabled then //it's a first scan  begin    if scanvalue.visible then    if scanvalue.text='' then raise Exception.Create('Please fill in something!');    val('$'+FromAddress.text,FromAdd,error);    val('$'+ToAddress.text,ToAdd,error);    foundlabel.visible:=true;    if max>32000 then raise Exception.Create('The max number of addresses to show may not be set higher than 32000');    mainform.caption:=CERegionSearch;    application.ProcessMessages;    foundlabel.caption:='';    foundlist.items.clear;    //send scan    output[0]:=CS_FirstScan;    pdword(@output[1])^:=FromAdd;    pdword(@output[5])^:=ToAdd;    output[9]:=vtype;    output[10]:=stype;    output[11]:=    length(scanvalue.text);    if output[11]=0 then    begin      output[11]:=1;      output[12]:=0;    end    else copymemory(@output[12],@scanvalue.text[1],output[11]);    output[12+output[11]]:=0;    if cbFastscan.checked then output[12+output[11]]:=output[12+output[11]] or SO_FASTSCAN;    if HexaDecimalCheckbox.checked then output[12+output[11]]:=output[12+output[11]] or SO_HEXADECIMAL;    if readonly.checked then output[12+output[11]]:=output[12+output[11]] or SO_READONLY;    if cbunicode.checked then output[12+output[11]]:=output[12+output[11]] or SO_UNICODE;    sendbuf(12+output[11]+1);    formscanning:=TFormscanning.create(self);    res:=formscanning.showmodal;    setfoundlisthorizontal;    progressbar1.Position:=0;    mainform.Caption:=CEnorm;    if res=mrCancel then    begin      exit;    end;    Groupbox1.Enabled:=false;    for i:=0 to groupbox1.ControlCount-1 do      groupbox1.Controls[i].Enabled:=false;    vartype.Enabled:=false;    nextscanbutton.enabled:=true;    newscan.Caption:='New Scan';    beep;    UpdateScanType;    Scantype.ItemIndex:=lastscantype;    screen.Cursor:=crdefault;  end  else  begin    //close files in case of a bug i might have missed...    //send newscan command    output[0]:=CS_NEWSCAN;    sendbuf(1);    vartype.visible:=true;    foundlabel.Caption:='0';    foundlist.Clear;    newscan.Caption:='First Scan';    nextscanbutton.Enabled:=false;    vartype.Enabled:=true;    scanvalue.visible:=true;    scantext.Visible:=true;    Updatescantype;    Scantype.ItemIndex:=0;    Groupbox1.Enabled:=true;    for i:=0 to groupbox1.ControlCount-1 do      groupbox1.Controls[i].Enabled:=true;    case vtype of     0,1,2  : begin                val(scanvalue.Text,i,error);                if error>0 then scanvalue.text:=IntToStr(i);              end;    end;    setfoundlisthorizontal;  end;  if stype=string_scan then nextscanbutton.enabled:=false;  if (foundlabel.caption='0') and (SType<>Advanced_scan) then NextScanButton.enabled:=false;  progressbar1.max:=10;  progressbar1.Position:=0;  UpdateScanType;  finally    screen.Cursor:=crdefault;  end;end;procedure TMainForm.CheckBox1Click(Sender: TObject);begin  UpdateScreen;end;procedure TMainForm.Layoutsettings1Click(Sender: TObject);begin  layout.show;end;procedure TMainForm.NextScanButtonClick(Sender: TObject);var error: Integer;    Vtype,SType: Integer;    hexvalue: string;    templist: tstringlist;    i: integer;    res: word;    temp,temp2: dword;begin  try  screen.Cursor:=crhourglass;  foundlabel.visible:=true;  VType:=GetVarType;  SType:=GetScanType;  mainform.caption:=CESearch;  application.ProcessMessages;  if not((Stype=Advanced_scan) or (Stype=string_scan)) then  begin    vartype.Enabled:=false;    foundlist.clear;    foundlabel.caption:='';    //send scan    output[0]:=CS_NextScan;    output[1]:=stype;    output[2]:=length(scanvalue.text);    if output[2]=0 then    begin      output[2]:=1;      output[3]:=0;    end    else copymemory(@output[3],@scanvalue.text[1],output[2]);    output[3+output[2]]:=0;    if cbFastscan.checked then output[3+output[2]]:=output[3+output[2]] or SO_FASTSCAN;    if HexaDecimalCheckbox.checked then output[3+output[2]]:=output[3+output[2]] or SO_HEXADECIMAL;    sendbuf(3+output[2]+1);    formscanning:=TFormscanning.create(self);    formscanning.showmodal;    setfoundlisthorizontal;    Beep;    undoscan.Enabled:=true;  end else showmessage('You can''t do a nextscan with the current selected way of scanning!');  mainform.caption:=CENorm;  progressbar1.max:=10;  progressbar1.Position:=0;  screen.Cursor:=crdefault;  finally    screen.Cursor:=crdefault;    if nextscanbutton.Enabled then    begin      newscan.Default:=false;      nextscanbutton.Default:=true    end    else    begin      nextscanbutton.Default:=false;      newscan.Default:=true;    end;  end;end;procedure TMainForm.ValueClick(Sender: TObject);var oldvaluest: string;    newvalueSt: String;    error,i: Integer;begin  if (value[(sender as TLabel).tag].Caption='NYA') or (value[(sender as TLabel).tag].Caption='??') or (value[(sender as TLabel).tag].Caption='NAN') or (value[(sender as TLabel).tag].Caption='INF') then  begin    beep;    exit;  end;  oldvaluest:=value[(sender as TLabel).tag].Caption;  newvaluest:=InputBox('Value','Change the value to:',value[(sender as TLabel).tag].Caption);  if oldvaluest=newvaluest then exit;  error:=0;  case memrec[scrollbar1.position+(sender as TLabel).tag].VarType of    0,1,2,5,6: begin                  try                    StrtoInt(newvaluest);                  except                    error:=1;                  end;//                  val(newvaluest,newvalue6,error);    //ok, newvalue6 isnt uded, but I need to see if there's an error                end;    3,4:        begin                  try                    StrTofloat(newvaluest);                  except                    error:=1;                  end;//                  val(newvaluest,newvalue5,error);                end;  end;  if error=0 then  begin    if length(newvaluest)>250 then raise exception.create('A value can''t be longer than 250 characters');    //newvaluest contains a valid variable    values[scrollbar1.position+(sender as TLabel).tag]:='NYA';    output[0]:=7;    pword(@output[1])^:=scrollbar1.position+(sender as TLabel).tag;    output[3]:=length(newvaluest);    for i:=1 to length(newvaluest) do      output[3+i]:=byte(newvaluest[i]);    sendbuf(4+output[3]);  end else raise Exception.create('This is not a valid value!');  updatelist;  updatescreen;end;procedure TMainForm.CommentButtonMouseMove(Sender: TObject;  Shift: TShiftState; X, Y: Integer);begin if comments.Memo1.Lines.Count=0 then  begin    Commentbutton.Hint:='No Comments!';    exit;  end;  Commentbutton.Hint:=copy(comments.Memo1.Text,1,20);  if length(comments.Memo1.Text)>20 then Commentbutton.Hint:=Commentbutton.Hint+'...';end;procedure TMainForm.SpeedButton2Click(Sender: TObject);var i: integer;begin  if numberofrecords>0 then  begin    if messagedlg('Are you sure you want to delete all addresses?',mtWarning,[mbYes,mbNo],0)=mrNo then exit;    for i:=0 to numberofrecords-1 do    begin      output[0]:=15;      pword(@output[1])^:=i;      sendbuf(3);    end;    numberofRecords:=0;    updatelist;  //make sure the wipeout is successfull    updatescreen;  end;end;procedure TMainForm.CommentButtonClick(Sender: TObject);begin  comments.showmodal;end;procedure TMainForm.SaveButtonClick(Sender: TObject);var savefile: File;    actualwritten: Integer;    Controle: String[6];    records: dword;    x: Pchar;begin  if (savedialog1.FileName='') and (opendialog1.filename<>'') then  begin    //set the filename the table was opened with to the filename you save as default to    //and dont forget to change the extension to .CT3    savedialog1.FileName:=ChangeFileExt(opendialog1.FileName,'');  end;  SaveDialog1.InitialDir:=cheatenginedir;  if Savedialog1.Execute then  begin    savetable(savedialog1.FileName);  end;end;procedure TMainForm.LoadButtonClick(Sender: TObject);var merge: boolean;    app: word;    Extension: string;begin  merge:=false;  if CheckIfSaved=false then exit;  OpenDialog1.InitialDir:=cheatenginedir;  if Opendialog1.Execute then  begin    Extension:=uppercase(extractfileext(opendialog1.filename));    if (Extension<>'.GH') and       (Extension<>'.CET') and       (Extension<>'.CT2') and       (Extension<>'.CT3') and       (Extension<>'.CT') and       (Extension<>'.EXE') then raise exception.create('Unknown extention');    if ((numberofrecords>0)) and (Extension<>'.EXE') then app:=messagedlg('You wish to merge the current table with this table?',mtConfirmation,mbYesNoCancel,0);    case app of      mrCancel: exit;      mrYes: merge:=true;      mrNo: merge:=false;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -