frmfillmemoryunit.pas.svn-base

来自「这是一段游戏修改工具的源代码.ring3功能由dephi开发,驱动是C开发.希望」· SVN-BASE 代码 · 共 84 行

SVN-BASE
84
字号
unit frmFillMemoryUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,cefuncproc{$ifdef net},netapis{$else},newkernelhandler{$endif};

type
  TfrmFillMemory = class(TForm)
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    Button2: TButton;
    Edit2: TEdit;
    Edit3: TEdit;
    Label3: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmFillMemory: TfrmFillMemory;

implementation

{$R *.dfm}

procedure TfrmFillMemory.Button1Click(Sender: TObject);
var start,stop,count,temp:dword;
    fillvalue:byte;
    buf: array of byte;
    actualwritten: dword;

begin
  //fill the memory
  try
    start:=strtoint('$'+edit1.Text);
  except
    raise exception.Create('Please fill in a valid ''From'' address');
  end;

  try
    stop:=strToInt('$'+edit2.Text);
  except
    raise exception.Create('Please fill in a valid ''To'' address');
  end;

  try
    fillvalue:=strToInt('$'+edit3.Text);
  except
    raise exception.Create('Please fill in a valid ''Fill'' value');
  end;

  count:=stop-start+1;
  if integer(count)<0 then
  begin
    temp:=stop;
    stop:=start;
    start:=temp;
  end;

  setlength(buf,count);
  fillmemory(@buf[0],count,fillvalue);


  RewriteCode(processhandle,start,@buf[0],count);

  modalresult:=mrok;
end;

procedure TfrmFillMemory.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  action:=cafree;
end;

end.

⌨️ 快捷键说明

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