Removing iTunes 10.4 m3u processing feature with a small loader

I just discovered that iTunes 10.4 finally introduced support to load m3u files. If you are importing large quantities of mp3 archives like me then you probably will be very annoyed by the mess that iTunes 10.4 will make out of this – playlists will be created and a ugly mess will emerge (and takes longer to process). So it was time to try to remove this feature, which is curious since I always wanted this in iTunes, before I surrended myself to its way of managing mp3s. A quick google search shows that I am not the only one having “issues” with this new feature πŸ™‚

First attempt was to disassemble and search for the code. Well, iTunes is a huge program and I just wanted a quick hack (I did find more or less where the interesting code is). So why not searching for the string m3u and modify it? Most probably iTunes was processing the files based on extension and modifying that string would effectively remove this feature.

A quick test with GDB and voila, it works. No more m3u/m3u8 (unicode version) processing! Hurray πŸ™‚
To make the change effective there are two solutions; first patch the binary, which would require an update to codesign, second create a small loader to patch the strings in memory, leaving the original binary intact. Second one is more fun, so here it is, a small loader for iTunes 10.4.1 that will remove this feature. For now it’s 32 bitsΒ  only, which is the version that runs on Snow Leopard. I will test later with Lion.

To use this loader, execute the following commands in (after downloading and unpacking the loader.gz):

$ sudo cp /Applications/ /Applications/
$ sudo cp loader /Applications/
$ sudo chgrp procmod /Applications/
$ sudo chmod g+s /Applications/

And that’s it, you can click the usual iTunes icon. The program will start and no more m3u processing! If you check Activity Monitor, you will have two iTunes processes, one with a very small memory footprint (the loader), and the real iTunes. When you exit iTunes the loader will also exit, so everything is nice & clean.

I might improve this loader to be smart and support any new iTunes updates, and maybe create a Cocoa application to launch iTunes with this m3u enabled or disabled. I need a small excuse to start coding Cocoa apps πŸ˜‰

Have fun,

SHA256(loader)= 4cff14a3e2e5a58d4de22c74a064ab3448bdb63210440c232bedcd410acefdbf


Here it is a version that should work with all future iTunes updates and also for Lion with ASLR support (ASLR isn’t disabled by the loader!). Install as in the previous version.

SHA256(loaderv2_snowleopard)= 35453a6622699cc60fa4edb5def8b0d597c56e2850c3d165b1d080fe31c97cfe

SHA256(loaderv2_lion)= 7d0bd9934042141061710abea349284c553afdaee90342d4034bd9a916e6d099

12 thoughts on “Removing iTunes 10.4 m3u processing feature with a small loader

  1. Very interesting. a third option would be to make a visualizer plugin β€” a while ago I used that method to alter itunes’s music sharing functionality to allow third party clients to connect.

    the loader technique β€” can that change itunes’s executable memory, too? or just the read-only memory?

    1. Hummm a plugin might work and it’s a nice idea πŸ™‚ Have to check some sample code to see how plugins are done.
      The loader can do anything to iTunes, it’s basically a very light debugger.

    1. You can always reverse it, it has useful debug messages all over πŸ™‚

      I am thinking about a little hardening into the new version that supports Lion and 64 bits! Much more fun!

    1. You can do a dirty hack and search for the strings m3u and m3u8 in a hex editor and change to m5u or something πŸ™‚
      That should do the job hehehe

      1. I’m not that techno-savvy…would you be able to tell me exactly which file(s) need to be edited and how it’s done? I’m pretty clueless, but I just downloaded iTunes 10.4 and I’m having this issue with hundreds of albums spawning playlists that take forever to delete…

  2. i didnt realize this would kill all my folder actions for itunes. i had it set up so that when i add a song to a folder, it automatically opens it in itunes. ever since i installed the loader, it no longer does that. how do i uninstall?

  3. This doesn’t appear to work anymore w/ Mountain Lion! This is what I get in my System.log:

    Sep 5 20:35:43 MBP kernel[0]: macx_swapoff SUCCESS
    Sep 5 20:35:47 MBP.local taskgated[37356]: failed to get signing info for pid=37760 (cannot make code: invalid signature (code or signature have been modified))
    Sep 5 20:35:47 MBP[149] ([0x0-0x88f88f][37759]): Exited with code: 1

Leave a Reply

Your email address will not be published. Required fields are marked *