Library for implementing decompiled code.
Project description
Fishbones
Fishbones is a library for implementing decompiled code with Python.
Requirements
- Python 3.6+
Installation
$ pip install fishbones
Usage
Fishbones defines some integer types with fixed size. You can use shorthand functions (int8, int16, int32, int64, uint8, uint16, uint32, uint64) to create them.
from fishbones import uint8
v = uint8(0x53)
Pointer operations are common in the decompiled code.
unsigned __int8 data[8] = {71, 114, 97, 118, 105, 116, 117, 109};
unsigned __int8 *p = data;
unsigned __int8 v = p[4];
*((unsigned __int32 *)p + 1) = v;
So Fishbones provides vptr.
from fishbones import vptr
data = bytearray([71, 114, 97, 118, 105, 116, 117, 109])
p = vptr(data, 'uint8')
v = p.add(4).read()
p.cast('uint32').add(1).write(v)
In some cases, decompilers may use their built-in functions in the output. Fishbones implements some of them. You can look up from fishbones.decompiler_builtins.
from fishbones import uint32
from fishbones.decompiler_builtins.ida import ror4
v = uint32(0x53683477)
v = ror4(v, 2)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fishbones-0.3.1.tar.gz.
File metadata
- Download URL: fishbones-0.3.1.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19c821b8b14c62405b122f71968322de275c7aa63c5caf29d79dc6e1aa734b76
|
|
| MD5 |
b6d5bf144f17c3b5d94b13d14342df55
|
|
| BLAKE2b-256 |
587707811a5fb7ba3b76c21cc30485e1f3d37b38bac6ece251c310fa1469cb1e
|
File details
Details for the file fishbones-0.3.1-py3-none-any.whl.
File metadata
- Download URL: fishbones-0.3.1-py3-none-any.whl
- Upload date:
- Size: 10.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.10.1 urllib3/1.26.15 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a382f775979aafb688c4d42e34d975594e205be511b9f72c20b037d2d2a47d0
|
|
| MD5 |
53d40c0b9c98bb7e71b677449ef9541d
|
|
| BLAKE2b-256 |
8f5ef097d611bd3b868bd7054e41a903a4514217eb934813498470fc333a4659
|