Gravitum
Gravitum is a library for implementing decompiled code with Python.
Requirements
- Python 3.6+
Installation
$ pip install gravitum
Usage
Gravitum defines some interger types with fixed size. You can use shorthand functions (int8, int16, int32, int64, uint8, uint16, uint32, uint64) to create them.
from gravitum 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 Gravitum provides vptr.
from gravitum 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. Gravitum implements some of them. You can look up from gravitum.decompiler_builtins.
from gravitum import uint32
from gravitum.decompiler_builtins.ida import ror4
v = uint32(0x53683477)
v = ror4(v, 2)
Metadata
Release files for gravitum 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gravitum-0.2.1.tar.gz | 9.9 kB | Without provenance | Details for gravitum-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gravitum-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for gravitum-0.2.1-py3-none-any.whl |
Total release size: 20.6 kB
Release files / gravitum-0.2.1.tar.gz
| Download URL | gravitum-0.2.1.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ea7d318229dd4dab7ed335ddca919b7912175e47902ea83d7cafa72f6a3f70b
|
|
BLAKE2b-256 checksum How to use checksums |
dab7ee680589095a279a536465ffcaccd51b3ded82e5427679a9daf328b47558
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Release files / gravitum-0.2.1-py3-none-any.whl
| Download URL | gravitum-0.2.1-py3-none-any.whl |
|---|---|
| Size | 10.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6267050aec00cc8cd4bff0803990c619c88995bca370b9f095fd30980a3dd52d
|
|
BLAKE2b-256 checksum How to use checksums |
577834f87c054aadd06cc7550c16d9a845a9512aaf57730eee4084f80db8170d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.13
|
Security for gravitum 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.