1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Downloading YouTube Videos

Discussion in 'Technology Advice' started by Markham, Dec 27, 2012.

  1. oss
    Offline

    oss Somewhere Staff Member

    What's your opinion on SmartAssembly Mark ?

    I've been looking at obfuscators for a long time and could not make up my mind whether to get one or not, the cheap ones may be little better than no protection at all but SmartAssembly is fairly expensive at 600 or so quid, obviously I have a lot of respect for Reflector but that was something that Red-Gate acquired from Lutz Roeder, I've not really used any other Red-Gate products although we as a company bought one of their SQL products the SQL Data Generator and the guys that used that seemed pretty happy with it.

    The ideal obfuscator would be the high end application virtualization tools like Spoon (Xenocode) and the other ones like Remotesoft's Salamander that take the IL and recompile it down to object code hence eliminating all the IL.

    My alternative might be to just start writing my own stuff in native Delphi again, I still have full licences for Delphi, but I like .Net these days apart from the fact it can be simply reverse engineered.
  2. oss
    Offline

    oss Somewhere Staff Member

    Didn't happen in the previous one version 3, that ran fine in the VM, it was only a problem with the version 4.0
  3. Aromulus
    Offline

    Aromulus The Don Staff Member

    Does anybody speak English on this site anymore....????:erm:
  4. oss
    Offline

    oss Somewhere Staff Member

    I'm just speaking technical English, with a Scots accent ;) but it's hard to see that in the written version ;) :D
  5. Aromulus
    Offline

    Aromulus The Don Staff Member

    Aye.............:erm: Silly of me...............:like:
  6. Markham
    Offline

    Markham Guest

    I first came across SmartAssembly when it was Reflector which I believe Lutz Roeder wrote as part of his final thesis for his (Masters?) degree. Anyway, he put it into the Public Domain and it achieved quite some popularity. I was given my copy by someone who decided to permanently retire and gave up all programming. It's by no means the latest release but it does everything I need it to do. It is quite good at doing what it does but certain things could be improved - such as pruning out completely unused methods and objects. Obfuscation can result in unintelligible error messages for un'catch'ed exceptions but there's a SmartAssembly switch which causes the SA runtime module to trap these and extract the information from a PDB file of the same name as the assembly. But in experienced hands, armed with the PDB file, the code can still be disassembled thus negating the benefits of obfuscation!

    SmartAssembly does have one neat option - improved memory handling where it beefs up garbage collection and frees previously used memory back to the OS pool much faster and more completely than the Net runtime itself does.

    I'm completely self-taught as a programmer and it is all thanks to David Intersimone, Borland's Languages Evangelist, whom I first met when, as a tech journalist, I had to interview him during one of his visits to London. A few months after that encounter, he sent me a preview copy of a development system that Borland was about to announce: Delphi 1. I tried it and loved it and have been a Delphi addict ever since. The best version they ever produced was, without a doubt IMO, Delphi 7. It's a great pity that Borland wasn't permitted to continue development of its dotNet version of Delphi: Microsoft saw to that.

    I like C# but I prefer the pure machine code that Delphi provides and I'm really tempted to rewrite YouTube Downloader in Delphi and add the ability to download videos from other sources such as Vimeo and DailyMotion. A few years ago, I wrote an extension for what was then a very popular DVD authoring system, DVD-Lab, and my extension included a frame-accurate editor (much easier to do with MPEG2 than say with MPEG4 encodes). That extension, Pro-Ex, was available to all registered DVD-Lab users and I was paid on a royalty basis. DBD-Lab is no more, alas, but I still have all the code I wrote so the equivalents of the Player and Advanced Editor modules would be easy to reproduce.

    Mark
  7. oss
    Offline

    oss Somewhere Staff Member

    Yeah if you can avoid it you don't want to ship PDB's although I think SmartAssembly is supposed to generate selective debug information to support exception handling, I just checked their pricing again and at 795 for the pro version which I think I would want, I might still look elsewhere.

    Of the other cheap ones available .Net Reactor is thought to be buggy and fairly vulnerable, there is a fairly cheap one Called Skater by Rustemsoft but I get an odd feeling about his as I think he is just a one man band and the standard of English on his site is a bit poor, but if it did everything it says it does then it would be great.

    The problem with obfuscators is that you have to go read all the black hat hacking/cracking forums to see which ones are failing and I have never been keen to visit those sites.

    I programmed in various DOS based systems back in the 80's and by the early 90's moved to Windows programming via CA Visual Objects (CAVO) then VB2, VB3, early VB was so limited compared to CAVO. Anyway I got into Delphi with version 2 as CA were making a hash of the IDE tools around the VO compiler and of course by the time we got to Delphi Version 3 it was a truly powerful elegant platform, the VCL was clearly so far ahead of it's time that Microsoft had nothing to compete with it, however they did of course then steal Anders Hejlsberg from Borland, the man who had been the architect of Delphi and the VCL and who later became the architect of C# and much of the .Net Framework for Microsoft, the rest as they say is history.

    You are quite right that D7 was the best, I owned every version from D2 through to D8, but D8 was purely .Net and was frankly lousy, Borland/Code Gear did in fact continue with the .Net compiler in later versions but it was a half hearted effort compared to the native code versions, and of course about the same time RemObjects built Oxygene which was a far better Object Pascal .Net compiler than Borland ever made and had the benefit that it integrated to Visual Studio rather than them trying to build their own IDE.

    Embarcadero who now own the remnants of Borland/Code Gear development tools division then licensed Oxygene from RemObjects and called it Delphi Prism. Last year I finally upgraded to Delphi-XE2 Pro in the form of Rad Studio, so I got the lot C++, Delphi and Prism.

    XE2 has been the first version since D7 that I could honestly say I liked, I even made the effort to port a major D7 project forward to XE2 as proof of capability and had some success, but to be honest I still spend the vast majority of my Object Pascal development time in D7 it was just so near to perfection :)

    If I were still in business for myself now, I would probably be doing any new development in .Net, Visual Studio has improved enormously over the years and of course just integrates properly with (sometimes :)) Microsoft's various new technologies like WebApi, Entity Framwork, WCF Data Services and so on and these technologies are just too powerful to ignore these days.

    I also find myself finally coming round to the notion that web development for all end user UI's is after all the future, I have always hated web development as Microsoft's Web offerings were horrible bloated monstrosities although the C# back end code was always elegant, I also hated loosely typed languages like javascript although I did learn to use it 13 years ago but also managed to forget most of it, but these days I have been knocking out a few intranet sites based on Microsoft's MVC 3 razor engine and that approach I like, JQuery is also making the client side code a little more bearable as interacting with the DOM was always such a pain.

    I still wish though, that there would be a good quality strongly typed client side browser hosted language adopted across the entire industry but it's never going to happen, the future is HTML 5, javascript and CSS and we all just have to get used to it.

    The amount of work available on new projects for desktop applications is now minuscule and I can't see that ever changing, mobile applications are either HTML5 or are dedicated platform specific like Silverlight for Windows Phone or Objective C for the iPhone and Java for Android, interestingly Embarcadero have given Delphi the ability to write iPhone apps now using their new Fire Monkey platform, it's something I need to look into.

    But yes Delphi 7 still rocks after nearly 11 years and long may it continue to do so :like:
  8. Markham
    Offline

    Markham Guest

    Oss, I rather think Embarcadero may face stiff competition as far as development for iOS is concerned. Xamarin makes a cross-platform development system available with C# as the language with iOS, OSX, Android and Windows as its targets; possibly also Linux. Not cheap though!

    The more recent versions of RAD Studio (XE2 and XE3) seem to contain quite a number of VCL components they've licensed from third parties such as FastReports and Script Studio but they don't appear to have done much work on updating the language or their own VCL controls, some of which are really quite dated now. I find it somewhat amusing that they still include Win31 controls!

    I don't know if you've had a play with YouTube Downloader v4.01 but I've notice a curious issue. If, from the Main window, you click on the Browse button and then wait a few seconds for YouTube's Home page to be completely rendered, you will see (briefly) a message on the Status Bar "Page Links under construction". That message is displayed whilst I build a list of hrefs and anchor texts. This list, coupled with the Browser's status message (which provides the URL under the mouse pointer), is used when you right-click on a link to a video and select the option "Add this video to Pending List" to provide a title for the saved link. Because the Gecko Browser object doesn't provide me with a list of links, I am actually parsing the document's text and use a fairly complex RegEx expression to build a match collection:

    @"data-sessionlink(.*?)href.*?=.*?\""/watch\?v=(?<href>.*?)\"".*?>(?<title>.*?).*?<a/>"

    Now that does successfully match most of the links but there are one or two on the Home page that defy all attempts. It works considerably better on other pages, however. I've scrutinised the html source and there is no difference in the markup between those for those that match and those that don't.

    Although the Gecko browser is a considerable improvement on the standard MS one, it is somewhat lacking. I may yet bite the bullet and replace it with a Chromium-based engine (Awesomium) which requires considerably fewer support files. But that means updating the whole project to .Net 4 which might cause a headache or two for users still on XP :erm:.
  9. oss
    Offline

    oss Somewhere Staff Member

    I've not played with it Mark, I don't really use YouTube although it would be something that Ana would enjoy, I might install it for her next time I am back home in Manila.

    It certainly looks like a fairly complex regex :D I don't generally have a lot of use for regular expressions in my line of work, I am more dependent on a good knowledge of SQL.

    I have many years ago tried to use IE via it's COM API so I can understand why you would want to use the Gecko layout engine, IE was hellish to try to hook, I had a friend who did go quite far down that particular road but it was seriously hard work for him.

    I'll maybe take a look at Gecko and Awesomium sometime.

    Ah just had a look on Codeplex, that Awesomium project is very interesting, damn you for showing me interesting things :D when I have a ton of other stuff to do at home just now :D

    Actually I need to put this on the back burner as I am in the middle of some new ideas myself right now and I need to get on top of a redevelopment of some existing ancient lousy web related stuff I built a few years back.

    All code becomes awful given enough time no matter how brilliant it seemed when one first wrote it :D although I still have a few nice Delphi tools from the old days that I built but never published and I still like them even now.

    You're right about the stagnation of the VCL in the latest Delphi versions, but that is due to their movement to this new Fire Monkey rendering engine, as I said although I have XE2 I don't really use it, still working in D7 for object pascal work virtually all the time but I may move to XE2 soon to help extend the lifetime of the legacy code I have to support, 64 bit is becoming an issue for some the apps I support.

    I think the main reason that Embarcadero bought Codegear was that most of their existing products were built using Delphi, we use ER Studio for database design and it is quite clearly a Delphi app even down to the use of the original Borland icons for Save and Cancel, it was simply a case of vested interest in the platform, no doubt a lot of other smaller companies would have been bricking it as well when Borland/Codegear were going through so many transformations, so I bet they were all somewhat relieved when Embarcadero bought them, they have however continued the crazy pricing regime that Borland had employed and it is also true that the Dev team is now tiny, sad but I hope it is still around for a good long while, too much legacy code depends on them.

    edit:

    You should make the installer force the download and install of .Net 4 for me nobody should be running on only .Net 2 these days.
    Last edited: Mar 9, 2013
  10. Markham
    Offline

    Markham Guest

    If you're going to play with Awesomium, ignore the CodePlex version - it's horribly out of date. You'll need to grab the latest SDK from Awesomium's web site but be warned, its a 49MB download plus a further 39MB if you also download the examples (which includes compiled binaries).

    I spent a couple of hours playing with it and it is pretty solid. But there's no access to the DOM which is a real nuisance and like so many of these projects, it's not well documented. And contrary to what I thought earlier, it's not Chromium-based but rather a wrapper around Webkit (which is a subset of Chromium).

    A better bet for my purposes may be Open-Webkit-Sharp which I'll be looking over the next day or so. According to the blurb I've read, O-W-S does support Net 2 (as well as 3, 3.5 and 4) so that might save some folks a 50-60MB download! It does expose the DOM and generally seems a more complete implementation. We'll see!
  11. aposhark
    Offline

    aposhark Well-Known Member Lifetime Member

    No, only machine code and/or gibberish :)

Share This Page