XE3–updated copy protection or how to slow down the IDE start

By | September 8, 2012

With the release of RAD Studio XE3 Embarcadero made changes to the IDE’s copy protection. Those changes are ineffective because they are a no brainer for those who crack the software. Despite this the changes cause the IDE to start much slower. Even on a SSD you feel the difference between XE2 and XE3. And on a HDD you can get almost 2 cups of coffee while the IDE starts.

The updated copy protection loads every DLL file that is in the $(BDS)\bin directory into memory to verify (WinTrust.dll) that it is a correctly signed DLL and then unloads it again. The higher your SKU is the more DLL files you have, the longer you have to wait for the IDE to start. That wouldn’t be such a huge problem (for me) if the IDE would be stable as a rock. But we all know the IDE. And if you develop IDE plugins, you restart the IDE frequently. While I work on my plugins I spend most of the time waiting for the IDE to start. And I can’t drink that much coffee.

Why is it a no brainer for Crackers? Well, they know how to inject a DLL. And verifying that the DLL on disk is correctly signed has no effect on the already loaded DLL. Windows doesn’t load DLLs again if there is already one with the exact same name in memory, even if the DLL is in another directory. Alternatively the Crackers can sign their DLL and be happy. So where is the additional security from this? The only thing I can think of is that Embarcadero saw that their IDE starts much faster now and that they don’t want the IDE to start fast.

Why should I make the IDE faster and faster with my IDEFixPack if Embarcadero tries to slow it down? And no, I won’t tamper with the copy protection. Embarcadero is the only one who can remove this useless and ineffective change in the copy protection legally.

EDIT:

From the FindFirstFile call that reads all files (why all and not just the DLL files? Well that’s the problem of IOUtils.TDirectory.GetFiles) to the last CloseHandle call.

CPU: Core 2 Quad Q6600 @ 2.4 GHz

SSD (bds.exe on virus scanner’s exclude list):
4.139 seconds

HDD (no virus scanner installed):
7.281 seconds

