Giter Site home page Giter Site logo

illdb's Introduction

iLLDB

LLDB Extension for iOS App Development

Github issues Github forks Github stars Github top language

Feature

Set up

  1. clone this repository

  2. Add the following line to ~/.lldbinit

    command script import {PATH TO iLLDB}/src/iLLDB.py

Usage

UI hierarchy

(lldb) ui tree -h
usage:  tree
       [-h]
       [-d]
       [-s]
       [--depth DEPTH]
       [--with-address]
       [--window WINDOW]
       [--view VIEW]
       [--vc VC]
       [--layer LAYER]

optional arguments:
  -h, --help
    show this help message and exit
  -d, --detail
    Enable detailed mode (default: False)
  -s, --simple
    Enable simpled mode (default: False)
  --depth DEPTH
    Maximum depth to be displayed (default: None)
  --with-address
    Print address of ui (default: False)
  --window WINDOW
    Specify the target window (default: None)
  --view VIEW
    Specify the target view (property or address) (default: None)
  --vc VC
    Specify the target viewController (property or address) (default: None)
  --layer LAYER
    Specify the target CALayer (property or address) (default: None)

Example

  • Show keyWindow hierarchy

    ui tree

    KeyWindow

    ui tree -s # simple

    KeyWindow

    ui tree -d # detail

    KeyWindow

  • Show the hierarchy of a specific view

    ui tree -view {property name of view}
  • Show the hierarchy of a specific viewController

    ui tree -vc {property name of viewController}
  • Show the hierarchy of a specific window

    ui tree -window {property name of window}
  • Show the hierarchy of a specific layer

    ui tree -layer {property name of layer}

UserDefaults

usage:
       [-h]
       {read,write,delete,read-all,delete-all}
       ...
UserDefault debugging
optional arguments:
  -h, --help
    show this help message and exit
Subcommands:
  {read,write,delete,read-all,delete-all}
    read
    read UserDefault value
    write
    write UserDefault value
    delete
    delete UserDefault value
    read-all
    read all UserDefault value
    delete-all
    delete all UserDefault value

read

ud read "key"

write

ud write "key" "value"

delete

ud delete "key"

read all

ud read-all

delete all

ud delete-all

Device Info

Displays device information.

device info

device info

App Info

Displays App information.

app info

app info

File hierarchy

(lldb) file tree -h
usage:  tree
       [-h]
       [-b]
       [-l]
       [--documents]
       [--tmp]
       [--depth DEPTH]

optional arguments:
  -h, --help
    show this help message and exit
  -b, --bundle
    bundle directory (default: False)
  -l, --library
    library directory (default: False)
  --documents
    documents directory (default: False)
  --tmp
    tmp directory (default: False)
  --depth DEPTH
    Maximum depth to be displayed (default: None)

Example

  • Display the contents of the Bundle directory

    file tree --bundle
  • Display the contents of the Library directory

    file tree --library
  • Display the contents of the Documents directory

    file tree --documents
  • Display the contents of the tmp directory

    file tree --tmp
  • Display the contents of a specific directory

    file tree {url}

file tree

Open directory in Finder App (Simulator Only)

(lldb) file open -h
usage:  open
       [-h]
       [-b]
       [-l]
       [--documents]
       [--tmp TMP]
optional arguments:
  -h, --help
    show this help message and exit
  -b, --bundle
    bundle directory (default: False)
  -l, --library
    library directory (default: False)
  --documents
    documents directory (default: False)
  --tmp TMP
    tmp directory (default: None)

Show file Contents

(lldb) file cat -h
usage:  cat
       [-h]
       [--mode MODE]
       path
positional arguments:
  path
    path
optional arguments:
  -h, --help
    show this help message and exit
  --mode MODE
    mode [text, plist] (default: text)

Example

  • text file

    file cat "path"
  • plist file

    file cat "path" --mode plist

HTTP Cookie

Read Cookie Value

Displays the value of the HTTP cookie information.

(lldb) cookie read -h
usage:  read
       [-h]
       [--group-id GROUP_ID]
       [--domain DOMAIN]
       [--name NAME]
       [--path PATH]
