Smallest System.pas and SysInit.pas - Windows XP, Vista & 7

Post date: Aug 4, 2011 7:45:03 PM

Inspired by Small Applications in Delphi - Tutorial by n0v4, these "Mini-Delphi" units (identification by PEiD) have been updated to work with all Windows NT operating systems.

System.pas

unit System; 
interface
procedure _Halt0;
procedure _HandleFinally; 
type
  TGUID = record
    D1: LongWord;
    D2: Word;
    D3: Word;
    D4: array [0..7] of Byte;
  end;
var
  ExitCode: Integer = 0; 
  
procedure ExitProcess(ExitCode: Integer); stdcall; external 'kernel32.dll' name 'ExitProcess';
implementation
procedure _Halt0;
begin
  ExitProcess(ExitCode);
end;
procedure _HandleFinally;
asm
end;
end.

SysInit.pas

unit SysInit;
interface
procedure _InitExe(InitTable: Pointer);
var
  TlsIndex: Integer = -1;   
  TlsLast: Byte;    
const
  PtrToNil: Pointer = nil;
implementation
procedure _InitExe(InitTable: Pointer);
begin
end;
end.