Coder Social home page Coder Social logo

slotool's Introduction

slotool (Swifty Light otool)

(Very) limited otool like tool written in Swift.

For educational purposes only. Obviously don't use this and prefer the more reliable otool

I wanted to play around with the Mach-O format and try to parse it to retrieve various infos like otool does.

Usage

Only supports printing the Mach header and load commands.

USAGE: slotool [-h] [-l] <input-file>

ARGUMENTS:
  <input-file>

OPTIONS:
  -h                      print the mach header
  -l                      print the load commands
  -?, --help              Show help information.

Examples

> slotool -l /bin/ls
> Image</bin/ls>: FAT Image
Arch 0: Little Endian, 64, CPU_TYPE_X86
Arch 1: Little Endian, 64, CPU_TYPE_ARM
Load commands for Arch 0
Load command 0
     cmd LC_SEGMENT_64
 cmdsize 72
 segname __PAGEZERO
  vmaddr 0x0
  vmsize 0x100000000
 fileoff 0
filesize 0
 maxprot 0x0
initprot 0x0
  nsects 0
   flags 0
Load command 1
     cmd LC_SEGMENT_64
 cmdsize 552
 segname __TEXT
  vmaddr 0x100000000
  vmsize 0x8000
 fileoff 0
filesize 32768
 maxprot 0x5
initprot 0x5
  nsects 6
   flags 0
[...]
Load command 13
    cmd LC_LOAD_DYLIB
cmdsize 48
   name /usr/lib/libutil.dylib (offset 24)
Load command 14
    cmd LC_LOAD_DYLIB
cmdsize 56
   name /usr/lib/libncurses.5.4.dylib (offset 24)
Load command 15
    cmd LC_LOAD_DYLIB
cmdsize 56
   name /usr/lib/libSystem.B.dylib (offset 24)
[...]
> slotool -h /Applications/VLC_PPC.app/Contents/MacOS/VLC
> Image</Applications/VLC_PPC.app/Contents/MacOS/VLC>: Single Image, Big Endian, CPU_TYPE_POWERPC
Mach header
     magic  cputype cpusubtype  caps    filetype ncmds sizeofcmds      flags
0xfeedface       18          0  0x00           2    17       1664 0x85

License

JMSCDGL (Je M'en Soucie Comme D'une Guigne License) = do what you want with it

slotool's People

Contributors

mcnight avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.