optional arguments:
  -h, --help
    show this help message and exit
  --group-id GROUP_ID
    AppGroup identifier for cookie storage (default: None)
  --domain DOMAIN
    Domain for Cookie (default: None)
  --name NAME
    Name for Cookie (default: None)
  --path PATH
    Path for Cookie (default: None)
Example
  • Show all cookies

    cookie read
  • Show only cookies for specific domains

    cookie read --domain example.com
  • Show only cookies with a specific name from a specific domain

    cookie read --domain example.com --name KEYNAME

Delete Cookie

Delete cookie value.

After executing the command, you will be asked to confirm before deleting. If you type "Yes", the deletion will be executed as is.

(lldb) cookie delete -h
usage:  delete
       [-h]
       [--group-id GROUP_ID]
       [--domain DOMAIN]
       [--name NAME]
       [--path PATH]
optional arguments:
  -h, --help
    show this help message and exit
  --group-id GROUP_ID
    AppGroup identifier for cookie storage (default: None)
  --domain DOMAIN
    Domain for Cookie (default: None)
  --name NAME
    Name for Cookie (default: None)
  --path PATH
    Path for Cookie (default: None)
Example
  • Delete all cookies

    cookie delete
  • Delete only cookies for specific domains

    cookie delete --domain example.com
  • Delete only cookies with a specific name from a specific domain

    cookie delete --domain example.com --name KEYNAME

Objective-C Runtime

Commands for debugging with Objective-C Runtime

Show inheritance hierarchy of object's class

(lldb) objc inherits -h
usage:  inherits
       [-h]
       object
positional arguments:
  object
    object
optional arguments:
  -h, --help
    show this help message and exit
Example
(lldb)objc inherits UIWindow()
# NSObject -> UIResponder -> UIView -> UIWindow

Show a list of methods of object's class

(lldb) objc methods -h
usage:  methods
       [-h]
       [--class CLASS_NAME]
       [-c]
       [-i]
       object
positional arguments:
  object
    object
optional arguments:
  -h, --help
    show this help message and exit
  --class CLASS_NAME
    Specify a target class in the inheritance hierarchy (default: None)
  -c, --class-only
    Show only class methods (default: False)
  -i, --instance-only
    Show only instance methods (default: False)

Show a list of proerties of object's class

(lldb) objc properties -h
usage:  properties
       [-h]
       [--class CLASS_NAME]
       object
positional arguments:
  object
    object
optional arguments:
  -h, --help
    show this help message and exit
  --class CLASS_NAME
    Specify a target class in the inheritance hierarchy (default: None)

Show a list of ivars of object's class

(lldb) objc ivars -h
usage:  ivars
       [-h]
       [--class CLASS_NAME]
       object
positional arguments:
  object
    object
optional arguments:
  -h, --help
    show this help message and exit
  --class CLASS_NAME
    Specify a target class in the inheritance hierarchy (default: None)

License

iLLDB is released under the MIT License. See LICENSE

illdb's People

Contributors

p-x9 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

illdb's Issues

Use `lldb.SBInputReader` to accept user input

For example, the cookie delete command asks the user for confirmation before completely erasing.
Processing will continue only if YES is entered.

Currently, it uses the standard Python function input to accept input, but we will replace it with lldb.SBInputReader.

Use `@lldb.command` Decorator for LLDB Script Loading

Currently, custom commands defined in python are registered by calling command script add.

However, the lldb framework provides a decorator to load custom commands.
It is simpler to use this to write.

Current

def __lldb_init_module(debugger: lldb.SBDebugger, internal_dict: dict) -> None:
    debugger.HandleCommand('command script add -f xxx.my_custom_command yyy -h "DESCRIPTION"')

def my_custom_command(debugger, command, result, internal_dict):
    # Implementation of the custom LLDB command here

โ†“โ†“โ†“โ†“โ†“โ†“

New

@lldb.command('yyy', doc='DESCRIPTION')
def my_custom_command(debugger, command, result, internal_dict):
    # Implementation of the custom LLDB command here

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.