如何配置.exe文件(30分)

  • 主题发起人 主题发起人 Dale46
  • 开始时间 开始时间
D

Dale46

Unregistered / Unconfirmed
GUEST, unregistred user!
像 BO或冰河一样的程序,需要配置server端的.exe
如何实现?
 
我的天,你究竟想干嘛?最近总是问这个?
 
bo是有源程序供下载的。
 
我也想听一听.
 
thftsyh:BO的源程序在哪啊?
 
直接对相应位置的代码进行二进制读写 可行吗?
 
你的分太少了,这么高的问题
 
我给你一个DELPHI的原代码,不过我要高的分:)
 
EASY...
to Http://Lovejingtao.126.com

unit config1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls,
ComCtrls, Buttons;

type
TMainForm = class(TForm)
GroupBox1: TGroupBox;
OpenDialog1: TOpenDialog;
GroupBox2: TGroupBox;
Label5: TLabel;
GroupBox3: TGroupBox;
Label6: TLabel;
Label7: TLabel;
GroupBox4: TGroupBox;
Label2: TLabel;
Label4: TLabel;
Label3: TLabel;
StatusBar1: TStatusBar;
FileBox1: TEdit;
SpeedButton1: TSpeedButton;
Button1: TButton;
Button2: TButton;
Button3: TButton;
PortBox: TEdit;
NameBox: TEdit;
UINBox: TEdit;
ICQCheckBox: TCheckBox;
PassCheckBox: TCheckBox;
PassBox1: TEdit;
PassBox2: TEdit;
Button4: TButton;
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
MainForm: TMainForm;

implementation

uses startup;

{$R *.DFM}






procedure TMainForm.Button3Click(Sender: TObject);
begin
StartupForm.Show;
end;

procedure TMainForm.Button4Click(Sender: TObject);
begin
Application.Terminate;
end;

procedure TMainForm.Button2Click(Sender: TObject);
var
F: file;
Count: Integer;
S: string;
Buff: array[1..25] of Char;

begin
if (FileBox1.Text = '') then
begin
MessageDlg('Please select a file.', mtError, [mbOK], 0);
Exit;
end;
if (PassBox1.Text <> PassBox2.Text) then
begin
MessageDlg('Passwords do not match.', mtError, [mbOK], 0);
Exit;
end;
AssignFile(F, FileBox1.Text);
{$I-}
Reset(F, 1);
{$I+}
if (IOResult = 0) then
begin
// port
Seek(F, $1E14);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := PortBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 5);
// icq number
Seek(F, $1CFE);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := UINBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 10);
// password
Seek(F, $1E2F);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := PassBox1.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 20);
// filename
Seek(F, $1D23);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := StartupForm.FileNameBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 12);
// regrun key name
Seek(F, $1DAA);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := StartupForm.RegRunBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 25);
// reg runservices key name
Seek(F, $1DC4);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := StartupForm.RegRunSrvBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 25);
// reg current user key name
Seek(F, $1DDE);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := StartupForm.RegCurrUserBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 25);
// password true/false
Seek(F, $1DF8);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (PassCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// reg currentuser startup true/false
Seek(F, $1DFC);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (StartupForm.RegCurrUserCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// regrun startup true/false
Seek(F, $1E00);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (StartupForm.RegRunCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// reg runservices startup true/false
Seek(F, $1E04);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (StartupForm.RegRunSrvCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// sysini startup true/false
Seek(F, $1E08);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (StartupForm.SystemINICheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// winini load startup true/false
Seek(F, $1E0C);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (StartupForm.WinINILoadCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// winini run startup true/false
Seek(F, $1E10);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (StartupForm.WinINIRunCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// use icq true/false
Seek(F, $1C24);
for Count := 1 to 25 do Buff[Count] := Char(0);
if (ICQCheckBox.Checked = TRUE) then S := '123' else S := '321';
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 3);
// server name
Seek(F, $1E1A);
for Count := 1 to 25 do Buff[Count] := Char(0);
S := NameBox.Text;
for Count := 1 to Length(S) do Buff[Count] := S[Count];
BlockWrite(F, Buff, 20);
CloseFile(F);
end;
end;

procedure TMainForm.Button1Click(Sender: TObject);
var
F: file;
S: string;
Count: Integer;
Buff: array[1..25] of Char;
begin
if (FileBox1.Text = '') then
begin
MessageDlg('Please select a file.', mtError, [mbOK], 0);
Exit;
end;
AssignFile(F, FileBox1.Text);
{$I-}
Reset(F, 1);
{$I+}
if (IOResult = 0) then
begin
for Count := 1 to 25 do Buff[Count] := Char(0);
// use icq true/false
Seek(F, $1C24);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then ICQCheckBox.Checked := TRUE else ICQCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// password true/false
Seek(F, $1DF8);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then PassCheckBox.Checked := TRUE else PassCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// reg current user startup true/false
Seek(F, $1DFC);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then StartupForm.RegCurrUserCheckBox.Checked := TRUE else StartupForm.RegCurrUserCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// regrun startup true/false
Seek(F, $1E00);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then StartupForm.RegRunCheckBox.Checked := TRUE else StartupForm.RegRunCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// reg runservices startup true/false
Seek(F, $1E04);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then StartupForm.RegRunSrvCheckBox.Checked := TRUE else StartupForm.RegRunSrvCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// sysini startup true/false
Seek(F, $1E08);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then StartupForm.SystemINICheckBox.Checked := TRUE else StartupForm.SystemINICheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// winini load startup true/false
Seek(F, $1E0C);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then StartupForm.WinINILoadCheckBox.Checked := TRUE else StartupForm.WinINILoadCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// winini run startup true/false
Seek(F, $1E10);
BlockRead(F, Buff, 3);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
if (S = '123') then StartupForm.WinINIRunCheckBox.Checked := TRUE else StartupForm.WinINIRunCheckBox.Checked := FALSE;
for Count := 1 to 25 do Buff[Count] := Char(0);
// port
Seek(F, $1E14);
BlockRead(F, Buff, 5);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
PortBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// icq number
Seek(F, $1CFE);
BlockRead(F, Buff, 10);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
UINBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// filename
Seek(F, $1D23);
BlockRead(F, Buff, 12);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
StartupForm.FileNameBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// regrun key name
Seek(F, $1DAA);
BlockRead(F, Buff, 25);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
StartupForm.RegRunBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// reg runservices key name
Seek(F, $1DC4);
BlockRead(F, Buff, 25);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
StartupForm.RegRunSrvBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// reg current user key name
Seek(F, $1DDE);
BlockRead(F, Buff, 25);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
StartupForm.RegCurrUserBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// password
Seek(F, $1E2F);
BlockRead(F, Buff, 20);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
PassBox1.Text := S;
PassBox2.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
// server name
Seek(F, $1E1A);
BlockRead(F, Buff, 20);
Count := 1;
S := '';
while (Ord(Buff[Count]) <> 0) do
begin
S := S + Buff[Count];
Inc(Count);
end;
NameBox.Text := S;
for Count := 1 to 25 do Buff[Count] := Char(0);
CloseFile(F);
end;
end;


procedure TMainForm.SpeedButton1Click(Sender: TObject);
begin
if (OpenDialog1.Execute) then FileBox1.Text := OpenDialog1.FileName;
end;

end.
 
接受答案了.
 
后退
顶部