After looking further at the SysUtils unit, I found out some small piece of asm code I didn't notice at first.

There is some hidden and not documented code in every program using the DB features, in order to verify that you have the right to use some drivers or DB features.

The licence checking performed by Borland (it was a trick existing in Delphi 4, or perhaps before) is somewhat childish.

So here are the three function procedures in SysUtils.pas, not documented:

function GDAL: LongWord; procedure RCS; procedure RPR;

Here is a first explanation: http://assarbad.net/stuff/!export/dvclal/jeremyres.html

The purpose of these functions is to check the presence of the DVCLAL resource in the exe (or one of the current module).

This resource is just an array of 4 longword, i.e. 4 cardinal values.

The function GDAL, for example, returns either 0, -16, -5136, or -1 depending of the version of your current Delphi licence (i.e. Professional, Entreprise, Architecture, GPL, whatever). The returned value of GDAL is checked in the following units: SqlExpr.pas BDEReg.pas DBReg.pas DBTables.pas BDEReg.pas DBReg.pas MidReg.pas

And the protection takes place easily, for example here is an extract of the BDEReg.pas code:

procedure Register; begin { Database Components are excluded from the STD SKU } if GDAL <> LongWord(-16) then begin // Restrict these components to only be used with VCL components. GroupDescendentsWith(TBDEDataSet, Controls.TControl); .... { Components that are excluded from the STD & PRO SKUs } if GDAL = 0 then RegisterComponents(srBDE, [TNestedTable]);

The RPR procedure is a bit more agressive: it raises an exception in case you don't have the right to use some components registered in DBXClient.pas DbxFirebird.pas DbxInterbase.pas DbxMySql.pas DbxSybaseASA.pas DSServer.pas DB.pas dbcgrids.pas HTTPApp.pas HTTPProd.pas Sockets.pas SOAPConn.pas units.

And within the RCS procedure, the exception is raised for other components registered in DBXClient.pas DbxDb2.pas DbxInformix.pas DbxMSSQL.pas DbxOracle.pas DbxSybaseASE.pas DBClient.pas MConnect.pas TConnect.pas HTTPApp.pas HTTPProd.pas MXDB.PAS MXGRAPH.PAS MXGRID.PAS MXPIVSRC.PAS units.

I let you guess which component is what, just from the official EMB feature matrix.

Why all this?

Since the raw compiler is the same, that is the language feature and RTL is the same for all Delphi versions (from Professional up to Architect), you could be tempted buying the Professional version, then copy the dcu/bpl from an Architect, and use it... but in fact, you won't have the "magic" resource in your exe, so the trick won't play.

Writing a patcher for your exe is very easy. You don't even have to patch the memory, just some standard Win32 API like BeginUpdateResource / UpdateResource / EndUpdateResource like stated in msdn will do the work.

I won't commit Delphi code here, because I want to stay friend with EMB. But guess what, it's not a great protection system!

I don't blame Borland/EMB. But lol ! Such a weak "protection", giving all the source code at once. Thanks EMB for making me smile after my "object type" funeral.