From b0ec37bebdae76561910561cc1e35b6f6505a979 Mon Sep 17 00:00:00 2001 From: Freeman Date: Fri, 22 May 2020 01:01:43 +0300 Subject: [PATCH] Minimal Delphi RTL added --- RTL/SysInit.pas | 35 +++++++++++++++++++++++++++++++++++ RTL/System.pas | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 RTL/SysInit.pas create mode 100644 RTL/System.pas diff --git a/RTL/SysInit.pas b/RTL/SysInit.pas new file mode 100644 index 0000000..cfe8f4d --- /dev/null +++ b/RTL/SysInit.pas @@ -0,0 +1,35 @@ +(* + Minimal Delphi SysInit unit +*) + +unit SysInit; + +interface + +procedure _InitExe; +procedure _Halt0; +procedure _InitLib(Context: PInitContext); + +var + ModuleIsLib: Boolean; + TLSIndex: Integer = -1; + TLSLast: Byte; + +const + PtrToNil: Pointer = nil; + +implementation + +procedure _InitLib(context: pinitcontext); +asm +end; + +procedure _InitExe; +asm +end; + +procedure _Halt0; +asm +end; + +end. \ No newline at end of file diff --git a/RTL/System.pas b/RTL/System.pas new file mode 100644 index 0000000..9133edf --- /dev/null +++ b/RTL/System.pas @@ -0,0 +1,41 @@ +(* + Minimal Delphi System unit +*) + +unit System; + +interface + +type + PPAnsiChar = ^PAnsiChar; + PInteger = ^Integer; + + TGUID = record + D1: LongWord; + D2: Word; + D3: Word; + D4: array [0..7] of Byte; + end; + + PInitContext = ^TInitContext; + TInitContext = record + OuterContext: PInitContext; + ExceptionFrame, InitTable, InitCount: Integer; + Module: Pointer; + DLLSaveEBP, DLLSaveEBX, DLLSaveESI, DLLSaveEDI: Pointer; + ExitProcessTLS: procedure; + DLLInitState: byte; + end; + +procedure _HandleFinally; + +implementation + +uses + SysInit; + +procedure _HandleFinally; +asm +end; + +end. \ No newline at end of file