#Programming

  1. Using AddressSanitizer with Xcode 4.6.1

    Clang 3.3 now supports AddressSanitizer. Here is the description from the Clang 3.3 documentation:
    [Read More]
  2. Simple code injection using DYLD_INSERT_LIBRARIES

    In the following article I will describe a simple method to inject code into executables on Mac OS X 10.8 using the DYLD_INSERT_LIBRARIES environment variable.
    [Read More]
  3. StuffIt ContextualMenu for MacOSX 10.6

    Smith Micro Software released StuffIt Deluxe® 2011 this week. If you don’t know StuffIt Deluxe®, it is described like this: The StuffIt Deluxe® package gives you all the features you need to backup, share, archive, encrypt and shrink your photos, music, and other documents without compromising quality. StuffIt’s advanced technology specializes in the compression of MP3, PDF and graphics files with no quality loss. Shrink documents up to 98% of their original size. Use StuffIt to free-up space on your computer and to fit more compressed files onto CD/DVDs or other drives.
    [Read More]
  4. Implementing a Service on 10.6

    In this post I talk on how to write a Service for MacOS X 10.6. If you don’t know what is a Service, Apple describes it here http://www.apple.com/macosx/refinements/:
    [Read More]
  5. Determining the running kernel mode on 10.6

    It might be useful in some cases to know if the MacOS kernel is running in the 32-bit or 64-bit (K64) mode. This is useful for example if you write an application like ‘System Profiler’ that displays the details of the currently running system:
    [Read More]
  6. ‘Open in 32-bit mode’ – ‘Open using Rosetta’

    As you know, it is possible to force an Universal Binary (ppc, i386, x86_64) to run in 32-bit mode (i386) even if the machine could run x86_64 binaries.
    [Read More]
  7. PICT support in 64-bit app

    QuickDraw is the legacy 2D drawing engine for Macintosh computers and was deprecated in Tiger (10.4) but is still available for 32-bit applications on 10.4, 10.5 and 10.6. 64-bit applications can’t use QuickDraw yet and Apple recommends to switch to other technologies like Quartz 2D.
    [Read More]
  8. Automatic Backtraces

    Here are different solutions to display automatically a backtrace when entering a specific function in your application. As an example we will take the following program. It’s a really simple program: the main function calls the function function1 which prints a string.
    [Read More]
  9. getrlimit and randomness

    To determine the maximum number of files your application can open, there is a function getrlimit() available.
    [Read More]
  10. ‘newMovieDontInteractWithUser’ flag

    Some QuickTime functions take a ‘short flags’ as parameter, for example NewMovieFromHandle or NewMovieFromDataRef:
    [Read More]