Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/deleterium/smartc-signum-decompiler
Decompiler for Signum smart contracts: Machine code to SmartC assembly
https://github.com/deleterium/smartc-signum-decompiler
Last synced: 25 days ago
JSON representation
Decompiler for Signum smart contracts: Machine code to SmartC assembly
- Host: GitHub
- URL: https://github.com/deleterium/smartc-signum-decompiler
- Owner: deleterium
- License: bsd-3-clause
- Created: 2022-05-16T12:25:25.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-08T18:03:28.000Z (9 months ago)
- Last Synced: 2024-08-12T06:59:24.838Z (3 months ago)
- Language: TypeScript
- Size: 129 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SmartC Signum Decompiler
Decompiler for Signum smart contracts: Machine code to SmartC assembly# Setup
This library can be obtained through npm:
```
npm install smartc-signum-decompiler
```# Usage
Simple use
```js
import Decomp from 'smartc-signum-decompiler';const machineCode = '28'
const Options = {
machineCode,
variables: ['a', 'b', 'c', 'teste_d', 'r0'],
labels: [{ address: 0, label: '__fn_main' }]
}
const result = new Decomp(Options).decompile()
// Use:
// result.assemblyProgram
// result.variables
// result.labels
```Options properties are all optionals, but at least one of attachmentBytes, creationBytes or machineCode must be supplied.
```js
Options: {
attachmentBytes: string,
creationBytes: string,
machineCode: string,
variables: string[],
labels: Label[],
padInstruction: string
}
```# Browser usage
You can use jsdelivr.net and import the es2020 module:```html
import Ssd from 'https://cdn.jsdelivr.net/npm/smartc-signum-decompiler/dist/index.js';
```
A file tester.html is included in this repo. It is possible to test the decompiler with `npm run webpage` then pointing the browser at http://localhost:7001
# Social media
Join [SmartC Compiler](https://discord.gg/pQHnBRYE5c) server in Discord to stay tuned for news or ask questions.