Delphi 64-bit code Hook for executing VCL Style AV?

There seems to be no custom solution without a fix in Delphi Tokyo, but it seems worth asking.

The easiest way to make this AV reproducible.

  • Run the new VCL project.
  • Change the platform to 64-bit.
  • Communication with runtime packages.
  • Set the style to Amakrits.
  • Add a flag with a high degree of entropy ASLR. Note. This fixes many Win64 errors.

My Dpr file looks like this (there is no code in the main block).

program MaskedCrash2;

{$SETPEOPTFLAGS $160} //High Entropy ASLR Flag causes issues with incorrect 64-bit programs.

uses
  Vcl.Forms,
  MaskedCrashed2MainUnt in 'MaskedCrashed2MainUnt.pas' {Form3},
  Vcl.Themes,
  Vcl.Styles;

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  TStyleManager.TrySetStyle('Amakrits');
  Application.CreateForm(TForm3, Form3);
  Application.Run;
end.

AV appears in Delphi Tokyo in StyleUtils.inc in procedure TseBitmapLink.CheckingMasked(const Margin: TRect); .

Despite the warning I recently found at the top of StyleUtils.inc:

//TODO -oUnassigned -cImplement : x64 : Implement PlatformNotImplemented in this unit or disable for x64.

Delphi Berlin. - , . .

. High Entropy ASLR ( ), High Entropy ($ 20), $40 DEP $100 ASLR.

, , ASLR High Entropy Windows (, Integer SendMessage ..). High Entropy ASLR 64-, .

, , , .

procedure TseBitmapLink.CheckingMasked(const Margin: TRect); :

implementation

uses
  System.Types, System.UITypes, System.SysUtils, Winapi.UxTheme, Vcl.StdCtrls, Vcl.ComCtrls,
  Vcl.Mask, Vcl.GraphUtil, Vcl.ImgList, Vcl.Menus, Vcl.Grids, Vcl.CategoryButtons,
  Vcl.ButtonGroup, Vcl.ExtCtrls, Vcl.Consts, Vcl.SysStyles;

{$I StyleUtils.inc}
{$I StyleAPI.inc}

, , TseBitmapLink , ?

?

- ASLR Delphi Tokyo?

, , .

+4

Source: https://habr.com/ru/post/1688959/


All Articles