不是什么秘密的玩意
不过连机修改无效,会断线
自己一个人yy吧
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Label1: TLabel;
Timer1: TTimer;
Label2: TLabel;
Edit2: TEdit;
Button1: TButton;
Button2: TButton;
Label3: TLabel;
Edit4: TEdit;
procedure Timer1Timer(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Function DuMem(pid
WORD;Addres: Cardinal): Cardinal;
var PHND:THandle; bReadSucceed :BOOL; BytesRead
WORD;
begin
if pid <> 0 then
begin
PHND := OpenProcess(PROCESS_VM_READ, False,pid);
if PHND <> 0 then
begin
bReadSucceed :=ReadProcessMemory(PHND, Pointer(Addres), @Result, 4, BytesRead);
if bReadSucceed = False then Result := 0 ;
end;
CloseHandle(PHND);
end else
Result := 0;
end;
Function XXMem(pid
WORD;Addres: Cardinal;zhi:dword): Cardinal;
var PHND:THandle; bReadSucceed :BOOL; BytesRead
WORD;
begin
if pid <> 0 then
begin
PHND := OpenProcess(PROCESS_ALL_ACCESS, False,pid);
if PHND <> 0 then
begin
bReadSucceed :=WriteProcessMemory(PHND, Pointer(Addres), @zhi, 4, BytesRead);
if bReadSucceed = False then Result := 0 ;
end;
CloseHandle(PHND);
end else
Result := 0;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
hRedAlert2 : THandle; xpid:dword;
begin
hRedAlert2 := FindWindow('Red Alert 2', 'Red Alert 2');
if hRedAlert2<> 0 then
begin
GetWindowThreadProcessId(hRedAlert2,xpid);
edit1.Text:= inttostr( xpid );
edit4.Text:= inttostr( DuMem( xpid, DuMem( xpid ,$A35DB4 ) + $24C ) );
XXMem( xpid, DuMem( xpid ,$A35DB4 ) + $24C , strtoint(edit2.Text ) );
end else
begin
edit1.Text:='无';
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
halt;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage('程序设计:又欠'#13#10+'程序测试:安康')
end;
end.
/////////////////////
object Form1: TForm1
Left = 202
Top = 129
BorderIcons = []
BorderStyle = bsSingle
Caption = #32418#33394#35686#25106'2'#37329#38065#20462#25913#22120' '
ClientHeight = 82
ClientWidth = 198
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'Tahoma'
Font.Style = []
OldCreateOrder = False
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 13
object Label1: TLabel
Left = 8
Top = 8
Width = 60
Height = 13
Caption = #28216#25103#36827#31243#65306
end
object Label2: TLabel
Left = 8
Top = 32
Width = 60
Height = 13
Caption = #37329#38065#20462#25913#65306
end
object Label3: TLabel
Left = 8
Top = 56
Width = 60
Height = 13
Caption = #24403#21069#37329#38065#65306
end
object Edit1: TEdit
Left = 67
Top = 5
Width = 54
Height = 21
TabOrder = 0
end
object Edit2: TEdit
Left = 67
Top = 29
Width = 54
Height = 21
TabOrder = 1
Text = '10000'
end
object Button1: TButton
Left = 127
Top = 5
Width = 64
Height = 21
Caption = #20851#20110
TabOrder = 2
OnClick = Button1Click
end
object Button2: TButton
Left = 127
Top = 30
Width = 64
Height = 21
Caption = #36864#20986
TabOrder = 3
OnClick = Button2Click
end
object Edit4: TEdit
Left = 67
Top = 53
Width = 54
Height = 21
TabOrder = 4
Text = '10000'
end
object Timer1: TTimer
OnTimer = Timer1Timer
Left = 16
Top = 8
end
end