INNER CODE UNIT · Python

asm

bongtrop/hbctool · hbctool/__init__.py:44

def asm(hasmpath, hbcfile):
    print(f"[*] Assemble '{hasmpath}' to '{hbcfile}' path")
    hbco = hasm.load(hasmpath)

    header = hbco.getHeader()
    sourceHash = bytes(header["sourceHash"]).hex()
    version = header["version"]
    print(f"[*] Hermes Bytecode [ Source Hash: {sourceHash}, HBC Version: {version} ]")

    f = open(hbcfile, "wb")
    hbc.dump(hbco, f)
    f.close()
    print(f"[*] Done")

def main():
    args = docopt(__doc__, version=f"{metadata.project} {metadata.version}")
    if args['disasm']:
        disasm(args['<HBC_FILE>'], args['<HASM_PATH>'])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…