Daniel’s Stuff

Somewhere where I can muse about the things that interest me

Archive for the 'Mac OS X' Category

More progress on the HP48GX emulator for the iPhone

I had a bit more of a play with the emulator code tonight and fixed up a few little glitches.  I also changed the color of the emulation screen to look more like the real thing :)  Now off to bed!  It also looks like it is OK to distribute the ROM file as apparently HP released the ROMs to the public some time in 2000.  The github repository (http://github.com/dparnell/i48/tree/master) has been updated to include the ROM file.

5 comments

A HP48GX emulator for the iPhone and iPod Touch

I have just released the source to a HP48GX emulator for the iPhone and iPod Touch.
It’s a very rough port of x48 to the iPhone, but it works :)  There is the occasional screen glitch and I’m not too happy with the screen buffer code.  Something else that is a bit annoying is that it appears that compiling in Debug mode to run on the device does not work.  It looks like one of the case statements in the x48 emulation code is too big to be compiled for ARM under gcc.  I had a quick look at using the LLVM compiler but it didn’t seem to like it.
The code can be downloaded from http://github.com/dparnell/i48/tree/master 
Another thing to be aware of is that the code does not include a ROM, but they are fairly easy to come by with a bit of googling :)

1 comment

FreeTDS and my new Mac Pro

I’ve been having some “fun” with my new Mac Pro.  In order for me to be able to use it for my daily work I need to be able to connect to a Microsoft SQL Server instance from the Rails app I’m working on at my day job.  Normally this is just a simple matter of installing FreeTDS, Ruby-ODBC and the Ruby DBI and DBD packages.  When I did this, as soon as I tried to make a connection to the SQL Server instance my application would crash with a bus error!  After a bit of digging around with gdb I discovered that the application was crashing when FreeTDS was trying to deallocate a string using the standard C library memory function free.  The really weird thing is that the string was pointing to a valid string.  I dug a little further and found that if I changed the code that was allocating the string to use malloc and strcpy instead of strdup it worked!  If anybody out there knows why this might make a difference I’d really like to hear from them about it.

2 comments

Windows Live compression update

I had a bit of time yesturday to spend working on the Windows Live compression reverse engineering.  I successfully decompressed around 20 bytes.  The previous record was 2 bytes ;)  There are two parts to the compression.  First is the compressed data and the second is pointers back into decompressed data.  The compressed data is working quite well, but the pointers to repeated blocks that have already been decompressed is off a little so I see some correct data and some rubbish.  Hopefully I’ll get some more time in the next couple of days to work on it some more. 

20 comments

PSMTabBarControl and Interface Builder 3.0

For one of the projects I’m working on I needed a nice looking tab bar control.  Under previous versions of Mac OS X I used the PSMTabBarControl.  The control is nicely integrated into Interface Builder 2.0, but I no longer have IB 2.0 installed as I’ve upgraded to more recent versions of XCode.  I’ve done a very quick port of the code for IB 3.0 and made it available here on github.
Enjoy :)
7 comments

OS X 10.5.6

As many people are aware Apple released Mac OS X 10.5.6 yesterday.  Unfortunately this broke the HttpMail plugin :(  After a little bit of poking around I found and fixed the problem.  The result is a new release of the plugin 1.53.  
Head on over to my downloads site at http://www.automagic-software.com/
Now, for a status report on Windows Live Mail reverse engineering.  I am still making progress.  I’m not getting as much time to work on it as I would like these days due to having two small children ;)  If anybody wants to donate a copy of the Hex-Rays decompiler then I imagine things would progress much faster ;)
62 comments

Windows Live Mail

Just a quick note to let everybody know that I’m making good progress reverse engineering the Windows Live Mail protocol.  With the help of a couple of other people I’ve managed to determine the nature of the compression used on the message data.  We’ve successfully managed to build the decompression table and I’m now working through the routine to do the actual decompression.  IDA Pro is an amazing piece of software and I highly recommend it if you ever need to do any reverse engineering of compiled programs.

23 comments

HTTPMail 1.52 released

I’ve received quite a lot of email about 10.5.3 breaking the plugin, and finally got around to looking into it today. I have uploaded a new version of the plugin that seems to work for me ;)
As always the latest version can be grabbed from my downloads page.

105 comments

Weird characters in the previous post

Something really strange happened in the previous post.  There were these weird characters appearing in the text.  From what I can see it is WebKit trying to be helpful and create non-breaking spaces.  Unfortunately rather than insert a good old   it is inserting 0xA0 characters.  I’ve just added some code to look for these characters and replace then with  .  It should be interesting to see if it works ;)

3 comments

WebView woes

I have been working on a little blog posting app for my wife for some time called BlogThing.  The first version worked well enough that I released it for download from the Automagic Software site.  It used some pretty nasty stuff that iterated over the chunks in an NSAttributedString, and while it worked pretty well I decided I wanted something a little more future proof.  To that end I decided to look into using WebView in edit mode.  Under 10.4 this worked really nicely.  I could drag in imanges, set the fonts and do all sorts of really neat things.  Unfortunately under 10.5 dragging and pasting images into the blog posting just stopped working :( and I’ve not had a lot of time to look into it.  Tonight I’ve managed to get it working well enough that I think I can finally give it to my wife to play with.
The following is an example of what I’ve had to do to get dragging to work the way I want it do.  I really don’t like it though

- (unsigned)webView:(WebView *)sender dragDestinationActionMaskForDraggingInfo:(id <NSDraggingInfo>)draggingInfo {

NSPasteboard* pb = [draggingInfo draggingPasteboard];

if([pb availableTypeFromArray: [NSArray arrayWithObject: NSFilenamesPboardType]]) {

// @TODO: this code assumes that any file dragged in is an image!  Bad things will probably happen if they aren’t

NSArray* filenames = [pb propertyListForType: NSFilenamesPboardType];

NSMutableString* html = [NSMutableString string];

for(NSString* filename in filenames) {

[html appendFormat: @"<img src=\"%@\"/>", [[[NSURL alloc] initFileURLWithPath: filename] absoluteString]];

}

[pb declareTypes: [NSArray arrayWithObject: NSHTMLPboardType] owner: self];

[pb setString: html forType: NSHTMLPboardType];

}

return WebDragDestinationActionAny;

}

Incidentally I’m posting this with BlogThing 2.0

1 comment

« Previous PageNext Page »