Tuesday, February 3, 2009

The iPhone Toolchain

Having jailbroken my iphone using quickpwn, I've been busy compiling the toolchain for Linux. The howto is relatively straight-forward, I've run into some issues with the xcode dmgs and extraction of the headers from the pkg - I'll add more when I've figured it all out. It's rather non-obvious.

UPDATE: Once you have the xcode dmg from Apple, use dmg2img to convert it to an img; one can mount this as hpfs loopback. Grab the pkg file the howto specifies. This is an xar archive, you'll need to grab the xar tool to get at the contents.

The command will look something like this:

(I recommend doing this in its own directory, as it just extracts to the current dir)

xar -xf MacOSX10.4.Universal.pkg


Once that's done, one of the resulting files should be called Payload. This is a gzip compressed cpio archive that contains the headers you need. I used this:

mv Payload payload.gz
gunzip -d < payload.gz | cpio -i


This is as far as I've gotten, as it's time for bed. I'll blog some more when I've finished building the toolchain.

Labels: , , , , ,

Monday, January 26, 2009

Linux photo rescue

I got to recover a number of "deleted" images off an SD card today, after an iPhoto crash on friend's laptop; after a quick google, I encountered this guide, which details the use of PhotoRec, an opensource util that scans at the device level to recover photos. Handily, it's available in apt on Ubuntu Netbook Remix under the name testdisk. The only deviation I made from the article was to mount a dir on my desktop over sshfs (I couldn't be arsed making nfs or samba work), as space is at a premium on the mini9 (photorec has to put the recovered pics somewhere) - which reminds me, I still need to put the new SSD in the mini. Will do it at some point when I feel motivated, or the root fs hits 100%.

In other news, Yoeum is at a conference till Tuesday, so I've been filling in the time catching up on some books, namely "iPhone Open Application Development", which details how to write applications for a jailbroken iPhone using an open source toolchain. It's a well-written book, and has certainly taken the edge off the crawling horror that is ObjectiveC. I wish it had gone into more detail on 2D graphics primitives, in the case where you want to draw directly on the screen (say for an archery scoring application) it basically tells you how to address a buffer and swap it, how you populate the pixels is up to you. Bummer. Once I get around to jailbreaking it, I'll start some experimentation; some googling will probably turn up some useful 2D library calls. I hope. It occurs to me as I write one could just kludge up some OpenGL to come up with a pretty decent approximation; this may indeed be the way forward. Time will tell.

I also have "Teach Yourself Electricity and Electronics" to get through, as I'm tired of my half-understood 6-year-old-highschool-physics understanding of the subject, and I want to get busy with an Arduino.

Labels: , , , , ,