Giter Club home page Giter Club logo

dressing's Introduction

dressing

๐Ÿƒ address resolution for you and your friends ๐Ÿ…

pypi pyversions Linux build on Travis CI Windows build on Appveyor


Synopsis

dressing is a simple cross-platform utility for resolving the addresses of functions from shared libraries, using GetProcAddress on Windows and dlsym on POSIX systems. Inspired by the arwin program originally authored by Steve Hanna.

License

This code is released under the MIT License.

Installation

Download the latest packaged release from PyPI:

pip install dressing

Or get the latest version from version control:

pip install https://github.com/welchbj/dressing/archive/master.tar.gz

Basic usage

The dressing command-line tool accepts two arguments: the name of the library in which you would like to search and the name of the function for which you would like to find the address.

A complete shared library name does not need to be provided, as some searching will be performed based on OS semantics. Here's a quick example on a Windows box:

$ dressing kernel32 HeapCreate
0x7ffa41b1d900

Note that the previous example is reporting the absolute address in memory of HeapCreate. If you wanted the offset to HeapCreate (using the base address of the loaded kernel32.dll module as our point of reference), you'd use:

$ dressing -o kernel32 HeapCreate
0x1d900

To see more details about the location of the shared library identified by dressing, use the -v option. The fully specified path is provided for Windows, as shown in the below example.

$ dressing -v kernel32.dll LoadLibraryA
Using library at C:\windows\system32\kernel32.dll
0x7ffa41b1e090

On POSIX systems, the shared library name will be fully expanded. This is demonstrated in the below example:

$ dressing -v c printf
Using library at libc.so.6
0x7f0c6fe3ced0

Disclaimer

It should be noted that due to the shared library search semantics of dlsym (used under the hood for POSIX-based function lookups), the search space for a function name will include all loaded modules. This results in the following undesirable behavior, where we still receive addresses for functions that are not exported directly within the library we specify:

$ dressing dl printf
0x7f4d00c59e80

As such, make sure you know the "owning" module of the function which you're resolving.

Detailed options

Here's what you should see when running dressing --help:

usage: dressing LIBRARY FUNCTION

         8I
         8I
         8I                                           gg
         8I                                           ""
   ,gggg,8I   ,gggggg,   ,ggg,     ,g,       ,g,      gg    ,ggg,,ggg,     ,gggg,gg
  dP"  "Y8I   dP""""8I  i8" "8i   ,8'8,     ,8'8,     88   ,8" "8P" "8,   dP"  "Y8I
 i8'    ,8I  ,8'    8I  I8, ,8I  ,8'  Yb   ,8'  Yb    88   I8   8I   8I  i8'    ,8I
 d8,   ,d8b,,dP     Y8, `YbadP' ,8'_   8) ,8'_   8) _,88,_,dP   8I   Yb,,d8,   ,d8I
 "Y8888P"`Y88P      `Y8888P"Y888P' "YY8P8PP' "YY8P8P8P""Y88P'   8I   `Y8P"Y8888P"888
                                                                               ,d8I'
                                                                             ,dP'8I
                                                                            ,8"  8I
                                                                            I8   8I
                                                                            `8, ,8I
                                                                             `Y8P"
                    address resolution for you and your friends

positional arguments:
  LIBRARY        the library in which to search for the specified function
  FUNCTION       the function whose address you want to resolve

optional arguments:
  -h, --help     show this help message and exit
  -o, --offset   print the offset of the function within its loaded module
  -v, --verbose  increase detail of output
  --version      program version

Special Thanks

This project would not have been possible without the help of my good friend, Jinny. Check out her GitHub page!

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.