Category: Misc

When setting up a new Windows machine, whether it’s Windows 2000 all the way up through Windows 7, you’ll occasionally run into an issue where you need drivers for a system or PCI device that you just can’t seem to find. To make matters worse, you don’t know which company made the device, so you don’t even know where to start looking for drivers. Should you go to Dell’s site? The motherboard manufacturer? Persistent “Unknown device” entries in the Windows Device Manager are a plague upon even the most seasoned techs. Here’s a tip to get your driver hunt moving in the right direction.

Find Out Who Made the Device

Figuring out which company made the device(s) in question is the first step towards getting it working. Start by opening the Windows Device Manager. My preferred quick way of doing this is clicking Start -> Run -> type “devmgmt.msc” -> press Enter. Once there, choose the device in question and right click it, and select Properties. Select the Details tab to see something like the view below:

Windows Device Manager

Note the PCI “VEN” and “DEV” 4-character identifiers. PCI, USB, and many other system devices have Vendor and Device IDs. The Vendor ID is specific to the manufacturer, like Broadcom or nVIDIA. The Device ID is specific to the particular make or model of device you have. These are expressed in hexadecimal (0 through 9 plus A through F), so don’t be surprised to see letters there, as well. Some common Vendor IDs are 8080 and 8086 for Intel, 0A5C for Broadcom, 10DE for nVIDIA, 1002 for ATI, and many more.

Look Up Vendor and Device IDs

A common way to express both the Vendor and Device IDs in a single string is 1022:2000, Vendor ID first. Combine your Vendor and Device IDs in this manner, and wrap it with quotes: “1022:2000″. Google that, and you should quickly figure out who made your “Unknown device” and what model it is. With this knowledge, you can either find the appropriate driver on your computer manufacturer’s website (Dell makes a good note of which manufacturer’s devices they use for a particular system), or you can visit the device manufacturer’s website directly.

I hope this information can help those looking to simply get their hardware working under Windows, whether it’s running on a Mac or PC.

Published on September 13, 2009

So you’re curious about the contents of iPhone and iPod Touch apps, including artwork, sounds, and more? Here’s how to dig into an application and see what goodies are hidden inside. Standard copyrights still apply.

Sync Your Apps with iTunes

Assuming you already have the target application on your iPhone or iPod Touch (just “iPhone” from this point forward for brevity’s sake), simply sync your iPhone with your Mac or PC. Doing so will backup your device and transfer any purchased applications in both directions. With the target application now on your computer, navigate to your iTunes “Mobile Applications” folder, where iTunes typically does its own file housekeeping. Under Mac OS X, the default location is /Users/yourname/Music/iTunes/Mobile Applications/.

Unzip an App

Copy your target .ipa-suffixed application to a different location, ensuring that the original stays in the Mobile Applications folder to keep iTunes happy. To get inside the application, rename its extension to .zip. Open the zip file, and you will have access to the guts of the app (except the source code, of course).

High-res App Artwork

Directly inside the unzipped application folder, you’ll find a file named “iTunesArtwork”, with no extension. A hex editor revealed that the file is typically a jpeg image, so rename it to include .jpg at the end, and you’ll end up with the same 512×512 pixel artwork displayed by iTunes when browsing downloaded Applications.

To get at other resources, open up the adjacent “Payload” folder, and you’ll find a .app file — the application bundle that runs on the iPhone. Right- or Control-click on the .app, and choose “Show Package Contents” to open up the bundle.

Sounds

Sounds are typically found among the many resources directly inside the application as files with extensions like .caf, .mp3, .aif, and .m4a. At this point, the organizational structure is up to the application’s developer, so you may need to look around a little. Leopard’s QuickLook feature is a boon in times like this, helping assess a file’s purpose without opening half a dozen applications.

Other Graphics

Also nestled inside iPhone applications are many of the graphics used throughout the app. It’s possible that some may be drawn by code, but complex graphics are generally stored as images. However, viewing the images isn’t as easy as renaming the files as before. This will be a bit trickier, as the iPhone works some magic on the images before finishing the app build process, leaving images in an iPhone-optimized state. Fortunately, the process can be reversed with a little bit of Terminal trickery:

  1. Copy all .png images to a new folder elsewhere. Images of other formats (.jpg, .gif, etc.) should be readily viewable.
  2. Download David Watanabe’s modified iPhonePNG command-line application, unzip the archive, and open up Terminal from your /Applications/Utilities folder.
  3. Type cd , then drop the iPhonePNG folder into the Terminal, and tap Return to switch to that folder.
  4. Type ./iPhonePNG , drop the folder of encoded images into the Terminal, and tap Return to decode the whole folder full of images.
  5. The output folder sites beside iPhonePNG, so type open . and tap Return (open space dot) to open the current folder (a dot, in Unix terms) in the Finder. Open the decoded images folder and have a look around!
