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

📄 unit2.pas

📁 冒险岛吸怪源码UCE的制作材料 用于冒险岛游戏的外挂
💻 PAS
📖 第 1 页 / 共 5 页
字号:
      if memrec[j].vartype=5 then
      begin
        if memrec[i].bitlength=bitl then
        begin
          found:=true;
          break;
        end;
      end
      else
      begin
        found:=true;
        break;
      end;
    end;

  if not found then
  begin
    inc(NumberOfRecords);
    ReserveMem;

    memrec[NumberOfRecords-1].Description:='No Description';
    memrec[NumberOfRecords-1].Address:=address;

    if getscantype=string_scan then memrec[NumberOfRecords-1].VarType:=0 else
                                    memrec[NumberOfRecords-1].VarType:=getvartype;

    memrec[NumberOfRecords-1].Frozen:=false;
    memrec[NumberOfRecords-1].FrozenValue:=0;

    memrec[NumberOfRecords-1].Bit:=bit;
    memrec[NumberOfRecords-1].bitlength:=bitl;
    hotkeys[NumberOfRecords-1]:=-1;

    //add
    output[0]:=CS_ADDADDRESS;
    pdword(@output[1])^:=memrec[NumberOfRecords-1].Address;
    output[5]:=memrec[NumberOfRecords-1].VarType;
    output[6]:=memrec[NumberOfRecords-1].Bit;
    output[7]:=memrec[NumberOfRecords-1].Bitlength;
    sendbuf(8);


  end
  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;

    case vtype of
      0: //byte
      begin
        output[11]:=1;
        output[12]:=strtoint(scanvalue.text);
      end;

      1: //word
      begin
        output[11]:=2;
        pword(@output[12])^:=strtoint(scanvalue.text);
      end;

      2: //dword
      begin
        output[11]:=4;
        pdword(@output[12])^:=strtoint(scanvalue.text);
      end;

      3: //float
      begin
        output[11]:=4;
        psingle(@output[12])^:=strtofloat(scanvalue.text);
      end;

      4: //double
      begin
        output[11]:=8;
        pdouble(@output[12])^:=strtofloat(scanvalue.text);
      end;

      6:
      begin
        output[11]:=8;
        pint(@output[12])^:=strtoint64(scanvalue.text);
      end;

      7:
      begin
        output[11]:=length(scanvalue.text);
        copymemory(@output[12],@scanvalue.text[1],output[11]);
      end;

      5,8: raise exception.Create('Not implemented yet! (blame dark byte for this)');
    end;


    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;

⌨️ 快捷键说明

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