<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-29715439</id><updated>2011-12-02T09:57:54.359+01:00</updated><category term='Tech'/><category term='Software'/><category term='Cocoa'/><category term='Mobile'/><category term='iPhone'/><category term='Fun'/><category term='Hack'/><category term='Xcode'/><category term='F-Script'/><title type='text'>0xced</title><subtitle type='html'>[Cocoa hack];</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>39</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-29715439.post-7764865727855702002</id><published>2011-05-26T00:40:00.001+02:00</published><updated>2011-05-26T00:40:56.917+02:00</updated><title type='text'>How to restore Apple Front Row Trailers</title><content type='html'>&lt;p&gt;&lt;a href="#english"&gt;English version below&lt;/a&gt;&lt;/p&gt;&lt;p&gt;Comme vous avez pu le constater, &lt;strong&gt;Front Row Trailers&lt;/strong&gt; ne fonctionne plus. Étant donné que &lt;a href="http://www.9to5mac.com/53989/front-row-is-missing-from-10-7-lion/"&gt;Front Row est absent de Lion&lt;/a&gt;, je ne mettrai plus à jour Front Row Trailers.&lt;/p&gt;&lt;p&gt;Voici donc la méthode pour remettre les bandes-annonces originales d'Apple:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Téléchargez et décompressez &lt;a href="http://pitaya.ch/trailers/Restore-Apple-Trailers.zip"&gt;Restore Apple Trailers&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Double-cliquez sur le fichier &lt;em&gt;Restore Apple Trailers.command&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Entrez votre mot de passe&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;a name="english"&gt;&lt;/a&gt;&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;As you probably have noticed, &lt;strong&gt;Front Row Trailers&lt;/strong&gt; is not working anymore. Since &lt;a href="http://www.9to5mac.com/53989/front-row-is-missing-from-10-7-lion/"&gt;Front Row is missing in Lion&lt;/a&gt;, I have no plan to update Front Row Trailers.&lt;/p&gt;&lt;p&gt;So here is how to restore factory Apple trailers:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Download and decompress &lt;a href="http://pitaya.ch/trailers/Restore-Apple-Trailers.zip"&gt;Restore Apple Trailers&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Double-click on &lt;em&gt;Restore Apple Trailers.command&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Enter your password&lt;/li&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-7764865727855702002?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/7764865727855702002/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=7764865727855702002' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7764865727855702002'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7764865727855702002'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2011/05/how-to-restore-apple-front-row-trailers.html' title='How to restore Apple Front Row Trailers'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-2894886482655274012</id><published>2011-02-14T10:24:00.001+01:00</published><updated>2011-02-14T10:24:15.830+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Xcode'/><title type='text'>Using Ingredients as Xcode documentation browser</title><content type='html'>&lt;p&gt;Xcode 3.2.3 documentation browser was quite broken: ⌘ + ⌥ + double click on a method or function would open the documentation browser but would not scroll to the method you just asked documentation for. So I started to write an Xcode plugin to open &lt;a href="http://fileability.net/ingredients/"&gt;Ingredients&lt;/a&gt; instead. Then Xcode 3.2.5 was released (I skipped version 3.2.4) and this annoying bug was fixed, so I did not bother to publish my plugin. But recently, I &lt;a href="http://twitter.com/Jamie314/statuses/35780483673489408"&gt;read&lt;/a&gt; &lt;a href="http://twitter.com/chockenberry/status/36254840791240704"&gt;on&lt;/a&gt; &lt;a href="http://twitter.com/sbrocket/statuses/36345906722775040"&gt;twitter&lt;/a&gt; &lt;a href="http://twitter.com/pilky/status/36464940403392512"&gt;that&lt;/a&gt; [RED4CTED] documentation browser was even more broken, so I decided it was time to release my &lt;a href="https://github.com/0xced/Ingredients"&gt;Xcode-Ingredients&lt;/a&gt; plugin.&lt;br /&gt;&lt;br /&gt;Note that the plugin is written for Xcode 3, so things have probably changed in [RED4CTED] (which I have not yet tried). &lt;a href="http://twitter.com/Nyx0uf/status/35359283524796416"&gt;If&lt;/a&gt; &lt;a href="http://twitter.com/Pwc/statuses/34328778305970177"&gt;you&lt;/a&gt; &lt;a href="http://twitter.com/rentzsch/status/34807806024491008"&gt;are&lt;/a&gt; &lt;a href="http://twitter.com/command_tab/status/34822017022824448"&gt;brave&lt;/a&gt; &lt;a href="http://twitter.com/tonyarnold/status/34846220744663040"&gt;enough&lt;/a&gt; &lt;a href="http://twitter.com/bwebster/status/35125366972481536"&gt;to&lt;/a&gt; &lt;a href="http://twitter.com/dannygreg/status/35310086041763840"&gt;use&lt;/a&gt; [RED4CTED], that you know a bit about Xcode plugins (&lt;a href="twitter:@kodz"&gt;@kodz&lt;/a&gt;, &lt;a href="twitter:@rentzsch"&gt;@rentzsch&lt;/a&gt;, &lt;a href="twitter:@tjw"&gt;@tjw&lt;/a&gt;?) and that you would like to use Ingredients for reading the documentation, please have a look and adapt the plugin for [RED4CTED]. In order to discover the &lt;strong&gt;searchForAPIString:&lt;/strong&gt; method, I just set a breakpoint on &lt;strong&gt;makeKeyAndOrderFront:&lt;/strong&gt; and looked at the backtrace, but I'm not sure if this technique is still applicable.&lt;/p&gt;&lt;p&gt;I will update this blog post as soon as someone can get the plugin to work with [RED4CTED].&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-2894886482655274012?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/2894886482655274012/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=2894886482655274012' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2894886482655274012'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2894886482655274012'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2011/02/using-ingredients-as-xcode.html' title='Using Ingredients as Xcode documentation browser'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-752943970842085475</id><published>2010-09-11T13:46:00.001+02:00</published><updated>2010-09-11T13:46:58.742+02:00</updated><title type='text'>CLLocation getDistanceFrom: vs distanceFromLocation:</title><content type='html'>In &lt;a href="http://www.drobnik.com/touch/2010/09/backwards-compatibility-if-apple-starts-polishing/"&gt;Backwards Compatibility if Apple Starts Polishing&lt;/a&gt;, Oliver Drobnik explains how he solved the &lt;tt&gt;&lt;a href="http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocation_Class/DeprecationAppendix/AppendixADeprecatedAPI.html%23//apple_ref/occ/instm/CLLocation/getDistanceFrom:"&gt;getDistanceFrom:&lt;/a&gt;&lt;/tt&gt; vs &lt;tt&gt;&lt;a href="http://developer.apple.com/library/ios/#documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html%23//apple_ref/doc/uid/TP40007126-CH3-SW18"&gt;distanceFromLocation:&lt;/a&gt;&lt;/tt&gt; problem. His solution involves a new method (&lt;tt&gt;distanceBetweenLocation:andLocation:&lt;/tt&gt;) and eight lines of code for calling &lt;tt&gt;getDistanceFrom:&lt;/tt&gt; through a NSInvocation.&lt;br /&gt;&lt;br /&gt;Wouldn't it be nice if instead you could use &lt;tt&gt;[aLocation distanceFromLocation:anotherLocation]&lt;/tt&gt; everywhere in your code, while still retaining backward compatibility? Enter the Objective-C runtime! In your &lt;tt&gt;main.m&lt;/tt&gt; file, first &lt;tt&gt;#import &amp;lt;objc/runtime.h&amp;gt;&lt;/tt&gt; and at the very beginning of your &lt;tt&gt;main&lt;/tt&gt; function, add this:&lt;br /&gt;&lt;br /&gt;&lt;pre class="brush: objc"&gt;&lt;br /&gt;Method getDistanceFrom = class_getInstanceMethod([CLLocation class], @selector(getDistanceFrom:));&lt;br /&gt;class_addMethod([CLLocation class], @selector(distanceFromLocation:), method_getImplementation(getDistanceFrom), method_getTypeEncoding(getDistanceFrom));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Here you go, &lt;tt&gt;-[CLLocation distanceFromLocation:]&lt;/tt&gt; available at runtime in any iOS version with only two lines of code. Note that on iOS 3, &lt;tt&gt;class_addMethod&lt;/tt&gt; will add the &lt;tt&gt;distanceFromLocation:&lt;/tt&gt; method to the &lt;tt&gt;CLLocation&lt;/tt&gt; class using &lt;tt&gt; getDistanceFrom:&lt;/tt&gt; implementation. On iOS 4, &lt;tt&gt;class_addMethod&lt;/tt&gt; will do nothing as the method already exists.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-752943970842085475?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/752943970842085475/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=752943970842085475' title='12 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/752943970842085475'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/752943970842085475'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2010/09/cllocation-getdistancefrom-vs.html' title='CLLocation getDistanceFrom: vs distanceFromLocation:'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-3753411580181520451</id><published>2010-07-02T18:38:00.011+02:00</published><updated>2010-09-13T21:13:05.746+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='Xcode'/><title type='text'>Using SDK 3.1.3 with iPhone SDK 4</title><content type='html'>&lt;p&gt;In iPhone SDK 4 Apple has removed all 3.x SDKs. I think that was &lt;a href="http://twitter.com/0xced/status/17401527949"&gt;not a very good idea&lt;/a&gt; to say the least. I can understand Apple wants developers to adopt the new features of iOS 4, but breaking zillions of Xcode projects is probably not a good way to win the hearts of those developers. Well, this is probably not Apple's goal anyway.&lt;/p&gt;&lt;p&gt;Sure there is a way to get your projects working again with the iPhone SDK 4, just set the Base SDK of your project to iOS 4:&lt;/p&gt;&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto; border:none;" title="BaseSDK4.png" src="http://pitaya.ch/blog/BaseSDK4.png" border="0" alt="Base SDK 4" width="556" height="673" /&gt;&lt;/p&gt;&lt;p&gt;and set the Deployment Target to iOS 3:&lt;/p&gt;&lt;p&gt;&lt;img style="display: block; margin-left: auto; margin-right: auto; border:none;" title="DeploymentTarget3.png" src="http://pitaya.ch/blog/DeploymentTarget3.png" border="0" alt="Deployment Target 3" width="553" height="740" /&gt;&lt;/p&gt;&lt;p&gt;This will get your projects compile and run again on both iOS 3 and 4. That's fine. Well, except when you want to make sure your project do not use any new iOS 4 only API.&lt;/p&gt;&lt;p&gt;The problem is, code like this will now compile without any warning or error:&lt;/p&gt;&lt;p style="margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px ProFontX;"&gt;&lt;span style="font-family: Monaco;"&gt;[[&lt;span style="color: #7e11ad;"&gt;NSUserDefaults&lt;/span&gt; &lt;span style="color: #480085;"&gt;standardUserDefaults&lt;/span&gt;] setURL:defaultURL forKey:&lt;span style="color: #e90000;"&gt;@"DefaultURL"&lt;/span&gt;];﻿&lt;/span&gt;&lt;/p&gt;&lt;p&gt;It's easier than you think to use a shiny new API without even noticing you are using something not available on iOS 3.﻿ This setURL:forKey: method is new in iOS 4 so this code will fail with an unrecognized selector exception when run on iOS 3﻿. Unfortunately, the only way to catch this kind of oversight﻿ is to run it on an iOS 3 device. Or you can read the documentation of every single method and function you are calling to make sure it was not introduced in iOS 4. But this does not seem very reasonable, does it? The tools should help us detecting these problems at &lt;strong&gt;compile time&lt;/strong&gt;, not runtime!&lt;/p&gt;&lt;p&gt;Here is how to get Xcode 3.2.3 and iPhone SDK 4﻿ working with SDK 3.1.3.&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Log in to the &lt;a href="http://developer.apple.com/devcenter/ios/"&gt;iOS Dev Center&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Download the &lt;a href="http://developer.apple.com/ios/download.action?path=/iphone/iphone_sdk_3.1.3__final/iphone_sdk_3.1.3_with_xcode_3.2.1__snow_leopard__10m2003a.dmg"&gt;iPhone SDK 3.1.3&lt;/a&gt; into &lt;tt&gt;~/Downloads&lt;/tt&gt;&lt;/li&gt;&lt;li&gt;Run the &lt;a href="http://gist.github.com/577788"&gt;install-iphone-sdk-3.1.3.sh&lt;/a&gt; script&lt;/li&gt;&lt;li&gt;Quit and relaunch Xcode&lt;/li&gt;&lt;li&gt;Duplicate your &lt;em&gt;Debug&lt;/em&gt; configuration and rename it to &lt;em&gt;SDK 3.1.3 Check﻿&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Set the Base SDK of this new configuration to &lt;em&gt;iPhone Simulator 3.1.3&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Add a User-Defined Setting &lt;tt&gt;&lt;strong&gt;GCC_OBJC_ABI_VERSION&lt;/strong&gt;﻿&lt;/tt&gt; and set its value to &lt;tt&gt;&lt;strong&gt;1&lt;/strong&gt;&lt;/tt&gt; (one)&lt;/li&gt;&lt;li&gt;Select &lt;tt&gt;GCC_OBJC_ABI_VERSION&lt;/tt&gt; and choose &lt;i&gt;Add Build Setting Condition&lt;/i&gt; from the gear pop-up button at the lower left of the window.&lt;/li&gt;&lt;li&gt;Select &lt;i&gt;Any iPhone Simulator&lt;/i&gt; and &lt;i&gt;Any Architecture&lt;/i&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;There you go! By selecting the &lt;em&gt;SDK 3.1.3 Check&lt;/em&gt; configuration, you get compile time check for misusing iOS 4 only APIs when targeting iOS 3.&lt;/p&gt;&lt;p&gt;Note that compiling with the iPhone Simulator 3.1.3 SDK ﻿and running in Xcode 3.2.3 simulator is not supported. What you get with this hack is just a compile time check of the APIs you are using. So do not expect to run your app on a 3.1.3 simulator.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-3753411580181520451?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/3753411580181520451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=3753411580181520451' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/3753411580181520451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/3753411580181520451'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2010/07/using-sdk-313-with-iphone-sdk-4.html' title='Using SDK 3.1.3 with iPhone SDK 4'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-6531191684581182173</id><published>2010-06-02T08:51:00.017+02:00</published><updated>2010-06-04T11:16:39.073+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hack'/><category scheme='http://www.blogger.com/atom/ns#' term='Cocoa'/><title type='text'>Fixing -[NSMutableURLRequest setValue:forHTTPHeaderField:]</title><content type='html'>&lt;br&gt;&lt;h4&gt;The problem&lt;/h4&gt;From NSMutableURLRequest &lt;a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSMutableURLRequest_Class/Reference/Reference.html#//apple_ref/occ/instm/NSMutableURLRequest/setValue:forHTTPHeaderField:"&gt;setValue:forHTTPHeaderField:&lt;/a&gt; documentation:&lt;br /&gt;&lt;blockquote&gt;In keeping with the HTTP RFC, HTTP header field names are case-insensitive.&lt;/blockquote&gt;&lt;br /&gt;I see three problems with this.&lt;ol&gt;&lt;li&gt;Assuming all HTTP implementations are RFC compliant is foolish to say the least.&lt;/li&gt;&lt;li&gt;Enforcing case-insensitivity is nonsense.&lt;/li&gt;&lt;li&gt;This bit of documentation is accurate, the case of header fields is actually changed.&lt;/li&gt;&lt;/ol&gt;Trying this&lt;br /&gt;&lt;pre class="brush: objc"&gt;    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://www.example.com"]];&lt;br /&gt;    [request setValue:@"MyValue" forHTTPHeaderField:@"MyField"];&lt;br /&gt;    NSLog(@"result: %@", [request allHTTPHeaderFields]);&lt;/pre&gt;outputs&lt;br /&gt;&lt;pre&gt;    result: {&lt;br /&gt;        Myfield = MyValue;&lt;br /&gt;    }&lt;/pre&gt;Notice how the &lt;tt&gt;'F'&lt;/tt&gt; of &lt;tt&gt;MyField&lt;/tt&gt; was lowercased, that sucks! If the HTTP server you are trying to communicate with is case-sensitive, you are screwed. I filed &lt;a href="http://www.openradar.me/8029516"&gt;radar #8029516&lt;/a&gt;, which is a duplicate of radar #3131623, which means there is almost no chance to have this fixed anytime soon.&lt;br /&gt;&lt;br /&gt;When this happens, you should contact the server administrator asking for a case-insensitive implementation. But in the meantime, if you badly need to preserve the case of your headers, read on.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The investigation&lt;/h4&gt;First, let's fire &lt;a href="http://otx.osxninja.com"&gt;otx&lt;/a&gt; to disassemble the Foundation framework in order to have a look at &lt;tt&gt;setValue:forHTTPHeaderField:&lt;/tt&gt; implementation. I strongly suggest you to use otx version from subversion &lt;a href="http://otx.osxninja.com/builds/trunk"&gt;trunk&lt;/a&gt;, as it is better at resolving symbols in tail call optimizations (fixed in r553).&lt;br /&gt;&lt;br /&gt;Excerpt from otx 0.16b:&lt;br /&gt;&lt;pre&gt;   +18  [...]  movl     %eax,0x08(%ebp)&lt;br /&gt;   +21  [...]  leave&lt;br /&gt;   +22  [...]  jmpl     0x002c52bb&lt;/pre&gt;&lt;br /&gt;Excerpt from otx trunk:&lt;br /&gt;&lt;pre&gt;   +18  [...]  movl     %eax,0x08(%ebp)&lt;br /&gt;   +21  [...]  leave&lt;br /&gt;   +22  [...]  jmpl     0x002c52bb       _CFURLRequestSetHTTPHeaderFieldValue&lt;/pre&gt;&lt;br /&gt;Much better, isn't it?&lt;br /&gt;&lt;br /&gt;So let's go through the function calls of &lt;tt&gt;setValue:forHTTPHeaderField:&lt;/tt&gt;. With a basic static analysis of the Foundation and CFNetwork disassemblies, we can draw the following call path:&lt;br /&gt;&lt;pre&gt;-[NSMutableURLRequest(NSMutableHTTPURLRequest) setValue:forHTTPHeaderField:]&lt;br /&gt;    CFURLRequestSetHTTPHeaderFieldValue()&lt;br /&gt;        URLRequest::setHTTPHeaderFieldValue()&lt;br /&gt;            HTTPRequest::setHeaderFieldValue()&lt;br /&gt;                CFHTTPMessageSetHeaderFieldValue()&lt;br /&gt;                    HTTPMessage::setHeaderFieldValue()&lt;br /&gt;                        _CFCapitalizeHeader()&lt;/pre&gt;&lt;br /&gt;&lt;tt&gt;&lt;strong&gt;_CFCapitalizeHeader&lt;/strong&gt;&lt;/tt&gt; looks like a very good candidate for being the bastard changing the case of our headers. A quick search reveals the &lt;a href="http://opensource.apple.com/source/CFNetwork/CFNetwork-129.20/HTTP/CFHTTPMessage.c"&gt;source code&lt;/a&gt; of CFNetwork that was open source long time ago. Although the open source implementation does not exactly match what we see in the disassembly (it is now using &lt;tt&gt;toupper&lt;/tt&gt; instead of &lt;tt&gt;ch + 'A' - 'a'&lt;/tt&gt; for example), we are now absolutely sure that &lt;tt&gt;_CFCapitalizeHeader&lt;/tt&gt; is the function responsible for messing with our headers.&lt;br /&gt;&lt;br /&gt;Now, let's check is if there is a path that will not call &lt;tt&gt;_CFCapitalizeHeader&lt;/tt&gt; and if we can somehow influence the condition that would avoid the call to &lt;tt&gt;_CFCapitalizeHeader&lt;/tt&gt;. This is quickly checked, especially if you enabled the &lt;em&gt;Separate logical blocks&lt;/em&gt; option of otx (-b option for cli).&lt;br /&gt;&lt;pre&gt;HTTPMessage::setHeaderFieldValue(__CFString const*, __CFString const*)&lt;br /&gt;    +0  000515a4  55                      pushl       %ebp&lt;br /&gt;    +1  000515a5  89e5                    movl        %esp,%ebp&lt;br /&gt;    +3  000515a7  83ec28                  subl        $0x28,%esp&lt;br /&gt;    +6  000515aa  8b4508                  movl        0x08(%ebp),%eax&lt;br /&gt;    +9  000515ad  8975f8                  movl        %esi,0xf8(%ebp)&lt;br /&gt;   +12  000515b0  8b7510                  movl        0x10(%ebp),%esi&lt;br /&gt;   +15  000515b3  897dfc                  movl        %edi,0xfc(%ebp)&lt;br /&gt;   +18  000515b6  8945f4                  movl        %eax,0xf4(%ebp)&lt;br /&gt;   +21  000515b9  8b450c                  movl        0x0c(%ebp),%eax&lt;br /&gt;   +24  000515bc  890424                  movl        %eax,(%esp)&lt;br /&gt;   +27  000515bf  e88a26fbff              calll       __CFCapitalizeHeader&lt;br /&gt;   +32  000515c4  c744240cffffffff        movl        $0xffffffff,0x0c(%esp)&lt;br /&gt;   +40  000515cc  89742408                movl        %esi,0x08(%esp)&lt;br /&gt;   +44  000515d0  89c7                    movl        %eax,%edi&lt;/pre&gt;&lt;br /&gt;We see that there is no path that avoid the call to &lt;tt&gt;_CFCapitalizeHeader&lt;/tt&gt;. So we are left with the last resort solution: patching &lt;tt&gt;_CFCapitalizeHeader&lt;/tt&gt;. With &lt;a href="http://www.unsanity.com/haxies/apesdk/"&gt;APE Lite&lt;/a&gt;, function patching is very easy. You first use &lt;tt&gt;APEFindSymbol()&lt;/tt&gt; to find the address of a non-exported symbol (i.e. &lt;tt&gt;__CFCapitalizeHeader&lt;/tt&gt;), then &lt;tt&gt;APEPatchCreate()&lt;/tt&gt; to replace a function implementation with your own, while still keeping a reference to the original implementation. On iPhone OS, you can use &lt;a href="http://github.com/0xced/APELite-arm"&gt;APE Lite+arm&lt;/a&gt; (my implementation of the APE Lite API using MobileSubstrate).&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;The solution&lt;/h4&gt;&lt;a href="http://gist.github.com/414439"&gt;NSMutableURLRequest+CaseSensitive&lt;/a&gt; is a category on NSMutableURLRequest that adds these three methods:&lt;br /&gt;&lt;pre class="brush: objc"&gt;   - (void) setAllHTTPHeaderFields:(NSDictionary *)headerFields caseSensitive:(BOOL)caseSensitive;&lt;br /&gt;   - (void) setValue:(NSString *)value forHTTPHeaderField:(NSString *)field caseSensitive:(BOOL)caseSensitive;&lt;br /&gt;   - (void) addValue:(NSString *)value forHTTPHeaderField:(NSString *)field caseSensitive:(BOOL)caseSensitive;&lt;/pre&gt;&lt;br /&gt;Just pass &lt;tt&gt;caseSensitive:YES&lt;/tt&gt; for preserving the case of your header fields.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Warning&lt;/em&gt;&lt;/strong&gt;: you SHOULD NOT use this in production code. But hey, HTTP implementations SHOULD be case-insensitive ;-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-6531191684581182173?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/6531191684581182173/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=6531191684581182173' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6531191684581182173'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6531191684581182173'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2010/06/fixing-nsmutableurlrequest.html' title='Fixing -[NSMutableURLRequest setValue:forHTTPHeaderField:]'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-4473640104986368032</id><published>2010-04-08T10:27:00.005+02:00</published><updated>2011-04-18T09:41:39.296+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hack'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>ABGetMe with the iPhone SDK</title><content type='html'>Unlike the Mac Address Book API, the iPhone Address Book API does not come with the &lt;tt&gt;&lt;a href="http://developer.apple.com/library/mac/documentation/userexperience/Reference/AddressBook/C/ABAddressBookRef/Reference/reference.html#//apple_ref/c/func/ABGetMe"&gt;ABGetMe&lt;/a&gt;&lt;/tt&gt; function. That's a pity, but we can do something about it.&lt;br /&gt;&lt;br /&gt;Recently, I used &lt;tt&gt;MFMailComposeViewController&lt;/tt&gt; for the first time and I realized that it was displaying my e-mail address. Nicolas Seriot already demonstrated how to retrieve all your e-mail account information in &lt;a href="http://github.com/nst/SpyPhone/blob/master/Classes/SPSourceEmailTVC.m"&gt;SpyPhone&lt;/a&gt;, but I felt there was a more lightweight method for retrieving the e-mail addresses by taking advantage of the MessageUI framework. A class-dump and five minutes later, here is my solution:&lt;br /&gt;&lt;script src="http://gist.github.com/356975.js?file=emailAddresses.m"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-4473640104986368032?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/4473640104986368032/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=4473640104986368032' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4473640104986368032'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4473640104986368032'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2010/04/abgetme-with-iphone-sdk.html' title='ABGetMe with the iPhone SDK'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-8567861207619636037</id><published>2010-01-03T11:22:00.011+01:00</published><updated>2011-06-03T09:24:08.748+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><title type='text'>Jasscore pour iPhone</title><content type='html'>Ma première application iPhone, &lt;a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=333215756&amp;mt=8"&gt;Jasscore&lt;/a&gt; (lien iTunes) est enfin disponible sur l'AppStore au prix de 1.10 CHF. C'est une ardoise virtuelle qui vous permet de compter vos points et ceux de votre adversaire au jass (chibre, mise, etc.)&lt;br /&gt;&lt;h4&gt;Les features&lt;/h4&gt;&lt;ul&gt;&lt;li&gt;En français et en allemand&lt;/li&gt;&lt;li&gt;Editez le nom des équipes et les scores à atteindre&lt;/li&gt;&lt;li&gt;Notez les scores et les annonces&lt;/li&gt;&lt;li&gt;Multiplication des scores de 1x à 7x&lt;/li&gt;&lt;li&gt;Grand affichage afin que tous les joueurs puissent suivre les scores&lt;/li&gt;&lt;/ul&gt;&lt;h4&gt;Les captures d'écran&lt;/h4&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center; width: 320px; height: 460px; border:none;" src="http://pitaya.ch/jasscore/_Media/capture1-2.png" alt="Score" /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center; width: 320px; height: 460px; border:none;" src="http://pitaya.ch/jasscore/_Media/capture2-2.png" alt="Réglage" /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center; width: 320px; height: 460px; border:none;" src="http://pitaya.ch/jasscore/_Media/capture3-2.png" alt="Grand Affichage" /&gt;&lt;br /&gt;&lt;br /&gt;Je suis ouvert à vos suggestions, alors n'hésitez pas à laisser un commentaire ou à m'envoyer un e-mail.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-8567861207619636037?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/8567861207619636037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=8567861207619636037' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/8567861207619636037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/8567861207619636037'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2010/01/jasscore-pour-iphone.html' title='Jasscore pour iPhone'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-1102771285944099785</id><published>2009-11-07T17:30:00.002+01:00</published><updated>2009-11-07T17:32:49.361+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cocoa'/><title type='text'>CLAlert: NSAlert done right</title><content type='html'>From NSAlert documentation:&lt;br /&gt;&lt;blockquote&gt; Currently, there is no visual difference between informational and warning alerts.&lt;/blockquote&gt;&lt;br /&gt;This was written at the time of Panther and this is still true in Snow Leopard. So why the hell is the &lt;tt&gt; setAlertStyle:&lt;/tt&gt; method provided?&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;i&gt;NSCriticalAlertStyle&lt;/i&gt;&lt;/pre&gt; This style causes the icon to be badged with a caution icon.&lt;/blockquote&gt;&lt;br /&gt;A caution icon, for a critical alert? That does not make sense!&lt;br /&gt;&lt;br /&gt;Here are screenshots of the default behaviours with the three different alert styles:&lt;br /&gt;&lt;br /&gt;&lt;img src="http://s3.amazonaws.com/ember/E4sAwxdoThOmW8T7g8P9jhfuzW3EqWwr_o.png"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://s3.amazonaws.com/ember/uCiR6p6OYppncj2LrWuJFw02O0pKyz6O_o.png"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://s3.amazonaws.com/ember/uTbANc0CnNZrYhsanbIoeKqQ2LRMRkUu_o.png"&gt;&lt;br /&gt;&lt;br /&gt;The documentation is unfortunately right: there is no difference between the informational and the warning style. The critical style is indeed badged with a caution icon.&lt;br /&gt;&lt;br /&gt;As you probably have guessed from the title of this post, I am not happy with this behavior, so I have written a class, &lt;a href="http://gist.github.com/228140"&gt;CLAlert&lt;/a&gt; (MIT License) that displays alerts the way I think it should be done. I.e. a note icon for an informational alert, a caution icon for a warning alert and a stop icon for a critical alert as you can see on these screenshots.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://s3.amazonaws.com/ember/pjP1TKlpfxu3WQs2zongWqpxc6qw3jsU_o.png"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://s3.amazonaws.com/ember/bN3wTfemTYXRppGWAdQHmpv4R3VwD9EG_o.png"&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://s3.amazonaws.com/ember/g7Cl6JjugWuaUThao03DTv2FC8eZD5ZC_o.png"&gt;&lt;br /&gt;&lt;br /&gt;CLAlert is a drop-in replacement for NSAlert. It requires at lest Mac OS X 10.5.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-1102771285944099785?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/1102771285944099785/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=1102771285944099785' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/1102771285944099785'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/1102771285944099785'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2009/11/clalert-nsalert-done-right.html' title='CLAlert: NSAlert done right'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-4627925346540824835</id><published>2009-11-05T21:49:00.007+01:00</published><updated>2009-11-05T22:03:20.481+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='F-Script'/><category scheme='http://www.blogger.com/atom/ns#' term='Cocoa'/><title type='text'>Watch a large number of icons with Preview.app</title><content type='html'>Browsing .icns files in Preview.app can be painful. If you try to open all the icons of the CoreTypes bundle for example with the following command &lt;br /&gt;&lt;pre&gt;open /System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/*icns&lt;/pre&gt;&lt;br /&gt;you will get this view:&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 627px; height: 669px;" src="http://s3.amazonaws.com/ember/pQrNHc5zIGpjGUybRG4sZdwflBIccZo3_o.png"&gt;&lt;br /&gt;&lt;br /&gt;All the different sizes of the .icns are displayed, which makes it quite unpleasant to browse.&lt;br /&gt;&lt;br /&gt;F-Script Anywhere to the rescue!&lt;br /&gt;&lt;br /&gt;Install F-Script Anywhere into Preview, then do&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;FSA → New F-Script Workspace&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click the &lt;i&gt;Browser For Target…&lt;/i&gt; button&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click on one of the icons&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Choose the PVIKImageBrowserView object&lt;/li&gt;&lt;br /&gt;&lt;li&gt;In the F-Script Object Browser, name the PVIKImageBrowserView &lt;b&gt;browserView&lt;/b&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;Finally, in the F-Script interpreter, paste the following code:&lt;br /&gt;&lt;pre&gt;groups := browserView layoutManager groups.&lt;br /&gt;count := groups count.&lt;br /&gt;0 to:count-1 do: [:i | browserView collapseGroup:(groups objectAtIndex:i)]&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Tada, a nice browsable view of your icons!&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 627px; height: 669px;" src="http://s3.amazonaws.com/ember/Geyx4AcgixPnWWZt9xPJ1oAIBO0ZQrd5_o.png"&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-4627925346540824835?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/4627925346540824835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=4627925346540824835' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4627925346540824835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4627925346540824835'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2009/11/watch-large-number-of-icons-with.html' title='Watch a large number of icons with Preview.app'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-1481069247278772420</id><published>2009-08-19T17:41:00.003+02:00</published><updated>2009-08-19T22:30:02.759+02:00</updated><title type='text'>Booting from a dmg</title><content type='html'>I was &lt;a href="http://twitter.com/jfroy/status/3334034920"&gt;pointed by&lt;/a&gt; Jean-Francois Roy that it is possible to boot off a dmg.&lt;br /&gt;&lt;br /&gt;It's a simple two steps process using &lt;a href="http://www.devklog.net/software/bootfolder.tar.bz2"&gt;bootfolder&lt;/a&gt;:&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;./makebootfolder /Path/to/OperatingSystem.dmg&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;sudo ./blessbootfolder /Path/to/OperatingSystem.bootfolder&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;But beware: &lt;b&gt;you better not have a space in the path to the dmg or in the dmg itself&lt;/b&gt;. If you happen to try this trick with a space in the path to the boot folder, then your Mac will brick. In verbose startup, you will get&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Error loading kernel 'mach_kernel' (0x9)&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;If you can't boot anymore, download &lt;a href="http://downloads.sourceforge.net/refit/rEFIt-0.13.cdr.gz"&gt;rEFIt&lt;/a&gt; and burn it onto a CD. Then boot on the CD by pressing the &lt;i&gt;C&lt;/i&gt; key. You should see something looking like this (maybe without the linux and windows partitions):&lt;br /&gt;&lt;br /&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 512px; height: 384px;" src="http://refit.sourceforge.net/img/screen2.png" border="0" alt="" /&gt;&lt;br /&gt;&lt;br /&gt;Just press enter and you should be able to boot your Mac.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-1481069247278772420?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/1481069247278772420/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=1481069247278772420' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/1481069247278772420'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/1481069247278772420'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2009/08/booting-from-dmg.html' title='Booting from a dmg'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-4976547787677607011</id><published>2009-04-08T22:39:00.008+02:00</published><updated>2010-05-03T16:25:26.439+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hack'/><category scheme='http://www.blogger.com/atom/ns#' term='iPhone'/><title type='text'>Extract UIKit artwork</title><content type='html'>While writing an iPhone application (more about it on this blog soon), I wanted to tint my UIAlertView with the same color I tinted my other controls. Maybe this is not a good idea, but I wanted to try anyway. Unfortunately, only UISearchBar, UISegmentedControl, UINavigationBar and UIToolbar have the tintColor property. So I started digging into UIKit. The first place to look was obviously the &lt;tt&gt;-(void)[UIAlertView(Private) drawRect:]&lt;/tt&gt; method. To draw its background, a UIAlertView calls &lt;tt&gt;_popupAlertBackground&lt;/tt&gt; which in turn call &lt;tt&gt;_UIImageWithName(@"UIPopupAlertSheetBackground.png")&lt;/tt&gt;. This file probably lies inside the UIKit.framework would think a Mac developer. In fact it is not there. Only two pngs are there: DefaultWallpaper-iPhone.png and DefaultWallpaper-iPod.png. So, where is it?&lt;br /&gt;&lt;br /&gt;It is in fact somehow embedded in the &lt;i&gt;Other.artwork&lt;/i&gt; file which contains UIKit artwork. This file is memory mapped at application startup, probably for performance reasons and the content is easily accessed with the private &lt;tt&gt;_UIImageWithName()&lt;/tt&gt; function. &lt;tt&gt;_UIImageWithName&lt;/tt&gt; looks up in a dictionary that associates a file name to some memory location that contains the actual image data.&lt;br /&gt;&lt;br /&gt;Now, it would be cool to extract all this content to see what artwork UIKit contains. It turns out to be quite easy. The only trick is to find a reference to the dictionary containing all the file names. Check my &lt;a href="http://github.com/0xced/UIKit-Artwork-Extractor"&gt;UIKit Artwork Extractor&lt;/a&gt; project on github to see how it works.&lt;br /&gt;&lt;br /&gt;In an attempt to encourage comments, I'm offering a beer at NSConference to the first person who will clearly explain how to find the magic address of the images dictionary (except for Nicolas who knows the answer already) and I'm offering two beers to the one who provides a &lt;i&gt;cleaner&lt;/i&gt; way to obtain a reference to the dictionary that is not UIKit version specific ;-)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Edit&lt;/b&gt;: I have updated the code so that it is not UIKit version specific, so I won the beers myself that I'm going to drink right away.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-4976547787677607011?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/4976547787677607011/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=4976547787677607011' title='16 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4976547787677607011'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4976547787677607011'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2009/04/extract-uikit-artwork.html' title='Extract UIKit artwork'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>16</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-2290870920811004360</id><published>2009-03-23T09:34:00.016+01:00</published><updated>2009-03-23T10:36:00.241+01:00</updated><title type='text'>chmod, ACL and symbolic links</title><content type='html'>&lt;p&gt;Let's say you want to set an ACL on a symbolic link. So you try the &lt;tt&gt;-h&lt;/tt&gt; option of &lt;tt&gt;chmod&lt;/tt&gt; that is documented to &lt;em&gt;change the mode of the link itself rather than the file that the link points to.&lt;/em&gt;&lt;/p&gt;&lt;pre style="background: #e0e0e0; overflow: auto;"&gt;  $ ln -s aFileThatDoesNotExist myLink&lt;br /&gt;  $ /bin/chmod -h +a "everyone allow delete" myLink&lt;br /&gt;  &lt;b&gt;&lt;i&gt;chmod: Failed to set ACL on file 'myLink': No such file or directory&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;So, it seems &lt;tt&gt;myLink&lt;/tt&gt; was followed even though we passed the &lt;tt&gt;-h&lt;/tt&gt; option. Let's try with a link that points to an existing file:&lt;/p&gt;&lt;pre style="background: #e0e0e0; overflow: auto;"&gt;  $ touch aFileThatExist&lt;br /&gt;  $ ln -fs aFileThatExist myLink&lt;br /&gt;  $ /bin/chmod -h +a "everyone allow delete" myLink&lt;br /&gt;  $ ls -le myLink aFileThatExist&lt;br /&gt;  &lt;b&gt;&lt;i&gt;-rw-r--r--+ 1 cluthi  staff   0  5 mar 18:11 aFileThatExist&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;  &lt;b&gt;&lt;i&gt;0: group:everyone allow delete&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;  &lt;b&gt;&lt;i&gt;lrwxr-xr-x  1 cluthi  staff  14  5 mar 18:12 myLink -&gt; aFileThatExist&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Our hypothesis is confirmed, the link was followed. Let's investigate and have a look at chmod source code (file_cmds-188 on darwinsource).&lt;/p&gt;&lt;p&gt;&lt;tt&gt;chmod.c:125&lt;/tt&gt; variable &lt;tt&gt;hflag&lt;/tt&gt; is set to &lt;em&gt;true&lt;/em&gt; if the -h argument is passed&lt;br /&gt;&lt;tt&gt;chmod.c:388&lt;/tt&gt; function &lt;tt&gt;modify_file_acl()&lt;/tt&gt; is called, the &lt;tt&gt;hflag&lt;/tt&gt; is not passed to this function&lt;/p&gt;&lt;p&gt;Doh, lazy boys! Let's patch it and add a &lt;tt&gt;follow&lt;/tt&gt; argument to the &lt;tt&gt;modify_file_acl()&lt;/tt&gt; function:&lt;br /&gt;&lt;strong&gt;int modify_file_acl(unsigned int optflags, const char *path, acl_t modifier, int position, int inheritance_level, int follow);&lt;/strong&gt;&lt;br /&gt;and call it with &lt;tt&gt;modify_file_acl(..., !hflag)&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;From acl_set(3) man: &lt;em&gt;The acl_set_link_np() function acts on a symlink rather than its target, if the target of the path is a symlink.&lt;/em&gt; Perfect, that's what we need: we must call &lt;tt&gt;acl_set_link_np&lt;/tt&gt; instead of &lt;tt&gt;acl_set_file&lt;/tt&gt; in order not to follow the link. &lt;br&gt;&lt;br /&gt;&lt;tt&gt;chmod_acl.c:807&lt;/tt&gt; acl_set_file is called: &lt;tt&gt;(0 != acl_set_file(path, ACL_TYPE_EXTENDED, oacl))&lt;/tt&gt;&lt;br /&gt;Replace with &lt;tt&gt;(0 != (follow ? acl_set_file(path, ACL_TYPE_EXTENDED, oacl) : acl_set_link_np(path, ACL_TYPE_EXTENDED, oacl)))&lt;/tt&gt;&lt;/p&gt;&lt;p&gt;With this small modifications, the &lt;tt&gt;-h&lt;/tt&gt; option should be respected. Rebuild chmod and try again:&lt;/p&gt;&lt;pre style="background: #e0e0e0; overflow: auto;"&gt;  $ ./chmod -h +a "everyone allow delete" myLink&lt;br /&gt;  &lt;b&gt;&lt;i&gt;chmod: Failed to set ACL on file 'myLink': Operation not supported&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;  $ ln -fs aFileThatDoesNotExist myLink&lt;br /&gt;  $ ./chmod -h +a "everyone allow delete" myLink&lt;br /&gt;  &lt;b&gt;&lt;i&gt;chmod: Failed to set ACL on file 'myLink': Operation not supported&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;Now, whether the link points to an existing file or not, we get the &lt;em&gt;Operation not supported&lt;/em&gt; error. That's better diagnostic, but not exactly what we expected :-( So, why is it not supported? Let's dig a bit more. &lt;tt&gt;acl_set_link_np&lt;/tt&gt; implementation is found at &lt;tt&gt;Libc-498.1.5/posix1e/acl_file.c:175&lt;/tt&gt; and is:&lt;/p&gt;&lt;pre style="background: #e0e0e0; overflow: auto;"&gt;  return(acl_set_file1(path, acl_type, acl, 0));&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The last argument (&lt;em&gt;follow&lt;/em&gt;) passed to &lt;tt&gt;acl_set_file1&lt;/tt&gt; is 0 and the first lines of &lt;tt&gt;acl_set_file1&lt;/tt&gt; implementation reads:  &lt;/p&gt;&lt;pre style="background: #e0e0e0; overflow: auto;"&gt;  if (follow == 0) {&lt;br /&gt;    &lt;b&gt;&lt;i&gt;/* XXX this requires some thought - can links have ACLs? */&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;    errno = ENOTSUP;&lt;br /&gt;    return(-1);&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;We have the explanation of the &lt;em&gt;Operation not supported&lt;/em&gt; error we got earlier. Note that the comment is not mine, it is actually in the libc source code!&lt;/p&gt;&lt;p&gt;Does it mean it is impossible to set an ACL on a symlink? Does it mean our only option is to file a bug asking some Apple engineer to think harder if links can have ACLs? Fortunately no. There is a third function in the acl_set(3) API: &lt;tt&gt;acl_set_fd&lt;/tt&gt;, which acts on a file descriptor. Hopefully, getting the file descriptor of a symlink is as simple as &lt;tt&gt;open(path, O_SYMLINK)&lt;/tt&gt;.&lt;/p&gt;&lt;p&gt;That's it. With this &lt;a href="http://pitaya.ch/radar/6264303/chmod.patch"&gt;patch&lt;/a&gt;, you'll be able to run &lt;tt&gt;./chmod -h +a "everyone allow delete" myLink&lt;/tt&gt; and have the ACL to be set on the symlink!&lt;/p&gt;&lt;p&gt;If you need to set ACLs on symlinks on a daily basis, I suggest you do not overwrite &lt;tt&gt;/bin/chmod&lt;/tt&gt; but install the patched version of chmod in &lt;tt&gt;/usr/local/bin&lt;/tt&gt;. Well, if you read that post till there, you probably know that already.&lt;/p&gt;&lt;p&gt;This bug has been reported to Apple and is known as &lt;a href="rdar://problem/6264303"&gt;radar #6264303&lt;/a&gt; which is a duplicate of &lt;a href="rdar://problem/5684438"&gt;radar #5684438&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-2290870920811004360?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/2290870920811004360/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=2290870920811004360' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2290870920811004360'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2290870920811004360'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2009/03/chmod-acl-and-symbolic-links_23.html' title='chmod, ACL and symbolic links'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-5461382697052022330</id><published>2009-01-04T22:38:00.008+01:00</published><updated>2010-03-11T22:32:29.346+01:00</updated><title type='text'>Using your own address book in the iPhone Simulator</title><content type='html'>&lt;b&gt;Jailbroken iPhone with openssh:&lt;/b&gt;&lt;br /&gt;&lt;pre&gt;scp mobile@iPhone:~/Library/AddressBook/* ~/Library/Application\ Support/iPhone\ Simulator/User/Library/AddressBook&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Non-jailbroken iPhone:&lt;/b&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/329671.js?file=absim.sh"&gt;&lt;/script&gt;&lt;br /&gt;Say bye bye to John Appleseed &amp; Co.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-5461382697052022330?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/5461382697052022330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=5461382697052022330' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/5461382697052022330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/5461382697052022330'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2009/01/using-your-own-address-book-in-iphone.html' title='Using your own address book in the iPhone Simulator'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-6610265709371733339</id><published>2008-10-15T21:06:00.005+02:00</published><updated>2008-10-15T21:17:07.065+02:00</updated><title type='text'>Kagi Registration Module (lack of) security</title><content type='html'>I'm in the process of choosing an eCommerce partner for selling my future shareware. I have narrowed down to &lt;a href="http://www.esellerate.net"&gt;eSellerate&lt;/a&gt; and &lt;a href="http://www.kagi.com"&gt;Kagi&lt;/a&gt; as they are widely adopted by Mac shareware developers. After reading their respecting obfuscated pricing policies, I decided to have a look at what they offer for integrating the purchasing process into the application.&lt;br /&gt;&lt;br /&gt;Kagi offers the &lt;a href="http://kagi.com/kagisolutions/software.php?page=krm"&gt;Kagi Registration Module&lt;/a&gt; (KRM) which is basically a library that provides an in-application one click purchase experience. Sounds pretty good. I start reading the KRM developer documentation and stumble on the &lt;i&gt;Security&lt;/i&gt; section:&lt;br /&gt;&lt;blockquote&gt;The ZonicKRM submits orders through an SSL connection for security, however pricing information is currently passed from the application to the ZonicKRM as an XML string.&lt;br /&gt;&lt;br /&gt;If this data is not checksummed, or otherwise protected, a malicious user may be able to edit the XML string within an application's executable and submit an order with an invalid price.&lt;br /&gt;&lt;br /&gt;In the long term, this attack will be denied by moving the responsibility for pricing information from the KRM library to the KRM server. When this process is complete, vendors will be able to override the pricing information in shipping copies of an application using their Kagi database entry.&lt;/blockquote &gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;WHAT THE FUCK&lt;/b&gt; ? The user is able to choose the price he wants to pay ? Can't be true, this part of the documentation must be outdated. Guess what... it's not, long term is long term!&lt;br /&gt;&lt;br /&gt;Note that &lt;i&gt;checksumming&lt;/i&gt; or &lt;i&gt;protecting&lt;/i&gt; is pure bullshit as long as the price comes from the application and not Kagi's server.&lt;br /&gt;&lt;br /&gt;I searched for the first shareware using KRM I found, opened it with an hex editor, did search and replace of the string &lt;b&gt;30.00&lt;/b&gt; to &lt;b&gt;01.00&lt;/b&gt; and I indeed successfully ordered the shareware for $1.&lt;br /&gt;&lt;br /&gt;This is totally irresponsible from Kagi. I don't know how this registration scheme could have been designed this way in the first place. No sensible person can design an ordering system where the price is set by the client.&lt;br /&gt;&lt;br /&gt;Please don't flame me, I'm a good guy. I contacted the $30 shareware author and offered to pay the remaining $29 I owe him. I should have searched a bit longer for a cheaper shareware. $1 + $29 is a bit expensive to demonstrate that KRM sucks ;-)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;The Bottom Line&lt;/b&gt;&lt;br /&gt;Don't use KRM as long as you can't set the price of your shareware on Kagi's server.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-6610265709371733339?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/6610265709371733339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=6610265709371733339' title='18 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6610265709371733339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6610265709371733339'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/10/kagi-registration-module-lack-of.html' title='Kagi Registration Module (lack of) security'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-7851399198527374690</id><published>2008-09-03T09:32:00.013+02:00</published><updated>2009-05-15T21:39:20.717+02:00</updated><title type='text'>QuietXcode</title><content type='html'>Have you ever noticed the &lt;b&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x319a380, has non-zero refcount = 1&lt;/b&gt; messages in the console ? Chris Espinosa &lt;a href="http://www.cocoabuilder.com/archive/message/xcode/2007/11/7/16932"&gt;replied about these warnings&lt;/a&gt; to Matt Neuburg:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;The second one is an error deep in some system framework when running under Garbage Collection that we have not been able to track down yet. It simply means that somebody has neglected to do a final release on a memory block that nobody has kept a pointer to (making the final release technically impossible).  The Garbage Collector knows the block is inaccessible and is freeing it, but is warning us that somebody forgot to formally release it before the pointer to it went out of scope. Bad form, but no actual harm.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;I think it actually harms. These messages are filling the console so much it becomes unusable. I'm a big fan of &lt;a href="http://projects.tynsoe.org/en/geektool/"&gt;GeekTool&lt;/a&gt; and I always have the tail of the console on the desktop. Now, it looks always the same and interesting messages from various applications are lost in the mass of &lt;b&gt;free_garbage&lt;/b&gt; messages:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x319a380, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x31bf6e0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x3263da0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x3274eb0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x319a380, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x31bf6e0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x3263da0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x3274eb0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x201c8b0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x3256110, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x201c8b0, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x3256110, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x2045540, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x208ca10, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x2045540, has non-zero refcount = 1&lt;br /&gt;Xcode(19838,0xb0103000) malloc: free_garbage: garbage ptr = 0x208ca10, has non-zero refcount = 1&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;So I decided to tackle the problem and here is my Solution: &lt;a href="http://github.com/0xced/quietxcode/zipball/1.1.4"&gt;QuietXcode 1.1.4&lt;/a&gt; (5 KB). This is an Xcode plugin that patches the culpable call to &lt;tt&gt;malloc_printf("free_garbage: garbage ptr = %p, has non-zero refcount = %d", ...)&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;You can build the plugin either by typing &lt;tt&gt;xcodebuild&lt;/tt&gt; in a terminal or by building it (⌘ + B) in Xcode. Building the plugin will also automatically install it into your &lt;b&gt;~/Library/Application Support/Developer/Shared/Xcode/Plug-ins&lt;/b&gt; folder.&lt;br /&gt;&lt;br /&gt;Once it's installed, you have to relaunch Xcode. You should see the message &lt;b&gt;&amp;lt;QuietXcode&amp;gt; loaded successfully&lt;/b&gt; in the console and no more &lt;b&gt;free_garbage&lt;/b&gt; messages.&lt;br /&gt;&lt;br /&gt;The plugin performs a &lt;i&gt;safe&lt;/i&gt; patch, that is, if it does not find the expected call to &lt;tt&gt;malloc_printf&lt;/tt&gt; and the expected Xcode version (greater than or equal to 3.1/1099), it logs a more or less comprehensive error to the console. Have fun browsing the source code, it demonstrates how to use the dyld and mach-o apis to locate non exported symbols and the mach api to dynamically patch code.&lt;br /&gt;&lt;br /&gt;Note that the plugin is for i386 only, porting it to ppc and/or 64 bits is left as an exercise to the reader.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-7851399198527374690?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/7851399198527374690/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=7851399198527374690' title='17 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7851399198527374690'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7851399198527374690'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/09/quietxcode.html' title='QuietXcode'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>17</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-5116372135914225767</id><published>2008-08-22T20:34:00.006+02:00</published><updated>2010-03-11T08:28:29.413+01:00</updated><title type='text'>Exploring iPhone OS 2 files</title><content type='html'>&lt;b&gt;Update:&lt;/b&gt; This technique also works with iPhone OS 3.x. You will find the VFDecrypt keys on &lt;a href="http://www.theiphonewiki.com/wiki/index.php?title=Firmware"&gt;The iPhone Wiki Firmware&lt;/a&gt; page. Just select the appropriate iPhone model and Version/Build of your firmware.&lt;br /&gt;&lt;br /&gt;It turns out to be pretty simple:&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download iPhone OS 2.0.2 (5C1)&lt;br /&gt;&lt;tt&gt;curl -O http://appldnld.apple.com.edgesuite.net/content.info.apple.com/iPhone/061-5241.20080818.t5Fv3/iPhone1,2_2.0.2_5C1_Restore.ipsw&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Unzip the ipsw which is actually a zip file&lt;br /&gt;&lt;tt&gt;unzip iPhone1,2_2.0.2_5C1_Restore.ipsw&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Download vfdecrypt&lt;br /&gt;&lt;tt&gt;svn co http://iphone-elite.googlecode.com/svn/trunk iphone-elite&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Compile vfdecrypt&lt;br /&gt;&lt;tt&gt;make -C iphone-elite/vfdecrypt_win32&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Decrypt the dmg (key from &lt;a href="http://www.theiphonewiki.com/wiki/index.php?title=VFDecrypt_Keys"&gt;The iPhone Wiki&lt;/a&gt;)&lt;br /&gt;&lt;tt&gt;./iphone-elite/vfdecrypt_win32/vfdecrypt -i 018-3978-1.dmg -k 31e3ff09ff046d5237187346ee893015354d2135e3f0f39480be63dd2a18444961c2da5d -o iPhoneOS-2.0.2.dmg&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Mount iPhone OS dmg and start exploring&lt;br /&gt;&lt;tt&gt;open iPhoneOS-2.0.2.dmg&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-5116372135914225767?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/5116372135914225767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=5116372135914225767' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/5116372135914225767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/5116372135914225767'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/08/exploring-iphone-os-2-files.html' title='Exploring iPhone OS 2 files'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-2564314077326393060</id><published>2008-08-22T20:05:00.009+02:00</published><updated>2008-08-24T19:01:30.053+02:00</updated><title type='text'>Do not buy iQuarantine X</title><content type='html'>From iQuarantine X website:&lt;br /&gt;&lt;blockquote&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;iQuarantine X is not a background script or a script that gets attached to files or folders.&lt;/li&gt;&lt;li&gt;iQuarantine X is the first application to make the LEOPARD FILE QUARANTINE ALERTS go away.&lt;/li&gt;&lt;li&gt;iQuarantine X is the easiest way to rid LEOPARD of all FILE QUARANTINE ALERTS.&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/blockquote &gt;So, if it's not a script, what is it (beside a scam) ?&lt;br /&gt;It's a hack that binary patches a system framework (&lt;tt&gt;/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore&lt;/tt&gt;) by short-circuiting the private function &lt;tt&gt;_FSAllocateQuarantineData&lt;/tt&gt;.&lt;br /&gt;&lt;br /&gt;So we have four good reasons not to buy it:&lt;br /&gt;&lt;ol&gt;&lt;li&gt;It has an unacceptable upgrade policy.&lt;/li&gt;&lt;li&gt;It binary patches a system framework.&lt;/li&gt;&lt;li&gt;Developer does not reply to e-mails.&lt;/li&gt;&lt;li&gt;You can &lt;a href="http://pseudogreen.org/blog/yes_leopard_i_want_to_open_it_already.html"&gt;disable the Leopard quarantine&lt;/a&gt; for free with an official technique.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-2564314077326393060?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/2564314077326393060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=2564314077326393060' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2564314077326393060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2564314077326393060'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/08/do-not-buy-iquarantine-x.html' title='Do not buy iQuarantine X'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-2506075485630184185</id><published>2008-07-10T08:09:00.006+02:00</published><updated>2008-07-10T08:22:53.693+02:00</updated><title type='text'>The missing NSLocale documentation</title><content type='html'>&lt;tt&gt;+ (NSArray *)preferredLanguages&lt;/tt&gt;&lt;br /&gt;&lt;b&gt;Return Value&lt;/b&gt;&lt;br /&gt;The user's language preference order as an array of NSString objects, each of which is a canonicalized IETF BCP 47 language identifier. &lt;b&gt;&lt;i&gt;This is defined by the user in System Preferences → International → Language.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_xtArlbzhSHA/SHWnw3bPA9I/AAAAAAAAABM/2jYR9zHlP0s/s1600-h/preferredLanguages.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_xtArlbzhSHA/SHWnw3bPA9I/AAAAAAAAABM/2jYR9zHlP0s/s400/preferredLanguages.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5221263800959697874" /&gt;&lt;/a&gt;&lt;br /&gt;For your information: this is stored in the gloal domain in the &lt;tt&gt;AppleLanguages&lt;/tt&gt; key.&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;+ (id)currentLocale&lt;/tt&gt;&lt;br /&gt;&lt;b&gt;Return Value&lt;/b&gt;&lt;br /&gt;The logical locale for the current user. The locale is formed from the settings for the current user’s chosen system locale overlaid with any custom settings the user has specified in System Preferences &lt;b&gt;&lt;i&gt;→ International → Formats&lt;/i&gt;&lt;/b&gt;.&lt;br /&gt;This method may return a retained cached object.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_xtArlbzhSHA/SHWoJTI7ENI/AAAAAAAAABU/rA_mKsQ52xE/s1600-h/currentLocale.png"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xtArlbzhSHA/SHWoJTI7ENI/AAAAAAAAABU/rA_mKsQ52xE/s400/currentLocale.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5221264220715946194" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;tt&gt;+ (id)autoupdatingCurrentLocale&lt;/tt&gt;&lt;br /&gt;This one I have not understood how it is supposed to be used. If someone knows, please let us know in the comments.&lt;br /&gt;&lt;br /&gt;Now, if what you want is the &lt;i&gt;current&lt;/i&gt; language, you should not use either of these methods. Instead you should use something like &lt;tt&gt;NSLocalizedString(@"ISOLanguageCode", @"iso language code")&lt;/tt&gt;. Then you have to define &lt;tt&gt;"ISOLanguageCode" = "en";&lt;/tt&gt; etc. in all your Localizable.strings files.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-2506075485630184185?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/2506075485630184185/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=2506075485630184185' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2506075485630184185'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2506075485630184185'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/07/missing-nslocale-documentation.html' title='The missing NSLocale documentation'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_xtArlbzhSHA/SHWnw3bPA9I/AAAAAAAAABM/2jYR9zHlP0s/s72-c/preferredLanguages.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-1157418668345885392</id><published>2008-06-10T21:13:00.003+02:00</published><updated>2008-06-10T21:22:08.595+02:00</updated><title type='text'>Mac OS X bug on non english systems</title><content type='html'>&lt;a href="http://support.apple.com/kb/TS1642"&gt;Mac OS X 10.5 (Japanese): Disk Utility "internal error" alert with 7-pass erase or 35-pass erase&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;Symptoms&lt;/b&gt;&lt;br /&gt;In the Japanese language version of Mac OS X 10.5, when performing a Secure Erase (7-pass or 35-pass erase) in Disk Utility, this alert may appear: "Disk Utility internal error. Disk Utility has lost its connection with Disk Management Tool."&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Resolution&lt;/b&gt;&lt;br /&gt;Change the Mac OS X language version to English before performing the secure erase.&lt;/blockquote&gt;&lt;br /&gt;I thought this kind of problem was Mac OS 9/Classic history.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-1157418668345885392?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/1157418668345885392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=1157418668345885392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/1157418668345885392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/1157418668345885392'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/06/mac-os-x-bug-on-non-english-systems.html' title='Mac OS X bug on non english systems'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-2168448673345712574</id><published>2008-02-14T10:42:00.002+01:00</published><updated>2008-02-14T11:04:28.565+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cocoa'/><title type='text'>Upgrading a System Preference pane</title><content type='html'>The System Preferences application provides a convenient way to install a preference pane. Double-clicking the preference pane will prompt the user if he wants to install it for the current user only or for all users of the computer. Then System Preferences will copy the preference pane to ~/Library/PreferencePanes or /Library/PreferencePanes according to what was chosen asking for administrator password if necessary. Finally the preference pane will be loaded and presented to the user.&lt;br /&gt;&lt;br /&gt;Now, let's see what happens when a preference pane is upgraded. Again, System Preferences is smart: it is able to detect if an older version of the same preference pane is installed and proposes to replace it &lt;a href="#note1" name="backlink1"&gt;[1]&lt;/a&gt;. Everything seems alright, but it is actually not! Things are more complicated if the preference pane to upgrade has already been loaded. That is, if the user already clicked the preference pane.&lt;br /&gt;&lt;br /&gt;Indeed, preference panes are just a special kind of &lt;a href="http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/index.html"&gt;bundle&lt;/a&gt; which is loaded into System Preferences with the &lt;tt&gt;-(BOOL)[NSBundle load]&lt;/tt&gt; method (cf. -(BOOL)[NSPrefPaneBundle instantiatePrefPaneObject] method of the PreferencePanes framework). The problem is that on Tiger, &lt;b&gt;a NSBundle can not be unloaded&lt;/b&gt;. So when upgrading an opened preference pane, the old code is not unloaded and as a consequence the new code is &lt;b&gt;not&lt;/b&gt; loaded. This is because System Preferences calls the &lt;tt&gt;-(BOOL)[NSBundle load]&lt;/tt&gt; method which returns YES, meaning that the bundle was successfully loaded &lt;b&gt;or that the code has already been loaded&lt;/b&gt;. In the case of an already opened preference pane, that's how the result of the &lt;tt&gt;load&lt;/tt&gt; method should have been interpreted. Unfortunately, it is interpreted as if the bundle was successfully loaded and System Preferences thinks it has loaded the new bundle, but it has not.&lt;br /&gt;&lt;br /&gt;This is very problematic because at this point, the resources (nib files, pictures etc.) of the new bundle have already been copied. So we have the old code which is accessing the new resources. I let you imagine the numerous problems this situation can cause. At best, exceptions will raise and your preference pane will be half working. At worst, your preference pane will simply crash.&lt;br /&gt;&lt;br /&gt;So, how do we fix this problem?&lt;br /&gt;&lt;br /&gt;First, the preference pane must detect itself when it's upgrading over an older already loaded version as System Preferences does not detect it &lt;a href="#note2" name="backlink2"&gt;[2]&lt;/a&gt;. This must be done as early as possible, i.e. at the very beginning of the &lt;tt&gt;- (id)initWithBundle:(NSBundle *) bundle&lt;/tt&gt; method. It is possible to detect this situation with the help of the &lt;a href="http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSObject_Class/Reference/Reference.html#//apple_ref/occ/clm/NSObject/version"&gt;version&lt;/a&gt; of your NSPreferencePane subclass. See my &lt;a href="http://snipplr.com/view/4054/detect-already-loaded-older-version-of-a-preference-pane/"&gt;detection snippet&lt;/a&gt; to understand how detection works.&lt;br /&gt;Once this is detected, we must properly reload the new preference pane. This must be achieved by quitting System Preferences and relaunching System Preferences. This is the not that elegant solution to unload the old preference pane. The elegant solution would be to unload the bundle. This is left as an exercise to the Apple engineers for a future version of System Preferences.&lt;br /&gt;&lt;br /&gt;Relaunching System Preferences and selecting the preference pane is quite tricky. A second executable must be responsible for relaunching the System Preferences application. Also, it is nicer for the user if the preference pane he just upgraded is automatically selected. Automatic selection of the pref pane is achieved through Apple Script. Please refer to my &lt;a href="http://snipplr.com/view/3924/reload-a-preference-pane/"&gt;reload snippet&lt;/a&gt; for implementation details. Note that once you have compiled the &lt;tt&gt;reload&lt;/tt&gt; executable, you have to place it inside the resources directory of your preference pane. Do not place it inside the executable directory (&lt;tt&gt;Contents/MacOS&lt;/tt&gt;) if you do not want to see the reload application popping up in the Dock.&lt;br /&gt;&lt;br /&gt;With this reload code in place, if the user ever happens to upgrade a preference pane while the older one was loaded, he will experience a &lt;i&gt;System Preferences flicker&lt;/i&gt; as it will quit and reopen right away. While this might be surprising to him, this is still better than a half working preference pane or a crash.&lt;br /&gt;&lt;br /&gt;If anything is unclear, just say it so in the comments and I will try to elaborate. If everything is clear, just pick up my code snippets and implement them in your preference pane as soon as possible ;-)&lt;br /&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;1. &lt;a name="note1"&gt;&lt;/a&gt;System Preferences uses the &lt;a href="http://developer.apple.com/documentation/CoreFoundation/Reference/CFBundleRef/Reference/reference.html#//apple_ref/doc/uid/20001191-CH201-F14157"&gt;&lt;tt&gt;CFBundleGetVersionNumber&lt;/tt&gt;&lt;/a&gt; function to retrieve the version numbers of the new and old bundles as an UInt32 in order to compare them. The documentation says &lt;i&gt;If the bundle’s version number is a number, it is interpreted as the unsigned long integer format defined by the vers resource on Mac OS 9.&lt;/i&gt; What every developer understands is that if your Info.plist &lt;tt&gt;CFBundleVersion&lt;/tt&gt; key represents a number (e.g. "519"), the value returned by CFBundleGetVersionNumber will be 519. This is not what actually happens. If you want CFBundleGetVersionNumber to return 519, you have to add an undocumented key in your Info.plist file: &lt;tt&gt;CFBundleNumericVersion&lt;/tt&gt;. Make sure you define it as &lt;tt&gt;&amp;lt;integer&amp;gt;519&amp;lt;/integer&amp;gt;&lt;/tt&gt; and not &lt;tt&gt;&amp;lt;string&amp;gt;519&amp;lt;/string&amp;gt;&lt;/tt&gt;.&lt;a href="#backlink1"&gt;↩&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. &lt;a name="note2"&gt;&lt;/a&gt;Note that on Leopard, this situation is actually detected and a dialog is presented to the user telling he must &lt;i&gt;quit System Preferences and then open it again&lt;/i&gt;. Unfortunately, no automatic action is taken to circumvent this annoying behavior. System Preferences could restart itself or unload the bundle (this is possible since Leopard) but as of Mac OS X 10.5.2, none of this action is performed.&lt;a href="#backlink2"&gt;↩&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-2168448673345712574?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/2168448673345712574/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=2168448673345712574' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2168448673345712574'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2168448673345712574'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/02/upgrading-system-preference-pane.html' title='Upgrading a System Preference pane'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-4932864459606423121</id><published>2008-01-25T16:40:00.001+01:00</published><updated>2008-02-28T12:15:24.710+01:00</updated><title type='text'>QuickTime 7.4 and Perian subtitles fix</title><content type='html'>With QuickTime 7.4, subtitles automatically added by Perian have stopped working. In order to get them back, download and install &lt;a href="http://0xced.blogspot.com/2007/02/bandes-annonces-front-row.html"&gt;Front Row Trailers&lt;/a&gt;, go to the &lt;i&gt;QuickTime Components&lt;/i&gt; tab, and install Perian 1.0.0.2. If the proposed version is below 1.0.0.2, hold the alt (option) key while clicking the &lt;i&gt;Refresh&lt;/i&gt; button.&lt;br /&gt;&lt;br /&gt;For thoses wondering, this is an unofficial build of Perian 1.0 onto which &lt;a href="http://trac.perian.org/changeset/703"&gt;two&lt;/a&gt; &lt;a href="http://trac.perian.org/changeset/768"&gt;patches&lt;/a&gt; have been applied. Note that the future Perian 1.1 release will also be able to read subtitles.&lt;br /&gt;&lt;br /&gt;Enjoy, QuickTime 7.4 can read subtitles again, no need to downgrade to version 7.3.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;UPDATE:&lt;/b&gt; Perian 1.1 is now released and has addressed the problem. Note that subtitles still do not work in Front Row on Leopard.&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;keywords: QuickTime 7.4 Perian subtitles srt&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-4932864459606423121?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/4932864459606423121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=4932864459606423121' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4932864459606423121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4932864459606423121'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2008/01/quicktime-74-and-perian-subtitles-fix.html' title='QuickTime 7.4 and Perian subtitles fix'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-6511328567589424093</id><published>2007-11-29T07:28:00.000+01:00</published><updated>2007-11-29T08:09:56.813+01:00</updated><title type='text'>BetterAuthorizationSample</title><content type='html'>Finally, Apple posted &lt;a href="http://developer.apple.com/samplecode/BetterAuthorizationSample/index.html"&gt;BetterAuthorizationSample&lt;/a&gt;, a sample project that demonstrates how to securely use Mac OS X authorization API.&lt;br /&gt;&lt;blockquote&gt;Apple's older sample code (AuthSample and MoreAuthSample) used a setuid root privileged helper tool.  BAS uses launchd because it's more secure.  In the BAS design, an attacker can't directly control the environment which the helper tool inherits, and that prevents a variety of potential attacks.&lt;/blockquote&gt;&lt;br /&gt;This sample code supersedes the four years old Project Builder MoreIsBetter/MoreSecurity sample code that warned: &lt;i&gt;No matter what you do, the current AuthorizationExecuteWithPrivileges model allows for security violations [3093666].&lt;/i&gt; It comes as a Xcode project that compiles without tweaking and with three documentation files that look quite complete: Design and Implementation Rationale, Performing Privileged Operations With BetterAuthorizationSampleLib and Read Me About BetterAuthorizationSample.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-6511328567589424093?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/6511328567589424093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=6511328567589424093' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6511328567589424093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6511328567589424093'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2007/11/betterauthorizationsample.html' title='BetterAuthorizationSample'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-5580989499509522837</id><published>2007-11-19T10:55:00.001+01:00</published><updated>2008-12-03T11:55:14.385+01:00</updated><title type='text'>Front Row for Tiger</title><content type='html'>Leopard users have the Front Row application in their Applications folder. It may be useful if you want to automatically launch front Row when your computer starts up by adding a login item for example.&lt;br /&gt;&lt;br /&gt;Now, Tiger users can also use this convenient Front Row application. Leopard users who have accidentally deleted their Front Row application can also use it.&lt;br /&gt;&lt;br /&gt;&lt;img style="border: none; display:block; margin:0px auto 10px; text-align:center;" src="http://4.bp.blogspot.com/_xtArlbzhSHA/R0FgKy2VrxI/AAAAAAAAAA8/ifSJBrgJoSY/s200/FrontRow.png" border="0" alt="Front Row" /&gt;&lt;div align="center"&gt;&lt;a href="http://pitaya.ch/blog/FrontRow_Tiger-1.0.zip"&gt;Front Row 1.0&lt;/a&gt; (29 Ko)&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;I have not tested it on unsupported Macs, i.e. those without an Apple Remote. If you have such a Mac, please report in the comments if it works or if it still requires Front Row Enabler.&lt;br /&gt;&lt;br /&gt;This Front Row launcher has been written from scratch. Here is the source code:&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;int main(int argc, char *argv[])&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BSRemoteUIToggle();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;return 0;&lt;br /&gt;}&lt;br /&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-5580989499509522837?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/5580989499509522837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=5580989499509522837' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/5580989499509522837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/5580989499509522837'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2007/11/front-row-for-tiger.html' title='Front Row for Tiger'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xtArlbzhSHA/R0FgKy2VrxI/AAAAAAAAAA8/ifSJBrgJoSY/s72-c/FrontRow.png' height='72' width='72'/><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-4689429002983535378</id><published>2007-09-12T17:29:00.000+02:00</published><updated>2007-09-28T11:12:04.441+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><title type='text'>Region X Universal Binary</title><content type='html'>Thanks to ben11, a member of the rpc1 forums, new &lt;a href="http://forum.rpc1.org/viewtopic.php?t=43082"&gt;RPC-1 firmware updates&lt;/a&gt; are available for Matshita drives. This is great, but something was missing: an universal binary version of Region X. An intel only version is available, but it's english only and well, an universal binary version is just better. Unfortunately, xvi — the author of Region X — retired several years ago. Fortunately, he made Region X sources publicly available. So I recompiled it as an universal binary and I updated the version number to 1.1.3. Feedback is welcome.&lt;br /&gt;&lt;br /&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; border: none;" src="http://4.bp.blogspot.com/_xtArlbzhSHA/Ruf3aKQ6EsI/AAAAAAAAAA0/EAwwBkbwHdc/s400/RegionX.png" alt="Region X" id="BLOGGER_PHOTO_ID_5109324331079045826" border="0" /&gt;&lt;div style="text-align: center;"&gt;&lt;a href="http://www.energisol.ch/external/RegionX_1.1.3.zip"&gt;Region X 1.1.3&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;h4&gt;Version history &lt;span style="font-weight: normal;font-size:85%;" &gt;(version 1.0.0 to 1.1.2 are actually from xvi)&lt;/span&gt;&lt;/h4&gt;&lt;h5&gt;Version 1.1.3 (2007-09-12)&lt;/h5&gt;* Recompiled as universal binary&lt;br /&gt;&lt;h5&gt;Version 1.1.2 (2005-01-12)&lt;/h5&gt;* Corrected a case where settings were not properly stored&lt;br /&gt;&lt;h5&gt;Version 1.1.1 (2004-05-09)&lt;/h5&gt;* Added RPC-1 drive warning&lt;br /&gt;* &lt;span style="font-style:italic;"&gt;Region not set&lt;/span&gt; and &lt;span style="font-style:italic;"&gt;5 changes left&lt;/span&gt; logic tuned&lt;br /&gt;&lt;h5&gt;Version 1.1.0 (2004-04-25)&lt;/h5&gt;* Japanese localization added, by Satoshi Ash&lt;br /&gt;* Chinese localization added, by 季娇&lt;br /&gt;&lt;h5&gt;Version 1.0.9 (2004-03-21)&lt;/h5&gt;* Changes to the settings read/write system&lt;br /&gt;* New icon&lt;br /&gt;&lt;h5&gt;Version 1.0.8 (2004-02-07)&lt;/h5&gt;* Spanish localization added, by 宗次郎&lt;br /&gt;&lt;h5&gt;Version 1.0.7 (2004-01-25)&lt;/h5&gt;* Greek localization added, by Alexandros Tr&lt;br /&gt;* Drag and drop installation&lt;br /&gt;&lt;h5&gt;Version 1.0.6 (2003-12-29)&lt;/h5&gt;* Enhanced current settings reading, now compatible with OS X on UFS partition&lt;br /&gt;* Window position is now remembered across launches&lt;br /&gt;&lt;h5&gt;Version 1.0.5 (2002-10-16)&lt;/h5&gt;* Added &lt;span style="font-style:italic;"&gt;Region not set&lt;/span&gt; case handling&lt;br /&gt;&lt;h5&gt;Version 1.0.4 (2002-06-25)&lt;/h5&gt;* For Mac OS X 10.1.5&lt;br /&gt;&lt;h5&gt;Version 1.0.3 (2002-02-27)&lt;/h5&gt;* Added German localization (translation by Ralph and David)&lt;br /&gt;* Added safety check for privileged attribute&lt;br /&gt;&lt;h5&gt;Version 1.0.2 (2001-11-26)&lt;/h5&gt;* Changed handling of five changes left logic to be more user friendly&lt;br /&gt;* Added Dutch localization (translation by iRob)&lt;br /&gt;* Added Italian localization (translation by Michele)&lt;br /&gt;* For DVD Player 3.0.1&lt;br /&gt;&lt;h5&gt;Version 1.0.1 (2001-11-11)&lt;/h5&gt;* Improved region settings validity check&lt;br /&gt;* Enhanced documentation now in Help menu&lt;br /&gt;* Added my photo (that incredible feature was requested by my wife)&lt;br /&gt;* Multilingual version, english and french&lt;br /&gt;&lt;h5&gt;Version 1.0.0 (2001-10-18)&lt;/h5&gt;* First release for OS X, english only&lt;br /&gt;* Full native Cocoa application&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-4689429002983535378?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/4689429002983535378/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=4689429002983535378' title='30 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4689429002983535378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/4689429002983535378'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2007/09/region-x-universal-binary.html' title='Region X Universal Binary'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xtArlbzhSHA/Ruf3aKQ6EsI/AAAAAAAAAA0/EAwwBkbwHdc/s72-c/RegionX.png' height='72' width='72'/><thr:total>30</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-6986314545505155218</id><published>2007-05-23T18:11:00.000+02:00</published><updated>2007-05-23T18:30:30.663+02:00</updated><title type='text'>Looking for a german translator for Bandes-annonces Front Row</title><content type='html'>The upcoming version of &lt;a href="http://0xced.blogspot.com/2007/02/bandes-annonces-front-row.html"&gt;Bandes-annonces Front Row&lt;/a&gt; will be international. For those who don't know, &lt;i&gt;Bandes-annonces Front Row&lt;/i&gt; enables you to change the trailers you watch inside Front Row. In the previous version, trailers came from AlloCiné, a french cinema site. In the upcoming version, the user will have several choices. I'm looking for a german translator as one of the source provides german trailers.&lt;br /&gt;&lt;br /&gt;So if you are interested in watching german trailers inside Front Row and if you would like to spend a few minutes to translate &lt;i&gt;Bandes-annonces Front Row&lt;/i&gt;, please post a comment.&lt;br /&gt;&lt;br /&gt;Here are some screenshots so that you have an idea of what it looks like.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_xtArlbzhSHA/RlRrqCPCSiI/AAAAAAAAAAk/j83f8k3ycmU/s1600-h/BaFR-Configuration.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xtArlbzhSHA/RlRrqCPCSiI/AAAAAAAAAAk/j83f8k3ycmU/s400/BaFR-Configuration.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5067793850597263906" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_xtArlbzhSHA/RlRrqSPCSjI/AAAAAAAAAAs/fPp6Y6ppdkM/s1600-h/BaFR-QTComponents.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://2.bp.blogspot.com/_xtArlbzhSHA/RlRrqSPCSjI/AAAAAAAAAAs/fPp6Y6ppdkM/s400/BaFR-QTComponents.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5067793854892231218" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-6986314545505155218?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/6986314545505155218/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=6986314545505155218' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6986314545505155218'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6986314545505155218'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2007/05/looking-for-german-translator-for.html' title='Looking for a german translator for Bandes-annonces Front Row'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xtArlbzhSHA/RlRrqCPCSiI/AAAAAAAAAAk/j83f8k3ycmU/s72-c/BaFR-Configuration.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-7251874175751753291</id><published>2007-05-19T12:36:00.000+02:00</published><updated>2007-05-19T12:38:09.388+02:00</updated><title type='text'>L'effet MacBidouille</title><content type='html'>Le 7 mai, MacBidouille a parlé de Bandes-annonces Front Row dans ses news. Résultat: une augmentation de la fréquentation aussi spectaculaire que soudaine.&lt;br /&gt;&lt;a href="http://1.bp.blogspot.com/_xtArlbzhSHA/Rk7SIiPCShI/AAAAAAAAAAc/QPPiXXONObo/s1600-h/stats-mb.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://1.bp.blogspot.com/_xtArlbzhSHA/Rk7SIiPCShI/AAAAAAAAAAc/QPPiXXONObo/s400/stats-mb.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5066217674909043218" /&gt;&lt;/a&gt;Mon hébergeur n'a d'aillers pas tenu le coup et certains ont eu des soucis pour télécharger Bandes-annonces Front Row. Je trouverai mieux pour la prochaine version, même si la fréquentation ne sera certainement pas aussi grande.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-7251874175751753291?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/7251874175751753291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=7251874175751753291' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7251874175751753291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7251874175751753291'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2007/05/leffet-macbidouille_19.html' title='L&apos;effet MacBidouille'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_xtArlbzhSHA/Rk7SIiPCShI/AAAAAAAAAAc/QPPiXXONObo/s72-c/stats-mb.png' height='72' width='72'/><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-2714879349885782363</id><published>2007-02-19T14:05:00.004+01:00</published><updated>2011-05-26T00:54:02.594+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hack'/><category scheme='http://www.blogger.com/atom/ns#' term='Software'/><title type='text'>Front Row Trailers</title><content type='html'>&lt;a href="#english"&gt;English version below&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;Front Row Trailers&lt;/i&gt; est le nouveau nom de &lt;i&gt;Bandes-annonces Front Row&lt;/i&gt; depuis la version 2.1.&lt;br /&gt;&lt;br /&gt;Front Row Trailers n'est plus disponible. Veuillez vous référer aux &lt;a href="http://0xced.blogspot.com/2011/05/how-to-restore-apple-front-row-trailers.html"&gt;instructions pour restaurer&lt;/a&gt; les bandes-annonces originale d'Apple.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Foire Aux Questions&lt;/h4&gt;&lt;b&gt;Q&lt;/b&gt;: Comment faire pour désinstaller Front Row Trailers ?&lt;br /&gt;&lt;b&gt;R&lt;/b&gt;: Il n'y a pas besoin de désinstaller Front Row Trailers, il suffit de sélectionner la source &lt;i&gt;Apple (US)&lt;/i&gt; et les bandes-annonces d'origine seront de retour.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: Est-ce que Front Row Trailers est compatible avec Leopard (Mac OS X 10.5) ?&lt;br /&gt;&lt;b&gt;R&lt;/b&gt;: Oui&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: Sur Leopard, je dois entrer mon mot de passe à chaque fois que je change de source, que puis-je faire pour éviter cela ?&lt;br /&gt;&lt;b&gt;R&lt;/b&gt;: Il suffit de taper la commande suivante dans le Terminal (une fois la commande entrée, il faut taper son mon de passe):&lt;br /&gt;&lt;pre style="overflow: auto;"&gt;sudo chmod o+w /System/Library/PrivateFrameworks/BackRow.framework/Versions/A/Resources/Trailers.plist&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: Est-il possible de désactiver les bandes-annonces ?&lt;br /&gt;&lt;b&gt;R&lt;/b&gt;: Depuis la version 2.1.1, Front Row Trailers le permet en choisissant la source spéciale &lt;i&gt;Deny&lt;/i&gt;.&lt;br /&gt;Sur Leopard, il est aussi possible de désactiver les menus &lt;i&gt;iTunes Top Movies&lt;/i&gt;, &lt;i&gt;iTunes Top Songs&lt;/i&gt; et &lt;i&gt;iTunes Top Music Videos&lt;/i&gt; en entrant la commande suivante dans le Terminal:&lt;br /&gt;&lt;pre style="overflow: auto;"&gt;defaults write com.apple.frontrow EnableITMS -bool NO&lt;/pre&gt;&lt;b&gt;Attention&lt;/b&gt;: cette commande doit être entrée &lt;b&gt;avant&lt;/b&gt; de choisir la source Deny dans Front Row Trailers.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: Sur Leopard, certaines bandes-annonces ne se lisent pas aussi bien que sur Tiger ou ne fonctionnent même pas du tout. Prévoyez-vous de distribuer une mise à jour ?&lt;br /&gt;&lt;b&gt;R&lt;/b&gt;: Front Row pour Leopard utilise une architecture très différente de celle de Front Row pour Tiger. Tandis que Front Row pour Tiger utilise QuickTime pour lire les bandes-annonces, Front Row pour Leopard semble utiliser son propre méchanisme passant outre QuickTime. Alors que les bandes-annonces se lisent bien dans QuickTime player, celles-ci peuvent ne pas fonctionner dans Front Row. C'est notamment le cas avec les bandes-annonces allemandes utilisant le codec Sorenson 3. Malheureusement, il n'y a rien que je puisse faire. Néanmoins, une future mise à jour de Front Row ou de QuickTime pourrait résoudre ces problèmes.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Historique des versions&lt;/h4&gt;&lt;h5&gt;Version 2.1.2 (2008-01-24)&lt;/h5&gt;* Ajouté Ciné.ch (source suisse romande)&lt;br /&gt;* Détection correcte de la version de QuickTime&lt;br /&gt;&lt;h5&gt;Version 2.1.1 (2007-12-18)&lt;/h5&gt;* Ajouté Lycos (source espagnole)&lt;br /&gt;* Enlevé Cinefacts (l'accès à Front Row Trailers a été bloqué)&lt;br /&gt;* Possibilité d'interdire les bandes-annonces&lt;br /&gt;&lt;h5&gt;Version 2.1 (2007-10-15)&lt;/h5&gt;* Changement de nom&lt;br /&gt;* Bandes-annonces haute définition&lt;br /&gt;* 20 sources&lt;br /&gt;* Traduction italienne&lt;br /&gt;* Traduction danoise&lt;br /&gt;* Options de tri&lt;br /&gt;* Nouveau système de mise à jour&lt;br /&gt;&lt;h5&gt;Version 2.0.2 (2007-08-20)&lt;/h5&gt;* Corrige un bogue dans la détection de Perian&lt;br /&gt;&lt;h5&gt;Version 2.0.1 (2007-06-22)&lt;/h5&gt;* Corrige un bogue dans la détection des composants QuickTime&lt;br /&gt;&lt;h5&gt;Version 2.0 (2007-06-21)&lt;/h5&gt;* Nouvelle interface&lt;br /&gt;* 9 nouvelles sources de bandes-annonces à choix&lt;br /&gt;&lt;h5&gt;Version 1.1 (2007-05-03)&lt;/h5&gt;* Suppresion des saccades&lt;br /&gt;&lt;h5&gt;Version 1.0 (2007-02-19)&lt;/h5&gt;* Version initiale&lt;br /&gt;&lt;br /&gt;&lt;a name="english"&gt;&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;&lt;br /&gt;&lt;i&gt;Bandes-annonces Front Row&lt;/i&gt; is know as &lt;i&gt;Front Row Trailers&lt;/i&gt; since version 2.1.&lt;br /&gt;&lt;br /&gt;Front Row Trailers isn't available anymore. Please refer to &lt;a href="http://0xced.blogspot.com/2011/05/how-to-restore-apple-front-row-trailers.html#english"&gt;instructions to restore&lt;/a&gt; factory Apple trailers.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Frequently Asked Questions&lt;/h4&gt;&lt;b&gt;Q&lt;/b&gt;: How do I uninstall Front Row Trailers ?&lt;br /&gt;&lt;b&gt;A&lt;/b&gt;: There is no need to uninstall Front Row Trailers, just select the &lt;i&gt;Apple (US)&lt;/i&gt; source and you will get the original trailers from Apple.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: Is Front Row Trailers compatible with Leopard (Mac OS X 10.5) ?&lt;br /&gt;&lt;b&gt;A&lt;/b&gt;: Yes&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: In Leopard, I am prompted for my password every time I change the source, is there anything I can do about that ?&lt;br /&gt;&lt;b&gt;A&lt;/b&gt;: Just type the following command in the Terminal (you will have to type your password):&lt;br /&gt;&lt;pre style="overflow: auto;"&gt;sudo chmod o+w /System/Library/PrivateFrameworks/BackRow.framework/Versions/A/Resources/Trailers.plist&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: Is it possible to disable the theatrical trailers ?&lt;br /&gt;&lt;b&gt;A&lt;/b&gt;: Since version 2.1.1, Front Row Trailers is able to deny trailers access by choosing the special &lt;i&gt;Deny&lt;/i&gt; source.&lt;br /&gt;On Leopard, it is also possible to disable the &lt;i&gt;iTunes Top Movies&lt;/i&gt;, &lt;i&gt;iTunes Top Songs&lt;/i&gt; and &lt;i&gt;iTunes Top Music Videos&lt;/i&gt; menus by typing the following command in the Terminal:&lt;br /&gt;&lt;pre style="overflow: auto;"&gt;defaults write com.apple.frontrow EnableITMS -bool NO&lt;/pre&gt;&lt;b&gt;Warning&lt;/b&gt;: this command must be typed &lt;b&gt;before&lt;/b&gt; choosing the Deny source.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Q&lt;/b&gt;: In Leopard, some trailers won't play as smoothly as in Tiger or won't even play at all. Are you planing to release an update ?&lt;br /&gt;&lt;b&gt;A&lt;/b&gt;: Front Row for Leopard uses a very different architecture than Front Row for Tiger. Whereas Front Row for Tiger uses QuickTime for playing the trailers, Front Row for Leopard seems to uses its own mechanism ignoring QuickTime. While the trailers play fine in QuickTime Player, they may not play in Front Row. This is notably the case with german trailers using the Sorenson Video 3 codec. Unfortunately, I can not do anything about that. Nevertheless, a future update of Front Row or QuickTime may fix these issues.&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Version history&lt;/h4&gt;&lt;h5&gt;Version 2.1.2 (2008-01-24)&lt;/h5&gt;* Added Ciné.ch (swiss french source)&lt;br /&gt;* Correctly detects QuickTime version&lt;br /&gt;&lt;h5&gt;Version 2.1.1 (2007-12-18)&lt;/h5&gt;* Added Lycos (spanish source)&lt;br /&gt;* Removed Cinefacts (Front Row Trailers access has been blocked)&lt;br /&gt;* Possibility to deny trailers access&lt;br /&gt;&lt;h5&gt;Version 2.1 (2007-10-15)&lt;/h5&gt;* Name change&lt;br /&gt;* High-definition trailers&lt;br /&gt;* 20 sources&lt;br /&gt;* Italian localization&lt;br /&gt;* Danish localization&lt;br /&gt;* Sorting options&lt;br /&gt;* New update system&lt;br /&gt;&lt;h5&gt;Version 2.0.2 (2007-08-20)&lt;/h5&gt;* Fixes a bug in Perian detection&lt;br /&gt;&lt;h5&gt;Version 2.0.1 (2007-06-22)&lt;/h5&gt;* Fixes a bug in QuickTime components detection&lt;br /&gt;&lt;h5&gt;Version 2.0 (2007-06-21)&lt;/h5&gt;* New interface&lt;br /&gt;* 9 new trailers sources&lt;br /&gt;&lt;h5&gt;Version 1.1 (2007-05-03)&lt;/h5&gt;* Trailers play more smoothly&lt;br /&gt;&lt;h5&gt;Version 1.0 (2007-02-19)&lt;/h5&gt;* First version&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-2714879349885782363?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/2714879349885782363/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=2714879349885782363' title='157 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2714879349885782363'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/2714879349885782363'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2007/02/bandes-annonces-front-row.html' title='Front Row Trailers'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>157</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-6579660972378507550</id><published>2006-12-04T11:42:00.000+01:00</published><updated>2006-12-04T11:45:39.163+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fun'/><title type='text'>Network Diagnostics cannot find server</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_xtArlbzhSHA/RXP712bPcCI/AAAAAAAAAAM/NLf-RxVV2x4/s1600-h/ND-error.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://4.bp.blogspot.com/_xtArlbzhSHA/RXP712bPcCI/AAAAAAAAAAM/NLf-RxVV2x4/s400/ND-error.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5004620513500164130" /&gt;&lt;/a&gt;&lt;br /&gt;I doubt I typed the address incorrectly. :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-6579660972378507550?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/6579660972378507550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=6579660972378507550' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6579660972378507550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/6579660972378507550'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/12/network-diagnostics-cannot-find-server.html' title='Network Diagnostics cannot find server'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_xtArlbzhSHA/RXP712bPcCI/AAAAAAAAAAM/NLf-RxVV2x4/s72-c/ND-error.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-7294329074697825392</id><published>2006-11-06T13:02:00.000+01:00</published><updated>2006-11-08T12:07:01.393+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cocoa'/><title type='text'>zip vs dmg</title><content type='html'>Most Cocoa developers use disk images (aka dmg) for distributing their softwares over the Internet. This is not really surprising as this is &lt;a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/SoftwareDistribution4/Concepts/sd_disk_images.html"&gt;Apple's recommended practice&lt;/a&gt; for software distribution.&lt;br /&gt;&lt;br /&gt;My gripe against this practice is simple: it's &lt;b&gt;very slow&lt;/b&gt;. I did an experiment that I think is rather representative. I bundled a 1.9 MB application (Transmission) into both a zip file and a dmg file. I'm talking here about internet-enabled disk images, i.e. those which copy their content, unmount and go to trash automatically.&lt;br /&gt;&lt;br /&gt;Here are the results of my experiment.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;table border=1&gt;&lt;tbody&gt;&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;th align="center"&gt;Size&lt;/th&gt;&lt;th align="center"&gt;Time&lt;/th&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;zip&lt;/td&gt;&lt;td align="center"&gt;0.7 MB&lt;/td&gt;&lt;td align="center"&gt;0.16 sec&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;dmg&lt;/td&gt;&lt;td align="center"&gt;1.3 MB&lt;/td&gt;&lt;td align="center"&gt;9.02 sec&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/center&gt;&lt;br /&gt;Impressing, isn't it ? The size is almost twice bigger for the dmg although I used maximum compression (zlib level 9). That's bad (not all Mac users have a broadband connection) but what is worse is the time to &lt;i&gt;prepare the disk image, verify the disk image, mount the disk image, clean up, check the download files, prepare the disk image, mount the disk image, copy the disk image, unmount the disk image and clean up&lt;/i&gt;. Yes, these are the ten operations required for an internet-enabled disk image to achieve the &lt;i&gt;decompression&lt;/i&gt;! Zip decompression requires only two phases: &lt;i&gt;decompressing the zip file and checking the downloaded files&lt;/i&gt;, thus it is &lt;b&gt;56 times faster&lt;/b&gt;.&lt;br /&gt;Results may vary depending on application size and may be slightly different for a ten MB application but I can't see how a disk image could be either smaller or faster to decompress than a zip archive. If you know such an exemple, please post a comment about it.&lt;br /&gt;&lt;br /&gt;Since Mac OS X 10.3, zip file compression and decompression is natively supported. Prior to Mac OS X 10.3, StuffIt Expander was bundled with Mac OS X. A convenient &lt;i&gt;Create archive of "..."&lt;/i&gt; stands in the File menu of the Finder. It's simple and efficient, so why not using it ?&lt;br /&gt;&lt;br /&gt;Some may argue that disk images are &lt;a href="http://softwaretrenches.com/2006/09/dmg_disk_image_is_the.html"&gt;nice&lt;/a&gt; for drag &amp; dropping the software into the Applications folder. While this is true, this is also very slow. When using a non internet-enabled disk image, users have to &lt;b&gt;&lt;i&gt;copy&lt;/i&gt;&lt;/b&gt; the application into the Applications folder which takes much more time than &lt;b&gt;&lt;i&gt;moving&lt;/i&gt;&lt;/b&gt; it. Moreover, they have to go to the desktop in order to unmount the disk image.&lt;br /&gt;&lt;br /&gt;You have understood by now, I hate disk images and I hope more and more developers will use zip files in the future to distribute their softwares in order to save their users' precious time. ;-)&lt;br /&gt;&lt;br /&gt;Finally, I suggest you have a look at these movies (no faking) showing how fast and how long it takes to decompress respectively a zip file and a dmg file.&lt;br /&gt;&lt;br /&gt;&lt;center&gt;&lt;object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="166" width="400"&gt;&lt;br /&gt;&lt;param name="src" value="http://homepage.hispeed.ch/0xced/blog/zip-download.mov"&gt;&lt;br /&gt;&lt;param name="autoplay" value="false"&gt;&lt;br /&gt;&lt;param name="type" value="video/quicktime" height="166" width="400"&gt;&lt;br /&gt;&lt;embed src="http://homepage.hispeed.ch/0xced/blog/zip-download.mov" height="166" width="400" autoplay="false" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;br /&gt;&lt;object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="166" width="400"&gt;&lt;br /&gt;&lt;param name="src" value="http://homepage.hispeed.ch/0xced/blog/dmg-download.mov"&gt;&lt;br /&gt;&lt;param name="autoplay" value="false"&gt;&lt;br /&gt;&lt;param name="type" value="video/quicktime" height="166" width="400"&gt;&lt;br /&gt;&lt;embed src="http://homepage.hispeed.ch/0xced/blog/dmg-download.mov" height="166" width="400" autoplay="false" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"&gt;&lt;/embed&gt;&lt;br /&gt;&lt;/object&gt;&lt;/center&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-7294329074697825392?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/7294329074697825392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=7294329074697825392' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7294329074697825392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/7294329074697825392'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/11/zip-vs-dmg.html' title='zip vs dmg'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-116145077459009331</id><published>2006-10-21T19:08:00.000+02:00</published><updated>2006-10-25T13:59:27.404+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mobile'/><title type='text'>Jasscore</title><content type='html'>&lt;h4&gt;Marquez les points au jass sur votre natel&lt;/h4&gt;Vous êtes accros aux cartes et à votre natel ? Alors je suis sûr que vous adopterez Jasscore. Avec ce midlet, vous pourrez tenir les scores d'une partie de jass (chibre, mise, etc.) encore plus facilement qu'avec une ardoise.&lt;br /&gt;&lt;br /&gt;Je vous laisse juger par ces quelques &lt;i&gt;captures d'écran&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3159/3173/1600/NouvellePartie.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3159/3173/200/NouvellePartie.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;a href="http://photos1.blogger.com/blogger/3159/3173/1600/Scores.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3159/3173/200/Scores.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;a href="http://photos1.blogger.com/blogger/3159/3173/1600/Points.jpg"&gt;&lt;img style="cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3159/3173/200/Points.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Aucune documentation n'a été écrite car Jasscore devrait être assez intuitif. Si toutefois vous avez des questions, n'hésitez pas à laisser un commentaire ou bien à m'envoyer un message.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Téléchargement:&lt;/b&gt;&lt;br /&gt;&lt;a href="http://homepage.hispeed.ch/0xced/blog/Jasscore.jar"&gt;&lt;img style="border:none; padding:0px; padding-right:4px" src="http://photos1.blogger.com/blogger/3159/3173/320/Jasscore.png" border="0" alt="Z" /&gt;&lt;/a&gt;&lt;a href="http://homepage.hispeed.ch/0xced/blog/Jasscore.jar"&gt;Jasscore&lt;/a&gt; 1.0 (6 Ko)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Installation:&lt;/b&gt;&lt;br /&gt;Référez-vous à la documentation de votre natel. Si celui-ci supporte le bluetooth, il vous suffit d'envoyer le fichier &lt;tt&gt;Jasscore.jar&lt;/tt&gt; et il devrait s'installer automatiquement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-116145077459009331?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/116145077459009331/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=116145077459009331' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/116145077459009331'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/116145077459009331'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/10/jasscore.html' title='Jasscore'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115997921880545397</id><published>2006-10-04T18:20:00.000+02:00</published><updated>2006-10-25T13:42:19.720+02:00</updated><title type='text'>Replacement icon for Mail.app</title><content type='html'>&lt;a href="http://www.cocoricones.info/icones/boite-a-lettre-jaune-ptt"&gt;&lt;img style="border: none; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://www.cocoricones.info/images/102.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;I personally dislike the default Mail.app icon. Instead I chose to use the yellow mailbox from &lt;a href="http://www.cocoricones.info/icones/boite-a-lettre-jaune-ptt"&gt;cocoricones&lt;/a&gt;. It looks really nice and is not blue as almost all other Apple icons!&lt;br /&gt;You can also download it in &lt;tt&gt;&lt;a href="http://homepage.hispeed.ch/0xced/blog/app.icns.zip"&gt;.icns&lt;/a&gt;&lt;/tt&gt; format ready to replace Mail.app icon.&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;keywords: Mail.app, icon, yellow, mailbox&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115997921880545397?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115997921880545397/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115997921880545397' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115997921880545397'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115997921880545397'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/10/replacement-icon-for-mailapp.html' title='Replacement icon for Mail.app'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115986416652081920</id><published>2006-10-03T10:15:00.000+02:00</published><updated>2006-10-25T13:58:54.244+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Fun'/><title type='text'>This is too simplistic or systematic</title><content type='html'>&lt;img style="display:block; margin:0px auto 10px; text-align:center;" src="http://photos1.blogger.com/blogger/3159/3173/400/Aberration%20Password%20Assistant.png" border="0" alt="" /&gt;&lt;br /&gt;Indeed: way too simplistic! I should construct my password myself rather than relying on the &lt;i&gt;Password Assistant&lt;/i&gt; :-)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115986416652081920?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115986416652081920/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115986416652081920' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115986416652081920'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115986416652081920'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/10/this-is-too-simplistic-or-systematic.html' title='This is too simplistic or systematic'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115911642967048581</id><published>2006-09-24T18:36:00.000+02:00</published><updated>2007-05-19T12:26:58.237+02:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Hack'/><title type='text'>Xcode and subversion 1.4 fix</title><content type='html'>I was unsatisfied to have to revert back to subversion 1.3.2 because Xcode (v2.4) does not yet support the new format of subversion 1.4 &lt;tt&gt;.svn/entries&lt;/tt&gt; file (see my previous blog entry: &lt;a href="http://0xced.blogspot.com/2006/09/xcode-and-subversion-14.html"&gt;Xcode and subversion 1.4 incompatibility&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;So I wrote a SIMBL plugin that adresses this problem.&lt;a href="http://homepage.hispeed.ch/0xced/blog/Xcode+svn-1.4.zip"&gt;&lt;img style="border: none; display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3159/3173/400/XcodeSvn14.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;Download and install &lt;a href="http://www.culater.net/software/SIMBL/SIMBL.php"&gt;SIMBL&lt;/a&gt; (Smart InputManager Bundle Loader) if not already installed&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Download &lt;a href="http://homepage.hispeed.ch/0xced/blog/Xcode+svn-1.4.zip"&gt;Xcode+svn-1.4&lt;/a&gt; and decompress it&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Move &lt;tt&gt;Xcode+svn-1.4.bundle&lt;/tt&gt; into &lt;tt&gt;~/Library/Application Support/SIMBL/Plugins&lt;/tt&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Relaunch Xcode, it is now compatible with svn 1.4 :-)&lt;/li&gt;&lt;br /&gt;&lt;b&gt;Update: &lt;/b&gt;Xcode 2.4.1 addresses this problem so my plugin is not needed anymore.&lt;br /&gt;&lt;/ol&gt;&lt;div id="keywords"&gt;keywords: Xcode, SCM, subversion, svn, 1.4&lt;/div&gt;&lt;br /&gt;&lt;a href="http://www.digg.com/software/Xcode_and_subversion_1_4_fix"&gt;&lt;img src="http://digg.com/img/badges/16x16-digg-guy.gif" width="16" height="16" alt="Digg!"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115911642967048581?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115911642967048581/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115911642967048581' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115911642967048581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115911642967048581'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/09/xcode-and-subversion-14-fix.html' title='Xcode and subversion 1.4 fix'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115884132197843527</id><published>2006-09-21T14:11:00.000+02:00</published><updated>2006-10-25T13:42:19.557+02:00</updated><title type='text'>Xcode and subversion 1.4 incompatibility</title><content type='html'>Xcode will unfortunately not work with the latest version of subversion, i.e. version 1.4. The reason behind this dysfunctionment is the new format of the &lt;tt&gt;.svn/entries&lt;/tt&gt; files (see &lt;a href="http://subversion.tigris.org/svn_1.4_releasenotes.html"&gt;subversion 1.4 release notes&lt;/a&gt;). The new format is no more friendly xml. Xcode thus does not find the &lt;tt&gt;url=...&lt;/tt&gt; node and fails with this rather sparse warning: &lt;i&gt;NSScanner: nil string argument&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;The solution to this problem is to revert to &lt;a href="http://subversion.tigris.org/downloads/subversion-1.3.2.tar.bz2"&gt;subversion 1.3.2&lt;/a&gt; until Apple fixes the subversion plugin for Xcode, maybe in the next version.&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;keywords: Xcode, crash, subversion, svn, 1.4&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115884132197843527?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115884132197843527/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115884132197843527' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115884132197843527'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115884132197843527'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/09/xcode-and-subversion-14.html' title='Xcode and subversion 1.4 incompatibility'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115244885287208253</id><published>2006-07-09T14:09:00.000+02:00</published><updated>2006-11-07T07:43:34.205+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech'/><title type='text'>Dealing with outdated open source libs in Mac OS X</title><content type='html'>Mac OS X system frameworks heavily rely on open source libraries. For example, the &lt;a href="http://developer.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/index.html"&gt;NSXML classes&lt;/a&gt; of the Foundation framework are wrappers around &lt;a href="http://xmlsoft.org"&gt;libxml2&lt;/a&gt;. The problem is that libxml2 bundled into Mac OS X (10.4.7 as of writing) is version 2.6.16, dating back from november 2004! Current version is 2.6.26 and obviously has fixed a lot of bugs since version 2.6.16.&lt;br /&gt;&lt;br /&gt;A specific bug I discovered was rather annoying: NSXMLDocument's &lt;tt&gt;validateAndReturnError:&lt;/tt&gt; method would validate an invalid document. You guessed it, an up-to-date version of libxml2 doesn't suffer from this bug. So the solution to the problem would be to compile the latest version of libxml2 yourself and use this one for your application instead of the system version. This sounds easy but is in fact far from being trivial.&lt;br /&gt;&lt;br /&gt;Compiling an universal binary version of libxml2 is easy, this is achieved with the following commands:&lt;br /&gt;&lt;tt&gt;$ env CFLAGS="-arch i386 -arch ppc" LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" ./configure --disable-dependency-tracking --enable-static=no --without-python&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;$ make&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Now, &lt;tt&gt;libxml2.2.6.26.dylib&lt;/tt&gt; is almost ready to use inside the &lt;i&gt;.libs&lt;/i&gt; directory. I said almost because its install_name is &lt;i&gt;/usr/local/lib/libxml2.2.dylib&lt;/i&gt;. Unless you plan to make an installer for your application, you should change it so that it is relative to your application. For example, if your application bundle looks like this:&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;Contents&lt;br /&gt;&amp;nbsp;&amp;nbsp;Info.plist&lt;br /&gt;&amp;nbsp;&amp;nbsp;MacOS&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;MyGreatApp&lt;br /&gt;&amp;nbsp;&amp;nbsp;PkgInfo&lt;br /&gt;&amp;nbsp;&amp;nbsp;Resources&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br /&gt;&amp;nbsp;&amp;nbsp;lib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;mygreatlib.dylib&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;libxml2.2.6.26.dylib&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;copy the built library (so that you still have the original dylib in case of problem) and change its install_name with the following commands:&lt;br /&gt;&lt;tt&gt;$ cp .libs/libxml2.2.6.26.dylib .&lt;/tt&gt;&lt;br /&gt;&lt;tt&gt;$ install_name_tool -id @executable_path/../lib/libxml2.2.6.26.dylib libxml2.2.6.26.dylib&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Now, your application must link against your version of libxml2. To do so, add libxml2.2.6.26.dylib into your Xcode project and check that it has been added to the &lt;i&gt;Link Binary With Libraries&lt;/i&gt; phase of your current target.&lt;br /&gt;&lt;br /&gt;The latest step is to make sure your &lt;i&gt;libxml2.2.6.26.dylib&lt;/i&gt; is going to be used instead of &lt;i&gt;/usr/lib/libxml2.2.dylib&lt;/i&gt; at runtime. The problem is that &lt;i&gt;/usr/lib/libxml2.2.dylib&lt;/i&gt; uses two-level namespace, meaning that the Foundation framework will always use this one instead of yours. The solution is to force flat namespace by setting the &lt;tt&gt;DYLD_FORCE_FLAT_NAMESPACE&lt;/tt&gt; environment variable. This is achieved by adding the following key in your Info.plist file:&lt;br /&gt;&lt;tt&gt;&lt;br /&gt;&amp;lt;key&amp;gt;LSEnvironment&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;lt;dict&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;key&amp;gt;DYLD_FORCE_FLAT_NAMESPACE&amp;lt;/key&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;lt;string&amp;gt;YES&amp;lt;/string&amp;gt;&lt;br /&gt;&amp;lt;/dict&amp;gt;&lt;br /&gt;&lt;/tt&gt;&lt;br /&gt;&lt;br /&gt;Your application now uses the latest bug-free version of the lib :-)&lt;br /&gt;&lt;br /&gt;This example used libxml2 but obviously apply to any other open source library.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115244885287208253?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115244885287208253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115244885287208253' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115244885287208253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115244885287208253'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/07/dealing-with-outdated-open-source-libs.html' title='Dealing with outdated open source libs in Mac OS X'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115113482313088974</id><published>2006-06-24T09:33:00.000+02:00</published><updated>2007-02-25T15:21:21.394+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech'/><title type='text'>mach_inject, procmod group and security</title><content type='html'>&lt;a href="http://rentzsch.com/mach_inject/"&gt;mach_inject&lt;/a&gt; is a very clever piece of hack that allows an application to inject and execute code in another running process. It was initially written for PowerPC Macs only. Recently, Bertrand Guihéneuf ported &lt;a href="http://guiheneuf.org/mach inject for intel.html"&gt;mach_inject for Intel Macs&lt;/a&gt;.&lt;br /&gt;The big difference between the two version lies in the privilege level they require. The PowerPC version works with standard user privilege whereas the intel version requires more privileges to work.&lt;br /&gt;&lt;br /&gt;mach_inject is used for example by virtual desktops applications like Desktop Manager and VirtueDesktops. They legitimately requires the ability to inject code in the Dock as it is the only process allowed to manipulate all the windows. But running code under the identity of another process is a high security risk. That's why Apple introduced a new security feature in Mac OS X 10.4.4 (for Intel Macs only) that prevents mach_inject to work. Technically, any process not belonging to the procmod group or not running as root will fail to call &lt;tt&gt;task_for_pid&lt;/tt&gt; which is a necessary step in the process of code injection.&lt;br /&gt;&lt;br /&gt;There are several solution to this problem which are not all equivalent from a security point of view.&lt;br /&gt;The first solutions that surfaced were proposed by Jason Thames on &lt;a href="http://forum.osx86project.org/lofiversion/index.php/t12363.html"&gt;osx86project forum&lt;/a&gt;.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;His first proposal is to add yourself to the procmod group.&lt;br /&gt;&lt;li&gt;His second proposal is to change the security policy of the &lt;tt&gt;task_for_pid&lt;/tt&gt; call.&lt;br /&gt;&lt;/ul&gt;Unfortunately, both solutions are bad solutions, the former at a single user level, the latter at the computer level.&lt;br /&gt;Doing so would now allow &lt;b&gt;any application&lt;/b&gt; to inject code into another process meaning that you would have annihilated the protection introduced by Apple. :-(&lt;br /&gt;&lt;br /&gt;The good solution is to set the permission on a &lt;b&gt;per application&lt;/b&gt; basis rather than on a per user/computer basis. Unix permission mechanism is perfectly suited to perform this task. You can do it manually with a terminal, Niko &lt;a href="http://smallcultfollowing.com/nikolog/2006/06/04/virtualdesktops-and-procmod-groups/"&gt;explains the procedure&lt;/a&gt; on his blog. This works very well but is a bit tedious for users reluctant to use a terminal.&lt;br /&gt;&lt;br /&gt;The best solution is that developers who legitimately require mach_inject functionality make use of the Security/Authorization API for asking users their administrator password in order to be able to change their application's executable group to procmod and set it's set-group-ID-on-execution bit. VirtueDesktops is the first to my knowledge to do so. You can see the source on &lt;a href="http://trac.virtuedesktops.info/browser/trunk/Source/AuthTool"&gt;VirtueDesktops trac&lt;/a&gt; to understand how this can be performed.&lt;br /&gt;&lt;br /&gt;I strongly encourage developers to use the self-authorizing mechanism mentioned above as this will be beneficial for users both in a security and an ergonomic point of view.&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;keywords: mach_inject, procmod, task_for_pid, security, intel&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115113482313088974?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115113482313088974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115113482313088974' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115113482313088974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115113482313088974'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/06/machinject-procmod-group-and-security.html' title='mach_inject, procmod group and security'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115074767709981637</id><published>2006-06-19T21:54:00.000+02:00</published><updated>2006-10-25T13:42:19.375+02:00</updated><title type='text'>Attention: nouvelle campagne de phising contre PostFinance</title><content type='html'>On ne le répétera jamais assez, &lt;b&gt;votre banque ne vous enverra jamais d'e-mail vous demandant de vous authentifier&lt;/b&gt; dans le jour même sous peine d'avoir votre compte fermé!&lt;br /&gt;&lt;br /&gt;Voici l'e-mail que je reçu aujourd'hui comme beaucoup d'autres:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://photos1.blogger.com/blogger/3159/3173/1600/Phishing_PostFinance.png"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/3159/3173/400/Phishing_PostFinance.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;Lorsque l'on passe le curseur sur l'URL, on constate vite la supercherie: l'URL n'est pas du tout la même que celle annoncée dans le corps de l'e-mail. Une petite vérification avec un &lt;i&gt;whois&lt;/i&gt; nous confirme que ce n'est effectivement pas le site web de PostFinance.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://www.yellownet.ch/news/20060619_f.htm"&gt;La nouvelle sur PostFinance&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;mots clés: phishing, PostFinance&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115074767709981637?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115074767709981637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115074767709981637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115074767709981637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115074767709981637'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/06/attention-nouvelle-campagne-de-phising.html' title='Attention: nouvelle campagne de phising contre PostFinance'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115063784334133570</id><published>2006-06-18T15:30:00.000+02:00</published><updated>2006-10-25T13:42:19.290+02:00</updated><title type='text'>Using GNU lightning on an Intel Mac</title><content type='html'>&lt;a href="http://www.gnu.org/software/lightning/"&gt;GNU lightning&lt;/a&gt; is a library that generates assembly language code at run-time. This is an useful tool for writing a &lt;i&gt;Just-In-Time compiler&lt;/i&gt;.&lt;br /&gt;&lt;br /&gt;While your jit compiled code will work on most systems, you will probably experience crash under Mac OS X with an EXC_BAD_INSTRUCTION exception on a movdqa %xmm0,32(%esp) instruction. The reason if this crash may seem obscure but is in fact simple: on Mac OS X, the stack must be 16-byte aligned at the point of function calls. This is documented in the &lt;a href="http://developer.apple.com/documentation/DeveloperTools/Conceptual/LowLevelABI/index.html"&gt;Mac OS X ABI Function Call Guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So, how to fix this problem ? Align the stack &lt;i&gt;manually&lt;/i&gt; by jit compiling special instructions before every function call depending on the number of parameters pushed ? This is quite tedious. A better solution is to use gcc's &lt;b&gt;-mstackrealign&lt;/b&gt; switch.&lt;br /&gt;&lt;br /&gt;Here is the documentation of this option:&lt;br /&gt;&lt;blockquote&gt;&lt;b&gt;-mstackrealign&lt;/b&gt;&lt;br /&gt;Realign the stack at entry.  On the Intel x86, the -mstackrealign option will generate an alternate prologue/epilogue that realigns&lt;br /&gt;the runtime stack.  This supports mixing legacy codes that keep a 4-byte aligned stack with modern codes that keep a 16-byte stack for SSE compatibility.  The alternate prologue and epilogue are slower and bigger than the regular ones, and they require one dedicated register for the entire function.  This also lowers the number of registers available if used in conjunction with the "regparm" attribute.  Nested functions encountered while -mstackrealign is on will generate warnings, and they will not realign the stack when called.&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Enjoy, your program is not crashing anymore. :-)&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;keywords: GNU lightning, Intel Mac, crash, EXC_BAD_INSTRUCTION, movdqa xmm0&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115063784334133570?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115063784334133570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115063784334133570' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115063784334133570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115063784334133570'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/06/using-gnu-lightning-on-intel-mac.html' title='Using GNU lightning on an Intel Mac'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-29715439.post-115056328919965243</id><published>2006-06-17T18:54:00.003+02:00</published><updated>2009-01-15T08:44:19.594+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cocoa'/><title type='text'>Relaunch your Cocoa application by itself</title><content type='html'>Here is a &lt;a href="http://snipplr.com/view/3923/relaunch-an-application/"&gt;code snippet&lt;/a&gt; of a relaunch helper tool with instructions to use it.&lt;br /&gt;&lt;br /&gt;&lt;div id="keywords"&gt;keywords: self, restart, relaunch, cocoa, os x&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/29715439-115056328919965243?l=0xced.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://0xced.blogspot.com/feeds/115056328919965243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=29715439&amp;postID=115056328919965243' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115056328919965243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/29715439/posts/default/115056328919965243'/><link rel='alternate' type='text/html' href='http://0xced.blogspot.com/2006/06/relaunch-your-cocoa-application-by.html' title='Relaunch your Cocoa application by itself'/><author><name>Cédric Luthi</name><uri>http://www.blogger.com/profile/18136024823081920226</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://1.bp.blogspot.com/_xtArlbzhSHA/Sj4w591BIbI/AAAAAAAAACk/ETLmvVRGThQ/S220/cedric.jpg'/></author><thr:total>6</thr:total></entry></feed>