Published on March 21, 2009

For the past several weeks, my MacBook Pro had been occasionally waking up during periods where it was expected to be in sleep mode. Even with the lid closed, it would briefly wake up, illuminate the screen and Apple logo, then fall back asleep moments later. Seemingly random, it would sometimes happen only once every other day, and other times it would happen sequentially with only seconds in between cycles. I had no idea if the issue was hardware or software, but it didn’t seem major enough to warrant an AppleCare call.

A quick trip to the Console application in the Applications > Utilities folder reported dozens of instances of “USB caused wake event (EHCI)”, which gave me some initial Google hits. The obvious answer is that a USB device was waking up the computer, however I rarely had USB hardware plugged in when the random awakenings were occurring.

As it turns out, others have had this problem before. As indicated in the previous links, Mac OS X keeps its power schedule inside /Library/Preferences/SystemConfiguration/com.apple.AutoWake.plist, but this file didn’t exist for me, apparently “confusing” Mac OS X. Without it, it would exhibit the symptoms I was encountering.

Following suggestions, I opened System Preferences > Energy Saver > Schedule, where you can schedule system sleeps and wakes. By toggling on a scheduled wake, clicking OK, then disabling it, the com.apple.AutoWake.plist was re-created, and left with no scheduled sleeps or wakes. So far, this has cured my MacBook Pro’s insomnia!

Published on August 2, 2008

Lately I’ve been working with Mozilla’s XUL platform under xulrunner, and found that I needed to make a properly branded Windows application, but had no tools or knowledge on how to “glue” standard .ico icon files together, or insert them into an already-compiled .exe file. After some research and a little trial and error, I found a method that works. Assuming you have some prepared 16, 24, 32, and 48 pixel images suitable for an icon set, here’s how to go about getting them from Photoshop into a Windows application, using only free software.

Photoshop to Multiple .ico Files

The first step to branding a generic executable with your own icons is to get them out of the graphics program and into .ico format, which is the standard for Windows software icons and cursors. IcoFormat, a free Photoshop import/export plugin for handling .ico files, will easily handle the task. Once installed to your Photoshop plugins folder (and Photoshop subsequently restarted), you can save each of your icons as a .ico file using “Save As…”, and choosing ICO from the Format menu in the resulting dialog. Repeat for each icon size you wish to embed (or, if you’re ambitious, try recording a Photoshop action to automate the process).

Multiple .ico Files to One .ico File

To allow Windows to display the best size icon for the current folder view, it’s best to combine the desired .ico files into a single file. The free Icollator program will take in multiple icons and produce a single .ico file ready for embedding. You may need the Java Runtime Environment to run Icollator, if you don’t already have it. Like Icollator, JRE is also free download.

Embed the .ico File

The last step is to embed the single .ico file (containing two or more icons) into the .exe. Launch the freeware Resource Hacker utility, and Open the target .exe. Then select Action -> “Add a new Resource…”, and pick the combined .ico file you made in the previous step. Give the resource a simple name like “ICONS”, and click Add Resource. Save the changes to the .exe, and switch to Windows Explorer. You’ll notice that the .exe now has the embedded icon set, and Windows will show the correct size icon for the current view mode. Also, you’ll notice that Resource Hacker made a backup of the .exe before embedding, just for safe keeping.

Also potentially of interest: Getting application name and icon right with XULRunner from the AdBlock Plus blog

Published on July 21, 2008

In woodworking, metalworking, and other crafts where exact reproduction of a given piece is crucial, a common tool is a “jig.” A jig is effectively a template for creating a copy. For example, when a door key is duplicated, the cutting machine uses the existing key as a jig, tracing the hills and valleys on its edge to produce an identical version.

Along the same line, when developing a web application or just a simple page, HTML forms require that data be typed in and submitted. This process will repeat as the server-side code is refined, and typing the same data over and over gets old as soon as the second iteration. “Don’t Repeat Yourself”, or “DRY”, is a common philosophy for writing better code, and should extend to testing your forms, as well. Save your typing for code.

Form Jig is a small Firefox extension for replicating HTML form data and server-side code. To use it, fill out a form on a page, click the red Capture button in your Firefox status bar, then submit the form. Upon returning for further testing, click the green Replay triangle to populate the form just as you left it. Form data is kept around until the current Firefox window is closed, and can be used between tabs. Install Form Jig from Mozilla Addons.

Suggestions are welcomed, and bug reports will be attended to.

Update: Version 1.0.1 fixes a bug related to checkboxes and radio buttons. The updated plugin should appear on addons.mozilla.org shortly (linked via the above button), but still hasn’t passed Mozilla’s “nomination” for public consumption.

Published on June 5, 2008