48 thoughts on “XE3–updated copy protection or how to slow down the IDE start

  1. Peter

    The more you pay, the more you wait 🙂

    Professional: 5 sec
    Enterprise: 9 sec
    Ultimate: 15 sec
    Architect: 30 sec.

    😉

    1. Bob Swart

      How are Delphi Ultimate and Architect slower than Delphi Enterprise? I thought Delphi Ultimate and Architect were the same as Delphi Enterprise with additional Embarcadero database tools? 😉
      (unless you were just joking, in which case please ignore my comment ;-))

  2. Thomas Speck

    Hi Andy,

    I think you should Emba send a mail about this useless “Improvement” of the Copy Protection. I agree that this is for talented Crackers no Hurdle, but for us Users a great impairment, escpecially for whom which starts the IDE more often and now have to wait for such a useless action the IDE takes.

    You are right, Emba is the only one who can change this Behavior, but I’m afraid that this won’t be changed. Do you have a clue or hint how Emba could change this Behavior to accelerate the Start of the IDE again without touching the Copyright Protection ? If you do so, then please communicate with Emba. Your word is much more valuable than our Words, the Words of the poor users…

  3. Peter

    Since there is absolutely no new feature in XE3 for VCL users, I remain on XE2 and enjoy the speed.

      1. Sir Rufo

        You can reach this since Delphi 2006 and class operators.
        So that is a nice and fancy thing but not a breaking feature

        1. Rudy Velthuis

          No, you can’t do that with class operators. Not for AnsiStrings or UnicodeStrings, not for, say, Integers or Doubles.

          1. Sir Rufo

            use this

            TStringType = record
            Value : string;
            class operator implicit( const a : string ) : TStringType;
            class operator implicit( const a : TStringType ) : string;

            function Reverse : TStringType;
            function UpperCase : TStringType;
            end;

            and the above sample will work like this

            var
            s: TStringType;
            begin
            s:='aaa';
            s := s.reverse.UpperCase;

          1. Sir Rufo

            no of course you can’t and i even didn’t said that this is a useless feature – it is nice and fancy – but it is not a breaking feature.

          2. Chris Rolliston

            Yes, though with the caveat you will need a separate helper for each of the core integer types. This is because the implied type of an integer constant is (roughtly speaking) the smallest possible for the value:

            [sourcecode language=’Delphi’]
            type
            TUInt8Helper = record helper for UInt8
            function Squared: UInt16;
            end;

            function TUInt8Helper.Squared: UInt16;
            begin
            Result := Self * Self;
            end;

            begin
            WriteLn(5.Squared); //output: 25
            ReadLn;
            end.
            [/sourcecode]

            @’Sir Rufo’, alias Mr ‘no of course you can’t’: let me guess, you’re pontificating on something you’ve never actually used? Even in the string case, what a string helper proper allows is using strings unwrapped, which will be much more efficient than your workaround, even once you have implemented all possible operators (try concatenating several TStringType instances together and comparing the produced code in the CPU view).

          3. Lachlan Gemmell

            @Sir Rufo – Am I right that English isn’t your native language? You’re using a term “breaking feature” that doesn’t really mean anything in English. My best guess is that you’re thinking of “ground breaking feature”.

            @Chris Rolliston – Sir Rufo is actually correct when he says it isn’t possible as he was replying to my question “Can you do this in D2006”.

  4. Eric

    If there isn’t a massive outcry, they won’t change it. Doubt it? Look at the EULA fiasco: only the leak and subsequent outcry could reverse things, individuals were not listened by a management that knew better.

    On that issue, if they want to keep copy protection, they don’t need to just reverse, but also pay professionals to do the job, at least so that the copy protection slows the hackers, not the users… (and slow the hackers is all they can realistically aim for, that or making Delphi so unattractive hackers won’t even bother… Oh, wait, they attempted to do that too)

  5. Peter

    Why not providing a hardware dongle for Delphi? It rocks! We had much fun in the 80’s in hacking and emulating those bones. 😉

  6. Pingback: TURBU Tech » Blog Archive » The language engineer’s triangle

  7. Jim McKeeth

    The thing about copy protection is it is only annoying to the legitimate users. Everything is circumventable, and the pirates never complain. In fact, annoying copy protection is what they live for!

    I imagine the pirated copies of Delphi (or any software product) that are distributed either have the copy protection removed, or include a circumvention.

    For a proprietary software product there is a threshold of minimum effort to prevent casual pirates – those that will pirate if it is easy. The key there is not to make it so annoying that legitimate customers look for a piracy solution to make the product usable.

    The problem comes when a user buys a product and then finds the copy protection annoying enough that they seek out a crack. The more people who want / use a crack, the more prevalent that crack becomes, which makes it easier for others find. Once someone has made that step, then when it is time to upgrade they now have a choice: Pay money and still need to apply the crack (thus breaking their license agreement) or just pirate the software? Either-way they are breaking the law, so why not choose the easier & cheaper path?

      1. C Johnson

        No, obviously not. But it comes back to the old fight over DVD backups to protect them from your kids ands remove the 20 minutes of enforced ads on some of the worst of them.

        Still, few complained when Borland first added this license protecting nonsense. They got away with it, and Embarcadero will push it as far as the can before there is a major push back, such as over a recent attempted EULA change. There will be more, and indeed worse in the future so long as we keep paying them to treat us like their enemies.

      2. Paul

        No but….
        with this and the limiting of installs to 3; for legimate users a crack is a useful tool to remove such annoyances

    1. David

      Putting enough copy protection into your product that it is too hard for your average user to copy it is reasonable. But trying to defeat the serious crackers is a generally speaking a waste of resources. And when your attempts inflict real harm on your paying customers then you’ve crossed the boundary from folly into stupidity.

      Once the pirated version has real and measurable advantages over the expensive licensed version then you are on a slippery slope where the pirates aren’t just cheaper than you, the pirates are also providing a better product!

      Crazy.

  8. Sir Rufo

    You can reach this already since Delphi 2006 and class operators.
    So that is just a nice and fancy thing but not a breaking feature

  9. medbob

    David I, why are y’all allowing such stupid stuff to happen? It looks really bad for emb, and you know that developers are not tolerant of stupid tricks.

    1. Andreas Hausladen Post author

      Has David I changed his position? If not, then it isn’t his responsibility to add or remove copy protection to the product.

      1. medbob

        Especially in this case, copy protection is a tradeoff between the stated goals of Delphi to be a quick tool, and to make money.

        Perhaps I make too many assumptions. I assume that developers will universally hate this modification as it causes a longer startup time, with no benefit to the developers. David is not only the marketing man, but has spent decades as a Developer Relations person. My assumption is that he is engaged in the product, and can identify a stupid decision when he sees one.

        This one is so obvious from my view, that I must assume that SOMEONE in emb knows that this is a stupid move. Is it too much of an assumption to think that David would be the biggest cheerleader of the bunch, wanting Delphi to succeed? I join him in wanting Delphi to succeed, but if they keep shooting themselves in the foot, at some point the surgeons will no longer be able to help….

    1. Eric

      Hmmm? People that steal any cracked software don’t have to deal with the hassles of copy-protection, they get it cracked already.

      Those that are going to be annoyed are the legal users, and them only. If you’re designing components or IDE plugins, restarting the IDE is very common, essentially because plugins and components aren’t isolated in the IDE, so any bug in your plugin or components causes crashes in the whole IDE.
      And there is also the annoying debugger bug, in which the IDE keeps a lock on the exe, and you can’t debug or build anymore until you’ve restarted the IDE.

  10. Marco Cantu

    I did some testing on my machine with SSD. XE3 Enterprise is about one second slower or 10% slower. I don’t think this is such a big deal. Do you have real numbers?

    1. Andreas Hausladen Post author

      From FindFirstFile call to CloseHandle of the last DLL file (It’s so easy to install hooks to measure the performance. Why do they even bother to write such an ineffective “copy protection”):

      SSD (bds.exe on virus scanner’s exclude list):
      4.139 seconds

      HDD (no virus scanner installed):
      7.281 seconds

      1. Marco Cantu

        It is not as slow on my machine, less than 2 sec. difference (although I have a few more third party packages in XE2), and less than 10 sec. to start XE3 anyway… In both cases, I’m running the Delphi personality only.

  11. Douglas Rudd

    Are you sure you have this right? I haven’t noticed anything slower. In fact it’s a lot faster because I don’t have all my third party junk in it yet.

  12. Al

    Well everyone seems to be upset over the copy protection but less vocal on the really important issues like: Why ios was dropped?
    There I was thinking all the issues with FM and iOS would only get sorted with the next release, that improvements to this area would justify my spending big dollars on third party components and that things would only get better. I feel majorly screwed in this area. If we can have a better fm2, why couldn’t that have been a batter fm2 iOS as well?
    Oh and actions in fm2? No copy, cut or paste as standard actions? Seriously? Might as well have left it out.

  13. Fouad Loucif

    You can give Embarcedero much money, but you can’t make your copy better.

  14. liu

    Instead of spending limited Emba resource on useles copy protection, it is better to fix those bugs on qc.

    Oh.. can you believe form designer without undo? The most requested feature

      1. Mullah O

        Andreas, you may want to check that with a competent German lawyer, as the word “sole” in the EU directive has a meaning…….

        art 7..1 c)
        any act of putting into circulation, or the possession for commercial purposes of, any means the ___sole___ intended purpose of which is to facilitate the unauthorised removal or circumvention of any technical device which may have been applied to protect a computer program.

        1. Andreas Hausladen Post author

          What? I will not remove that part of the copy protection. Not now and not in the future. And nobody will change my mind. I just won’t remove it.

  15. Ilustrul

    Andreas, no offence, but you’d better put your valuable time/expertise to improving Lazarus, which is free and makes major inroads lately.

    I don’t see a point in improving Delphi anymore.

    1. Anonymous

      The funniest thing Embarcadero does not include Andy’s fixes (these fixes are free, aren’t those?), which is a bit strange to me. So maybe helping Lazarus is not bad idea.

      1. Andreas Hausladen Post author

        That’s wrong. Embarcadero includes almost all fixes that are safe to use (great thanks to Mark, Darren and all others). The patches that make assumptions that I can’t proof to be correct, are left out because they could have major drawbacks. And it its easier and cheaper to uninstall IDEFixPack instead of waiting for the next Delphi version that fixes those bugs.

        1. Thomas Speck

          Hey Andy,

          what ? They use your Fixes and incorporate them in their Product ? And claim that it is their work to fasten and stabilize the IDE ? The real “I-fix-what-Emba-has-done-worse” Guy are you, no other and it is your effort that the IDE is more and more stable, not the effort of Emba. You have proven over and over that you better unterstand how to make a Product rock-solid and fast, it is not the effort of Emba to develop these Patches. It’s a shame for Emba not to find these bugs in their QC.

  16. Andrey

    I guess it is simple. Somebody decided to claim credit for improving copy protection and sold this truly dumb feature to some even dumber management. That management’s ability to trash companies has been proven twice, how do you wonder?

Comments are closed.