Skip to main content

Static mach-o binary analysis tool.

Project description

ktool

Static Mach-O binary metadata analysis tool / information dumper

tests docs version

Installation

# Installtion
pip3 install k2l

# Updating
pip3 install --upgrade k2l

Documentation

https://ktool.rtfd.io

ktool commands

ktool includes both a library, and a script which uses that library to perform various tasks.

It'll add the command ktool to the python scripts directory (pyenv exec ktool if using pyenv)

usage: ktool [command] <flags> [filename]

ktool dump:
ktool dump --headers --out <directory> [filename] - Dump set of headers for a bin/framework
ktool dump --tbd [filename] - Dump .tbd for a framework

ktool file:
ktool file [filename] - Prints (very) basic info about a file (e.g. "Thin MachO Binary")

ktool lipo:
ktool lipo --extract [slicename] [filename] - Extract a slice from a fat binary
ktool lipo --create [--out filename] [filenames] - Create a fat MachO Binary from multiple thin binaries

ktool list:
ktool list --symbols [filename] - Print the symbol table for the file
ktool list --classes [filename] - Print the list of classes
ktool list --protocols [filename] - Print the list of protocols
ktool list --linked [filename] - Print a list of linked libraries

ktool info:
usage: ktool info [-h] [--slice SLICE_INDEX] [--vm] [--cmds] [--binding] filename
ktool info [--slice n] [filename] - Print generic info about a MachO File
ktool info [--slice n] --vm [filename] - Print VM -> Slice -> File address mapping for a slice of a MachO File
ktool info [--slice n] --cmds [filename] - Print list of load commands for a file 
ktool info [--slice n] --binding [filename] - Print binding actions for a file

written in python for the sake of platform independence when operating on static binaries and libraries

Special thanks to

IDA for making it possible to write the code without actually understanding full internals
JLevin and *OS Internals Vol 1 for actually understanding the internals and specifics + writing documentation
arandomdev for guidance + code

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

k2l-0.7.1.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

k2l-0.7.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file k2l-0.7.1.tar.gz.

File metadata

  • Download URL: k2l-0.7.1.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10

File hashes

Hashes for k2l-0.7.1.tar.gz
Algorithm Hash digest
SHA256 327c1c5479a7aa289aef55cda8026b9faaa2391d99864bf3d3aac2c72b16ed2a
MD5 5ee35484fd8dbed7c24ff3399c084414
BLAKE2b-256 0c352f15effbefe7ec0a88f9c5e5fdc25f1e457fd8d18e1c5010ba64640b8a2d

See more details on using hashes here.

File details

Details for the file k2l-0.7.1-py3-none-any.whl.

File metadata

  • Download URL: k2l-0.7.1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.62.0 CPython/3.8.10

File hashes

Hashes for k2l-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8ce4e72d0b3825a67050262e466fab0fba3a1a67674c8d7e40a7cc4bfe614415
MD5 5f02fb153486959971c4a24681fe8333
BLAKE2b-256 61c00f0c388504a67a1178a2aa8713a926a45219d8495897799fd0051bff9df3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page