4

I want to create a hex dump of a binary file in Mac OS X.

In all apps in Mac OS, when you navigate to /Contents/Resources/, there is a file (or more) with the same name as the app.

I want to write an application in Objective-C that can read that file and convert it to some kind of a hex dump, like terminal's hexdump.

Does anybody know a way to create such a hex dump using Objective-C? (or perhaps an open source hex editor, written in objective-c?)

Thanks in advance.

Bas Jansen
  • 61
  • 1
  • 4

2 Answers2

3

Hex Fiend is embeddable, if it's an editor that you're after.

ergosys
  • 47,835
  • 5
  • 49
  • 70
1

Use NSData to read the file as raw data, then display the bytes however you want (for example, using a format string).

jtbandes
  • 115,675
  • 35
  • 233
  • 266