Metadata-Version: 2.1
Name: pygore
Version: 0.4.2
Summary: Python bindings for the Go Reverse Engineering Tool Kit
Home-page: https://github.com/goretk/pygore
Author: Go Reverse Engineering Tool Kit
License: UNKNOWN
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Development Status :: 4 - Beta
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: MacOS :: MacOS X
Description-Content-Type: text/markdown

[![Build Status](https://travis-ci.org/goretk/pygore.svg?branch=master)](https://travis-ci.org/goretk/pygore)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pygore)
![PyPI](https://img.shields.io/pypi/v/pygore)
# pyGoRE - Python library for analyzing Go binaries

## How to use

1. Use `pip install pygore` to download and install the library.
2. Import it into your project.
3. Write a new cool tool.

### Sample code
```python
import pygore

testfile = '/path/to/go/binary/file'

f = pygore.GoFile(testfile)
c = f.get_compiler_version()

print('Compiler: {}\nTimestamp: {}\nSHA {}\n'.
      format(c.name, c.timestamp, c.sha))

pkgs = f.get_packages()
types = f.get_types()
f.close()
for p in pkgs:
    print('Package: {}'.format(p.name))
    print("Functions:")
    for f in p.functions:
        print('{} from {} to {}'.format(f.name, hex(f.offset), hex(f.end)))
    print("Methods:")
    for m in p.methods:
        print('{} {} from {} to {}'.format(m.receiver, m.name,
                                           hex(m.offset), hex(m.end)))
    print("Types:")
    for t in types:
        print('Package path: {} | Type name: {}'.format(t.packagePath, t.name))
```



