开发者

Creating hex dump in Objective-C

开发者 https://www.devze.com 2023-03-19 07:15 出处:网络
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 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? (o开发者_StackOverflow社区r perhaps an open source hex editor, written in objective-c?)

Thanks in advance.


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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消