Forgot your password?
typodupeerror
Encryption Security Businesses Software Your Rights Online Apple

After DeCSS, DVD Jon Releases DeDRMS 610

Posted by timothy
from the one's-right-to-annoy dept.
An anonymous reader writes "Jon Lech Johansen, who reverse engineered FairPlay back in January, and wrote the decryption code that was later used by an anonymous developer to create the playfair utility, has released a similar utility: DeDRMS. It's only 230 lines. T-shirts anyone?"
This discussion has been archived. No new comments can be posted.

After DeCSS, DVD Jon Releases DeDRMS

Comments Filter:
  • by Rikus (765448) on Sunday April 25, 2004 @05:10PM (#8967353)
    I'm guessing it will be rewriten by plenty of people in various different languages. C, perl, python... fortran77?
    I don't even have a C# compiler.
  • Host it on Freenet? (Score:3, Informative)

    by Anonymous Coward on Sunday April 25, 2004 @05:12PM (#8967371)

    Let's host this program on Freenet [sourceforge.net], it is a project that make's the best use for what Freenet was made for.

  • blah (Score:4, Informative)

    by Anonymous Coward on Sunday April 25, 2004 @05:12PM (#8967379)
    For the junk filer:
    jhsvjklhajskdvhakjsdhvalkjsdhkajdhfasd hsfvhasdhvf asdf asdf asdf asdf sdf asdhvashdvasdf asdf asd sdf coipx vxjzlk sdhvaasd fasd fadfg fiobvxcoizv jcxoixz jxzc sdhvaf cmdrtaco sucks akljdkls asd asd fvx sdhvas gh hh hhf dd sdf sf sd
    hdvash jk k fgh jgdvvcbbn cv c dhvc c vb fg hdrghdfg fg dg df g dsf
    ashdva sdfgsgewrr benrtnrt er er revr dv shdva aioajdoi jfasdioj v;xjf kldasjkl;vasj sdhva sjkdfsdkvn alkn lkan alksnsdflk nsfnvlad dhvahsdva aisovaiouvoivoiua ioua auao iuasi us shdva asivoa jvhbusa ui hiuahsiuhfsa ha ahsdjkfahkdj lfhalksjdfhalk askjda
    vhasdvhasdjhvaksjdhva a kjas lkjdakljf svhasdhvaskjhvlaskjdvhas a kljs djklakslj af
    asvhajkshvjkshas dhasdjvkhasdv akjdfjadf asds s d fsd fsad fads asdfas asdf asdf sdfs vxcvxcvzxcvx ss dfsdxvc dfa bioub oiu zklxcvx nsm,m,fns,m
    sdfas ikj oixj movnxmcvnxcvo sdoifjs dfsddafgdfg kamlxcvbjio zkcnvzlk nxclk xcivx as df sdf asdf asd vi xoizjvzcvn socso s asd addfsdfahtgh fghdfgh df gd d

    using System;
    using System.IO;
    using System.Text;
    using System.Security.Cryptography;

    class M4PStream
    {
    private Rijndael alg;

    private BinaryReader br;
    private BinaryWriter bw;
    private byte [] sbuffer;

    private string AtomDRMS = "drms";
    private string AtomMP4A = "mp4a";
    private string AtomSINF = "sinf";
    private string AtomUSER = "user";
    private string AtomKEY = "key ";
    private string AtomIVIV = "iviv";
    private string AtomNAME = "name";
    private string AtomPRIV = "priv";
    private string AtomSTSZ = "stsz";
    private string AtomMDAT = "mdat";

    public M4PStream( FileStream fs )
    {
    br = new BinaryReader( fs );
    bw = new BinaryWriter( fs );
    sbuffer = br.ReadBytes( Convert.ToInt32( fs.Length ) );

    alg = Rijndael.Create();
    alg.Mode = CipherMode.CBC;
    alg.Padding = PaddingMode.None;
    }

    byte [] NetToHost( byte [] Input, int Pos, int Count )
    {
    if( BitConverter.IsLittleEndian )
    {
    for( int i = 0; i < Count; i++ )
    {
    Array.Reverse( Input, Pos + (i * 4), 4 );
    }
    }

    return Input;
    }

    int GetAtomPos( string Atom )
    {
    byte [] Bytes = Encoding.ASCII.GetBytes( Atom );

    for( int i = 0; i < (sbuffer.Length - 3); i++ )
    {
    if( sbuffer[ i + 0 ] == Bytes[ 0 ] &&
    sbuffer[ i + 1 ] == Bytes[ 1 ] &&
    sbuffer[ i + 2 ] == Bytes[ 2 ] &&
    sbuffer[ i + 3 ] == Bytes[ 3 ] )
    {
    return i;
    }
    }

    throw new Exception( String.Format( "Atom '{0}' not found", Atom ) );
    }

    uint GetAtomSize( int Pos )
    {
    byte [] Bytes = new byte[ 4 ];
    Buffer.BlockCopy( sbuffer, Pos - 4, Bytes, 0, 4 );
    return BitConverter.ToUInt32( NetToHost( Bytes, 0, 1 ), 0 );
    }

    byte [] GetAtomData( int Pos, bool bNetToHost )
    {
    uint Size;
    byte [] Bytes;

    Size = GetAtomSize( Pos );
    Bytes = new byte[ Size - 8 ];
    Buffer.BlockCopy( sbuffer, Pos + 4, Bytes, 0, Bytes.Length );

    return bNetToHost ? NetToHost( Bytes, 0, Bytes.Length / 4 ) : Bytes;
    }

    public void Decrypt( byte [] CipherText, int Offset, int Count,
    byte [] Key, byte [] IV )
    {
    MemoryStream ms = new MemoryStream();

    ICryptoTransform ct = alg.CreateDecryptor( Key, IV );
    CryptoStream cs = new CryptoStream( ms, ct, CryptoStreamMode.Write );
    cs.Write( CipherText, Offset, (Count / 16) * 16 );
    cs.Close();

    ms.ToArray().CopyTo( CipherText, Offset );
    }

    public byte [] GetUserKey( uint UserID, uint KeyID )
    {
    byte [] UserKey;
    BinaryReader bruk;

    string strHome =
    Environment.GetFolderPath( Environment.SpecialFolder.ApplicationData );
    bool bUnix = Environment.OSVersion.ToString().IndexOf( "Unix" ) != -1;
    string strFile = String.Format( "{0}{1}{
  • by harlows_monkeys (106428) on Sunday April 25, 2004 @05:16PM (#8967409) Homepage
    These things are traditionally written in C ( for speed )

    You are assuming that C# is slow. That is not a good assumption.

  • by Anonymous Coward on Sunday April 25, 2004 @05:16PM (#8967415)
    I was fortunate enough to load the page during the 1 minute that the server stayed up.

    Now let's see how long my little mirror stays up!

    http://fire.prohosting.com/xonerate/dedrms.txt

  • by sosume (680416) on Sunday April 25, 2004 @05:17PM (#8967416) Journal
    Since this code is easily converted to c++ (or VB) using one of the various tools available, this won't gain much or any speed under .NET.

    BTW he *could* have included some comments ;)
  • by Anonymous Coward on Sunday April 25, 2004 @05:22PM (#8967463)
    Stupid junk filter doesn't let me post this. Why oh why? Code after filler...

    In the beginning God created the heaven and the earth.
    2 And the earth was without form, and void; and darkness was upon the face of the deep. And the Spirit of God moved upon the face of the waters.
    3 And God said, Let there be light: and there was light.
    4 And God saw the light, that it was good: and God divided the light from the darkness.
    5 And God called the light Day, and the darkness he called Night. And the evening and the morning were the first day.
    6 And God said, Let there be a firmament in the midst of the waters, and let it divide the waters from the waters.
    7 And God made the firmament, and divided the waters which were under the firmament from the waters which were above the firmament: and it was so.
    8 And God called the firmament Heaven. And the evening and the morning were the second day.
    9 And God said, Let the waters under the heaven be gathered together unto one place, and let the dry land appear: and it was so.
    10 And God called the dry land Earth; and the gathering together of the waters called he Seas: and God saw that it was good.
    11 And God said, Let the earth bring forth grass, the herb yielding seed, and the fruit tree yielding fruit after his kind, whose seed is in itself, upon the earth: and it was so.
    12 And the earth brought forth grass, and herb yielding seed after his kind, and the tree yielding fruit, whose seed was in itself, after his kind: and God saw that it was good.
    13 And the evening and the morning were the third day.
    14 And God said, Let there be lights in the firmament of the heaven to divide the day from the night; and let them be for signs, and for seasons, and for days, and years:
    15 And let them be for lights in the firmament of the heaven to give light upon the earth: and it was so.
    16 And God made two great lights; the greater light to rule the day, and the lesser light to rule the night: he made the stars also.
    17 And God set them in the firmament of the heaven to give light upon the earth,
    18 And to rule over the day and over the night, and to divide the light from the darkness: and God saw that it was good.
    19 And the evening and the morning were the fourth day.
    20 And God said, Let the waters bring forth abundantly the moving creature that hath life, and fowl that may fly above the earth in the open firmament of heaven.
    21 And God created great whales, and every living creature that moveth, which the waters brought forth abundantly, after their kind, and every winged fowl after his kind: and God saw that it was good.
    22 And God blessed them, saying, Be fruitful, and multiply, and fill the waters in the seas, and let fowl multiply in the earth.
    23 And the evening and the morning were the fifth day.
    24 And God said, Let the earth bring forth the living creature after his kind, cattle, and creeping thing, and beast of the earth after his kind: and it was so.
    25 And God made the beast of the earth after his kind, and cattle after their kind, and every thing that creepeth upon the earth after his kind: and God saw that it was good.
    26 And God said, Let us make man in our image, after our likeness: and let them have dominion over the fish of the sea, and over the fowl of the air, and over the cattle, and over all the earth, and over every creeping thing that creepeth upon the earth.
    27 So God created man in his own image, in the image of God created he him; male and female created he them.
    28 And God blessed them, and God said unto them, Be fruitful, and multiply, and replenish the earth, and subdue it: and have dominion over the fish of the sea, and over the fowl of the air, and over every living thing that moveth upon the earth.
    29 And God said, Behold, I have given you every herb bearing seed, which is upon the face of all the earth, and every tree, in the which is the fruit of a tree yielding seed; to you it shall be for meat.
    30 And to every beast of the earth, and
  • Re:Written in C# (Score:4, Informative)

    by ikkonoishi (674762) on Sunday April 25, 2004 @05:27PM (#8967499) Journal
    Think music notation [freeyellow.com]

    Thus c# = c sharp
  • by reub2000 (705806) * on Sunday April 25, 2004 @05:35PM (#8967552)
    ed2k Link: DeDRMS.cs [ed2k]
  • by Anonymous Coward on Sunday April 25, 2004 @05:41PM (#8967588)
    1. DeDRMS can be used for Fair Use, not just "illegal piracy" - which, by the way, is a misleading term anyway; you really mean "copyright infringement"

    2. At least it's better than associating Freenet with child pornography, like it is now!
  • by Anonymous Coward on Sunday April 25, 2004 @05:42PM (#8967600)
    I can't really help you with the problems with installing the mono client... but this is what I did (with my win2k box)

    www.go-mono.com -> c# compiler -> downloads page

    get the file mono-0.31-win32-1.exe

    run it, click okay a couple times...

    get a copy of the code....

    mcs DeDRMS.cs

    and you have an exe that's command-driven.

    command is : DeDrms.exe myfile.m4p

  • by Anonymous Coward on Sunday April 25, 2004 @05:42PM (#8967601)
    I was able to access the README before the server went down:

    Compiling:

    * With MonoDevelop [1]: Open DeDRMS.cmbx and click F8.
    * With mcs [2]: mcs -out:DeDRMS.exe *.cs
    * With csc [3]: csc /out:DeDRMS.exe *.cs

    [1] http://www.monodevelop.org [monodevelop.org]
    [2] http://www.go-mono.com [go-mono.com]
    [3] http://msdn.microsoft.com/netframework/technologyi nfo/howtoget/ [microsoft.com]

    Usage:

    * DeDRMS.exe file.m4p

    Notes:

    DeDRMS requires that you already have the user key file(s) for
    your files. The user key file(s) can be generated by playing
    your files with the VideoLAN Client [1][2].

    DeDRMS does not remove the UserID, name and email address.
    The purpose of DeDRMS is to enable Fair Use, not facilitate
    copyright infringement.

    [1] http://www.videolan.org/vlc/ [videolan.org]
    [2] http://wiki.videolan.org/tiki-read_article.php?art icleId=5 [videolan.org]
  • by Anonymous Coward on Sunday April 25, 2004 @05:47PM (#8967634)
    Things like that were traditionally written in C because it's easy to manipulate memory and pointers, which is useful for making things like encryption/decryption easier to write.
  • by RPoet (20693) on Sunday April 25, 2004 @05:52PM (#8967655) Journal
    You know, instead of saying "we" should do it, you could have just done it. It's very easy. So I did it for you.

    CHK@XTn8vik~xxqsIJzLcDFUlPQqrw4NAwI,griuDFoqruNU 09 1-2Qj8Ew/DeDRMS.cs

    (Watch out for the space inserted by the slashdot code, remove it)
  • It works, but...... (Score:2, Informative)

    by Anonymous Coward on Sunday April 25, 2004 @05:53PM (#8967662)
    It works, but you have to open the file with VLC first so the key for it is in the documents and settings\application data\drms directory.
  • Re:DeDRMS (Score:4, Informative)

    by moonbender (547943) <moonbender@gmai3.14159l.com minus pi> on Sunday April 25, 2004 @05:53PM (#8967666)
    Originally, the actual authors complained about publishers distributing their work lawfully. Nowadays, the publishers (and not the actual authors, who have sold away their copyright) complain about other people who illegaly distribute their work. Thus, it is almost the reverse.
    Although I agree that your argument is correct, too - however, the legal owner isn't necessarily the rightful owner: some people will say that selling away copyrights shouldn't be possible, and certainly not rightful.
  • by ThePyro (645161) on Sunday April 25, 2004 @05:53PM (#8967667)
    This tool seems to require that you already have your key stored in a file somewhere. This code just uses that key along with .NET's built-in cryptographic services to decrypt the data and write it back to the file. Seems like getting your hands on the key in the first place would be the hard part...
  • Freenet mirror (Score:3, Informative)

    by RPoet (20693) on Sunday April 25, 2004 @05:54PM (#8967674) Journal
    Freenet mirror:

    CHK@XTn8vik~xxqsIJzLcDFUlPQqrw4NAwI,griuDFoqruNU 09 1-2Qj8Ew/DeDRMS.cs

    (Watch out for space inserted by the slashdot code, remove it)
  • by cduffy (652) <charles+slashdot@dyfis.net> on Sunday April 25, 2004 @05:56PM (#8967691)
    Re installing Mono on Linux, you might do well to use the GARNOME [gnome.org] packages; that way, you're building everything from source to be installed under its own prefix, and thus avoiding dependency hell.
  • by Sam H (3979) <sam@zoy.org> on Sunday April 25, 2004 @05:58PM (#8967697) Homepage
    Using C# makes sense to me. It provides Rijndael and MD5 in System.Security.Cryptography out of the box. These cypher and hash algorithms are at the core of the DRMS encryption scheme. The same code in C would either use obscure libraries or 1000 extra lines of code.
  • CODE MIRROR HERE (Score:4, Informative)

    by blixel (158224) on Sunday April 25, 2004 @06:00PM (#8967719)
    Enjoy [blixel.com]
  • SharpDevelop (Score:4, Informative)

    by renelicious (450403) on Sunday April 25, 2004 @06:00PM (#8967724)
    This is a little offtopic, but since its written in C#, for those of you what don't have Visual Studio and don't want to mess with the command line tools (or don't have Mono on Linux) SharpDevelop [icsharpcode.net] is a great C# development product. Its GPL. Again a little of topic, but its always good to pimp your favorite software.

    Yes, there's also a Linux version [monodevelop.org].
  • by goMac2500 (741295) on Sunday April 25, 2004 @06:01PM (#8967734)
    They'd make iTunes work under WINE. As a side note I am sick and tired of people complaining that Apple does not let iTunes Music Store songs work under other media players. They do. Any media player can play iTunes Store music using the QuickTime API. All you have to do is write a plugin to interface with QuickTime. I wrote a QuickTime based media player a few years ago. Guess what? I started it up today and it played iTunes Music Store songs just fine. NO modifications. Its my own media player, yet it plays DRM'd music fine, no special un-DRMing.
  • by t_pet422 (613073) on Sunday April 25, 2004 @06:01PM (#8967735) Homepage
    I don't even have a C# compiler.

    Install the .NET Framework (run Windows Update). It will install one at %WINDIR%\Microsoft.NET\Framework\v1.1.4322\csc.exe
    You can compile this with csc /out:DrDRMS.exe *.cs
  • by damiam (409504) on Sunday April 25, 2004 @06:02PM (#8967748)
    apt-get install mono
  • Re:pretty cool... (Score:5, Informative)

    by TravisWatkins (746905) on Sunday April 25, 2004 @06:03PM (#8967764) Homepage
    No, it's not up to the player to enforce the DRM. When you purchase a song from iTunes you are given the DRM'ed file, an md5 hash of the file, and two keys. Not sure what the other key is for, but one is the encryption key. You put that with the song and you get a DRM free song. Thats exactly what this does. PS - Reverse engineering the iTMS is fun!
  • Re:ok... (Score:3, Informative)

    by sweetooth (21075) on Sunday April 25, 2004 @06:07PM (#8967791) Homepage
    It's not under the LGPL, and I don't even believe that it has been put out under Microsofts Shared Source license (yet). Even the Mono implementations aren't released under the LGPL they are licensed under the MIT X11 license with exceptions. Which you can read about in the Mono FAQ at go-mono.com [go-mono.com]
  • Re:Site Down? (Score:1, Informative)

    by danielblair (637546) <javahax0r@gmail.com> on Sunday April 25, 2004 @06:19PM (#8967896) Homepage
    It's Slashdotted!!! Here is MY MIRROR!!! USE IT AND TRY AND MIRROR TO OTHER PLACES SO EVERYONE DOESN'T GO DOWN!!!

    http://www.realcoders.org/dedrm/DeDRMS_cs.cs [realcoders.org]

    -Daniel Blair

  • by Anonymous Coward on Sunday April 25, 2004 @06:46PM (#8968045)
    No, the libraries are not "extra" -- it's impossible to get .NET without them. In fact .NET itself relies on the crypto stuff.
  • What this does (Score:5, Informative)

    by EvilGrin666 (457869) on Sunday April 25, 2004 @06:46PM (#8968048) Homepage
    For those of you that don't know. It removes the protection from a .m4p file (Downloaded with iTunes) . So basically you end up with a Vanilla AAC file.
  • by omicronish (750174) on Sunday April 25, 2004 @06:57PM (#8968099)

    Install the .NET Framework (run Windows Update). It will install one at %WINDIR%\Microsoft.NET\Framework\v1.1.4322\csc.exe You can compile this with csc /out:DrDRMS.exe *.cs

    And if you're on Linux, you can download Mono [go-mono.com] and compile with mcs DeDRMS.cs.

  • by wasabii (693236) on Sunday April 25, 2004 @06:58PM (#8968103)
    www.go-mono.com
  • by Chester K (145560) on Sunday April 25, 2004 @07:11PM (#8968181) Homepage
    This code just uses that key along with .NET's built-in cryptographic services to decrypt the data and write it back to the file. Seems like getting your hands on the key in the first place would be the hard part...

    VLC will extract your user key and save it into your home directory when you use it to try to play a FairPlay-protected file from an authorized system.
  • by Cthefuture (665326) on Sunday April 25, 2004 @07:20PM (#8968223)
    You are assuming that C# is slow. That is not a good assumption.

    Maybe they weren't assuming anything but had actually done testing?

    I don't know about that, but I have in fact done testing and C# is slower at almost everything when compared to C/C++ and it gets really bad at the high end.

    Try making the equivalent (in terms of performance and memory usage) of a C++ std::vector in C#.
  • by werdna (39029) on Sunday April 25, 2004 @07:30PM (#8968274) Journal
    Sometimes, it's necessary to demonstrate the absurdity and futility of a bad law in order to make the lawmakers (and judges) understand why it's bad.

    And as a guy who has actually lobbied against technology regulation, I am here to tell you that the present "demonstration" does not evidence badness of the technology regulation. Indeed, content people use precisely these circumstances, and again, I am here to tell you it persuades, to evidence that they need the regulation as well as technology to survive.

    I am well-versed in the arguments against. I am simply telling you that they do not move legislators to repeal technology regulation, and tend to the contrary, to get them to consider even stranger more desperate bills like last year's spate of "stupid Hollings bills."

    Consider this -- How, exactly, does showing that you can pick a lock prove the absurdity and futility of laws making it a crime to own a lock pick? Sure, I can find counterarguments, and you can too, but none that would make men change a vote. And I'm a pretty good advocate as these things go.

    This doesen't help.

    P.S. Thanks for the litref :)
  • by $exyNerdie (683214) on Sunday April 25, 2004 @07:34PM (#8968298) Homepage Journal

    Follow the steps to compile and run it:
    (1) Get the source code (at your own risk) and save it as DeDRMS.cs
    (2) Download and Install the NET Framework SDK [microsoft.com] for FREE (reqiures Windows 2000, Windows Server 2003 or Windows XP).
    (3) Use the included compiler csc.exe to compile the source code into executable code. Use this on command line (dos prompt) C:>csc DeDRMS.cs OR C:>csc.exe DeDRMS.cs
    (4) It will create DeDRMS.exe in the same folder where you saved DeDRMS.cs.
    (5) Profit or Jail??

  • by dethl (626353) on Sunday April 25, 2004 @07:40PM (#8968340)
    1. Get and compile Mono (emerge mono for those of you with Gentoo). 2. In the command line, type: mcs DeDRMS.cs 3. Then type: mono DeDRMS.exe There ya go!
  • by Anonymous Coward on Sunday April 25, 2004 @07:52PM (#8968410)
    Compiled Binary for Windows 2000/NT/XP
    http://userwww.sfsu.edu/~astern/DeDRMS .exe
    7.00 KB

    C# Source
    http://userwww.sfsu.edu/~astern/DeDRMS.cs
    7.21 KB

    Andrew
    astern at s f s u dot edu
  • by Anonymous Coward on Sunday April 25, 2004 @08:00PM (#8968450)
    It's not a cracking tool. You have to have a legitimate copy of the song from iTunes. That is, if you haven't paid for the song this tool does you no good. It just removes the DRMS protection from something you've legitimately paid for. Hurrah.

    One thing I noted in looking at the two files in iTunes: The file was still flagged with my email address, but no longer had my name under "Purchased by"... It looks like the file is still tracable to the account that bought it. Take that into account before sharing them. It shouldn't take much work to fix that last bit, and it would be a worthy addition to this program.

  • by Anonymous Coward on Sunday April 25, 2004 @08:22PM (#8968590)
    I think mono [go-mono.com] is available from fink (or in the process of being made available).

    There is also rotor [microsoft.com] from Microsoft, which is supposed to compile under MacOS X.
  • by Anonymous Coward on Sunday April 25, 2004 @09:11PM (#8968857)
    ... so people will actually see this.

    I compiled it on my Win2K box and got the following message:

    C:\iTunes\ALICEI~1\Dirt>dedrms "05 Rooster 1.m4p"
    Exception: Could not find a part of the path "C:\Documents and Settings\administ rator\Application Data\drms\03293A28.001".


    Upon surfing Johansen's site, I found the following readme that the Slashdot submitter failed to mention:

    Compiling:

    * With MonoDevelop [1]: Open DeDRMS.cmbx and click F8.
    * With mcs [2]: mcs -out:DeDRMS.exe *.cs
    * With csc [3]: csc /out:DeDRMS.exe *.cs

    [1] http://www.monodevelop.org
    [2] http://www.go-mono.com
    [3] http://msdn.microsoft.com/netframework/technologyi nfo/howtoget/

    Usage:

    * DeDRMS.exe file.m4p

    Notes:

    DeDRMS requires that you already have the user key file(s) for
    your files. The user key file(s) can be generated by playing
    your files with the VideoLAN Client [1][2].

    DeDRMS does not remove the UserID, name and email address.
    The purpose of DeDRMS is to enable Fair Use, not facilitate
    copyright infringement.

    [1] http://www.videolan.org/vlc/
    [2] http://wiki.videolan.org/tiki-read_article.php?art icleId=5

    2004-04-25 == Jon Lech Johansen ====


    So it sounds like you have to run some lame-ass VideoLAN doohickey before DeDRMS will work.

    Gee, tres impressive. Tell you what, Jon... call me when you have a standalone M4P2MP3.EXE ready to go. Right now, all of the circumvention hacks for iTunes are way more of a hassle than just burning your tracks to CD and re-ripping them to MP3.
  • by ca1v1n (135902) <snook.guanotronic@com> on Sunday April 25, 2004 @09:18PM (#8968888)
    Remember that research that found that emulating the underlying hardware with a sufficiently intelligent userland dynamic profiler was usually faster than running directly on the underlying hardware? The dynamic profiler can optimize like no compiler will ever be able to do with static analysis. It's a similar principle to what Transmeta does with their x86 emulation. Modern Just-In-Time Compilers use dynamic profiling to accelerate things, and they're getting quite good. It's certainly quite possible to design a C# vector class that's both more memory and processor efficient in most cases than C++. Here's how:

    1) Record in the virtual machine/JIT every time a vector gets resized.
    2) Based on the pattern of resizing, speculatively allocate for new vectors/resizes as much memory as they'll ever need, or at least as much as they'll need any time soon.
    3) When you guess wrong about a speculative allocation, adjust your speculation.

    C++ doubles the amount of space allocated for a vector (or queue, or list, or stack, or dequeue, or binary heap, etc) whenever a resize exceeds the amount already allocated, unless you know enough to tell it to do otherwise. This keeps the amortized cost of increasing size by one constant. C++ doesn't benefit from profiling like C# does because there's no virtual machine that can change what binary code is actually sent to the processor. You could hack vector profiling together yourself, but it would be slow. Of course, this doesn't really help C# if you're never resizing your vectors, but that doesn't mean C# can't do better than C, even if C++ will have it beat. If you've ever done much benchmarking of the C++ STL, you know that it's usually faster than otherwise identical code written with arrays, which shouldn't be possible, since the array access code can be done fairly easily in assembly without virtual function table lookups and such, but nonetheless is quite real.

    The trick to this whole scheme is doing the speculation quickly and accurately. We may not be to the point yet where JIT code reliably outperforms statically compiled code in less space, but there are an army of extraordinarily intelligent grad students out there writing dissertations on the topic, and I assure you they'll make it happen.
  • by AstroDrabb (534369) * on Sunday April 25, 2004 @09:19PM (#8968895)
    It even destroyed gcc C in trig calculations, though, got slaughtered by gcc C's 'double' math tests.
    From the article:
    compiled using gcc within the Cygwin bash shell emulation layer for Windows.

    A much more fair comparision would have been gcc under a *nix environment instead of the Win32 port. This "benchmark" also didn't take into consideration slower startup times, pauses due to garbage collection or code being JITed. All in all, this benchmark is useless. Though from personal experience, I do agree that C# and Java both have very good performance on modern hardware to make their use a much better alternative over lower level and error prone languages like C/C++. Java and C# both showed good numbers, except for that strange regression in Java's Trig functions.
  • by TrashGod (752833) on Sunday April 25, 2004 @10:43PM (#8969238) Journal
    Mono is available from Darwin Ports, [opendarwin.org], among others.
    Not that I've tried it:-)
  • Re:What this does (Score:3, Informative)

    by danielsfca2 (696792) * on Sunday April 25, 2004 @11:01PM (#8969355) Journal
    > ...which you can then re-import into iTunes, right-click on and say "convert to MP3"

    ...which would make someone an idiot for transcoding music (Hello shitty sound!), and a bigger one for not knowing that AAC is better at any given bitrate anyway.

    Non-idiots will use this program to create unencrypted AACs which they will then leave in that format and play on the many media players that support AAC.

    If you wanted a shitty-sounding MP3 why not just use Kazaa in the first place?

  • by shodson (179450) on Sunday April 25, 2004 @11:39PM (#8969551) Homepage
    So this undo Apple's FairPlay DRM? Or Microsoft's DRM? Quicktime? I couldn't really tell which DRM scheme it De-s.
  • by Anonymous Coward on Monday April 26, 2004 @02:14AM (#8970026)
    Or Portable.NET (google for it). I find it often works much better than Mono (and it has proper System.Windows.Forms support out of the box).

  • by Anonymous Coward on Monday April 26, 2004 @02:55AM (#8970215)
    With all the hoopla about open source programs to strip DRM from music bought at the iTunes music store, no one has mentioned that the same (or similar) can be done with Apple's own iMovie. If you import a protected song into an iMovie project, iMovie will transcode the .m4p into an .aiff file that you can find in the Media folder of your project. The .aiff file is a normal aiff file, no DRM.
  • by TheDanish (576008) on Monday April 26, 2004 @04:02AM (#8970455) Journal
    Just use "for" for expanding wildcards.

    Mini-howto:
    Make directory "here" and batch file "foo.bat"

    Put single line into batch file:

    for %%f in (*.m4p) do DeDRMS "%%f"

    Run the batch file.

A bug in the code is worth two in the documentation.

Working...