Git Product home page Git Product logo

dress's Introduction

dress

add symbols back into a stripped ELF binary

website

Usage

./dress <in-file> <out-file> <sym-file> [-v]

  • in-file: path to the input (stripped) ELF binary
  • out-file: path to the desired output location of the dressed binary; this file will have the same permissions as in-file
  • sym-file: path to the symbol file
  • -v: turns on verbose output; this is generally not helpful unless something is going wrong

Example

$ gcc test.c
$ readelf -s a.out
Symbol table '.symtab' contains 70 entries:
...
62: 0000000000601044     4 OBJECT  GLOBAL DEFAULT   26 counter
64: 0000000000400593    54 FUNC    GLOBAL DEFAULT   14 main
69: 0000000000400566    45 FUNC    GLOBAL DEFAULT   14 test
$ strip a.out -o b.out
$ readelf -s b.out
$ dress b.out c.out a.syms
$ readelf -s c.out
Symbol table '.symtab' contains 3 entries:
0: 0000000000601044     0 OBJECT  LOCAL  DEFAULT   25 counter
1: 0000000000400593     0 FUNC    LOCAL  DEFAULT   14 main
2: 0000000000400566     0 FUNC    LOCAL  DEFAULT   14 test

Building

gcc dress.c libelf.c logging.c -o dress

Symbol file format

Currently, there are two types of symbols: global variables and function names. By default, all symbols are globals. However, adding parentheses after the symbol name designates it as a function. The address of the symbol is indicated after the @ sign with an asterix. The address can be in either base 16 or base 10.

Example a.syms:

counter @ *0x601044
main() @ *0x400593
test() @ *0x400566

Known issues and limitations

  • While Binary Ninja handles most global variables as intended, IDA has issues recognizing the symbol names. This is most likely due to the improper labeling of corresponding section for their symbols. Ability to specify sections for symbols will be added in the future.
  • This version of dress is only compatible with 64 bit ELF files.

dress's People

Contributors

sciencemanx 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.