Reversing NSC

I’ve reverse engineered the encoding used in the Microsoft NSC format and written a decoder. Here’s how Cisco describes NSC:

A multicast description file is required at the Cisco content engine’s Windows Media Technology Server. This description file, in the form of an .nsc file, is received from a known URL, mount point, or even via email. This file is also referred to as an “announcement.” The source path follows the standards based URL format: http://www.cisco.com/path/filename.nsc. … the structure of the .nsc file is protected with the use of encryption. This is used to protect the media from network sniffing of the media source’s IP address, port, and stream format.

That it’s encryption is a faulty assumption (or bullshit marketing) on Cisco’s part. The algorithm doesn’t take a key.

Download: nscdec.c (MD5: 7c81ca49bc68c2b8671d00f0cdf960e3)

Example usage:
$ nscdec 02AW000000000SLm1D0580HG1C0440MG0m0380800i0200GG0000
Encoding type: 2
Decoded string: [WMRELAY02 , A]

Update: VLC should have NSC support in the near future.

64 thoughts on “Reversing NSC

  1. Tony Granberg

    Thank you very much!
    Now I will be able to watch broadband TV with mplayer or at least VNC in a near future. Can’t wait! (Bredbandsbolaget)

  2. Willy

    People like you are preventing that Big Brothers – Monopolist Companies and over-commercializing are trampling over the individual. We need more people like you balancing power between the user and the supplier. I hope the internet will stay for free enterprising for as long as it can. Greetings Willy.

  3. Hans-Peter Carpenter

    Hi,

    THANKS, you are great, you are doing incredible stuff. Freedom is what we all strive for, you make it happen again and agian.

    thank you

  4. Khabri

    Awesome dude. Just a thought. I was told by my friends that channelizing all my energy for the wrong purpose was no good. However, I would suggest, you use all your zeal and knowledge in building things, you will get more visiblity and respect in the society. Ultimately, in the end we have to play and respect by the laws. Sure I understand your love for open source but why don’t you start building something new ?

  5. Reimar Döffinger

    (tried to post before but it seems it didn’t work?)
    It’s really ridiculous that Cisco calls this “encryption”. I’m not really into this kind of thing but figured it out anyway.
    All you need to know is that Microsoft likes to reinvent the wheel, especially if the wheel is base64 encoding.
    Though my (unfinished) approach seems to be different, see here

  6. ReVeLaTeD

    IF you can crack DRM on WMV files…you’ll go down in infamy. To date, nobody has been able to effectively do this. It’s very annoying that you pay for a subscription to a website, download WMV “downloadable” files, only to find that you have to put in a username/password every time you want to watch the video, thus forcing you to keep the membership to the site.

  7. Philippe Landau

    thank you, Jon.
    besides, could VLC allow viewing sequences of movies frame by frame ?
    kind regards philippe

  8. Alsee

    Khabri: “I would suggest, you use all your zeal and knowledge in building things

    He did build something. He created software enabling interoperability. He enriched other software and other operating systems to be able to play a greater number of media file types.

    Khabri: “you will get more visiblity and respect in the society.

    I’d say has has earned an astounding level of vilibility and earned the highest respect for the various software he has created.

    Khabri: “in the end we have to play and respect by the laws.

    Are you confused? Have you been living under a rock for the past several years? He is famous in part because for being repeatedly and unjustly dragged through the courts by people trying to call him a criminal. He was completely and repeatedly vindicated. He did nothing wrong and broke no laws.

    Now if you’re saying that what he did would be illegal in YOUR country, well you have my condolences. Unfortuantely there are some very oppressive countries with some very backwards and opppressive laws against creating useful and perfectly legitimate new software.

    For example in the US there is the DMCA which says that people can go to prison whether they commit copyright infringment or not. Innocent noninfringing people can face felony charges. Fortunately the US does have hope to fix this broken law. There is an a bill being considered, the DMCRA, that would make a very small very simple very reasonable fix. It would amend the DMCA to say that noninfringing people are not criminals. I have never heard a single person oppose the DMCRA and give any reason why noninfringing people should be imprisoned.

  9. Sn4k3

    Nice one… but are u kinda ready to do it again? because windows media player 11 beta is do out sometime between November and January 2006

  10. anil

    great work and i would really like to see your future works in the lines of what ReVeLaTeD has to say that will be great

  11. Jack

    “He did nothing wrong and broke no laws.”
    WTF are you smoking, yes he did. Reverse engineering is illegal.

  12. Zero

    ““He did nothing wrong and broke no laws.”
    WTF are you smoking, yes he did. Reverse engineering is illegal.”

    That largely depends on where in the universe, or at least Earth, you are at the time. Before DMCA I was very much under the impression that even the backword US laws allowed reverse engineering.

    Zero

  13. compn

    actually, wmv drm played with wmp has been ‘cracked’ albiet a hole in wmp allows you to steal the keys from the drm and decrypt the wmv files to un-drm’ed wmv files, and its still working…

    heres a link to the 10 page thread on doom9 talking about sidda, drmcreep drm2wmv etc…
    http://forum.doom9.org/showthread.php?t=89243

  14. Eldamari

    Wow, great work on reversing protection schemes! Could you possibly look at Adobe’s 128-bit PDF protection? I realize that it is not video, but the protection scheme keeps me from using my college e-books on non-internet connected systems… :( Also, if you are willing to train I am willing to learn about reverse engineering. Feel free to contact me via email.

  15. Zero

    “if you are willing to train I am willing to learn”

    Who would not want to be trained by the great DVD Jon?

    It is akin to getting art lessons from Picasso.

    Zero

  16. tezza

    Rock on dude, indeed who would like to be trained by dvd jon.

    woohoo man keep it coming.

  17. Eldamari

    Eldamari: Adobe’s 128-bit PDF protection is was cracked yonks ago! There are plenty of legitimate programs around to crack it in a couple of seconds flat.

  18. noteverythingisfree

    [i]This is used to protect the media from network sniffing of the media source’s IP address, port, and stream format.[/i]

    Does this not open up a security issue?

  19. wendl

    Marvelous, but what am I suppose to do to use NSC decoder file ? How to use this file ?

  20. .:t1:.

    Great work, but what about encoding to the NSC format? Will you release code for that?

  21. .:t1:.

    Any thoughts about using VLC as a multicast streaming server for ASF/WMV, with both WMP and VLC clients? With NSC encoding support that could be possible? The code would also be even nicer and more symmetrical with encoding support, IMHO :-)

  22. Flying Jack

    Nice job man !
    But I can’t compile the source file :(, it doesn’t work on my FreeBSD box.
    It needs iconv lib, so I install it, but i still miss iconv.h :(
    Do you think it’s possible to make a php file for decrypt a nsc format ?
    Thanks :)

  23. sprockkets

    Reverse engineering of hardware or software for the making of interoperability on products is perfectly legal. Just because Microsoft’s or any one elses EULA say it is prohibited means nothing, because right as soon as they say that, at the end of the license agreement they say stuff like if anything goes against current laws in your country, then the above terms shall not be enforceable. They do this to scare people.

    If it was illegal to do reverse engineering, then the people who make open source drivers, protocols, and other things would have been sued long time ago. You do not see nVidia sueing people for the opensource “forcedeth” driver do you because they reverse engineered the nVidia ethernet controller, or for Intel video drivers, or many, many other things?

    DVDs and breaking encryption due to the DMCA is another story, but keep in mind, right in the DMCA, even that provision is not to be superseeded by current copyright law which allows for consumer backup. The stupid judge though didn’t care about that.

  24. kilobyte

    Well done dude…but tell me how did you do it ??? i´ts realy impressive.. where did you start, i want some knowledge about this…thanks for what youre being done… i want a reply about this please…or tuts.

    my e-mail is kilobyte@sapo.pt

    thanks dude :)

  25. GreeNone

    I think your doing right when reverse engeniering such software. I also would like to be able to see WMV/NSC on my linux box , wherever its legal or not.

    Your doing a great job dude, please keep playing on ;)

    GreetZzz from the Netherlands

  26. Connelly Barnes

    Khabri: “in the end we have to play and respect by the laws.”

    An astounding imperative! I like it: the boldness, the frankness, the righteousness, the commanding air, the “I’m being backed up by the collective will and might of the people of my country, therefore I AM CORRECT.” I’m being both sarcastic and serious: your statement cuts, yet I like that you aren’t afraid to say it.

    But, I assume that you refer only to “just laws.” And therein lies the crux of the problem.

  27. Frank

    Wonderful piece of application, hoping to get some NSC streams to run on my PDA on the go, but after reversing the encryption I can’t seem to figure out the actual location of the stream. Here is the output:

    nsc debug: Time To Live = 15
    nsc debug: Distribution Limit = 5
    nsc debug: Player URL = http://codecs.microsoft.com/isapi/mpupgrade.dll
    nsc debug: Player Version = 4.0.1.3850
    nsc debug: NSC Format Version = 3.0
    nsc debug: Channel Version = 5
    nsc debug: Name = A10
    nsc debug: IP Address = 224.224.20.102
    nsc debug: IP Port = 7707
    nsc debug: Multicast Adapter = 202.156.4.232
    nsc debug: Delivery Mode = 2
    nsc debug: Format1 = asf header
    nsc debug: Description1 = slot2.asf

    Anyone kind enough to enlighten me?

  28. lokin

    I am from the US and read about you in the biggest news paper of ALL… The Wall Street Journel you are very big and many eyes are looking at you, but I’m sure you will outsmart them all without trial. You are a specialist in your field like I am in mine, I would like to learn how to use your.. inventions but most blogs are years ahead of me.

    thanks

  29. Jonathan Clarke

    Hi,

    I’m not really clear on what this file is supposed to do?

    Can I use it to get round WMP IP sniffing technology? As I’m abroad at the moment, I can’t use the BBC Imp (built on IE and WMP) to view programs as it seems one needs to be dialling in from a UK IP.

    Jonathan

  30. milou

    Hi, thanks a lot for decoding !! But, do you know how to encode without using WMP encoder ? I work in broadcast area, and I need to create an .nsc file in order to be able to play streams and broadcast them.

    Thanks again !!

  31. Edward O'Neill

    How’s this for strange. Windows Media files with DRM need a key downloaded–even when the content is free. Some sites actually just want to keep track of how many times/over what period you’re actually watching it! It’s like Tivo sending information back to Tivo about what’s being Tivo’d that week…..Disturbing.

  32. Chris Camilli

    I like the TiVo thing….and what developer…..buisness….Record Label……or Media distributor….would not like to see the Actual results of thier labor…..and be in control at the same time….

  33. nver

    Our local DSL company recently started broadcasting internet TV to its customers.
    And your tool helped me a lot.
    Thanks.

  34. kool

    Frank

    can you tell me how you’ve compiled the program without “iconv.h”

    i get this error
    Configuration: nscdec – Win32 Debug——————–
    Compiling…
    nscdec.c
    c:documents and settingsadministratordesktopnscnscdec.c(23) : fatal error C1083: Cannot open include file: ‘iconv.h’: No such file or directory
    Error executing cl.exe.

    nscdec.exe – 1 error(s), 0 warning(s)

  35. HotNik

    Can someone tell me how to use this prog? or can anyone compile it and provide new links?

  36. Burningmace

    Hmm, I seem to be getting the same error (regarding iconv.h) as above.
    A quick google search reveals that this file is related to several Linux distros.

    Is there a way to compile this in a Win32 environment (without emulation such as cygwin)?

  37. SEoD

    I’ve managed to get it to compile under windows using Dev-C++ with the libiconv devpack installed. Search for “libiconv-1.8_1-1spec.DevPak” to find a copy of that. I also had to move the line:

    char *p_input = &argv[ 1 ][ 0 ];

    up to the top of main (I think in c you’re supposed to declare all variables at the top of the class).

    On top of that I had to put “-liconv” in the linker’s commandline to link libiconv. Then I had to edit out an if statement:

    if( iconv( conv, &p_buffer, &buffer_size,
    &p_buf8, &buf8_size ) == -1 )
    {
    fprintf( stderr, "iconv failedn" );
    ret = 1;
    }

    else

    .. which was causing compilation errors I couldn’t fix (to do with the type of the 2nd arg for iconv IIRC).

    Then it compiled! You’ll also need a copy of libiconv-2.dll if you do it my way though.

    The bad news is: most of the data I’ve fed it has given me an empty string in return. Even the one Jon uses in his example usage above. Not sure what’s going on there as the code I edited out was only error-checking.

Comments are closed.