INNER CODE UNIT · Python

disasm

bongtrop/hbctool · hbctool/__init__.py:30

def disasm(hbcfile, hasmpath):
    print(f"[*] Disassemble '{hbcfile}' to '{hasmpath}' path")
    f = open(hbcfile, "rb")
    hbco = hbc.load(f)
    f.close()

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

    hasm.dump(hbco, hasmpath)
    print(f"[*] Done")

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

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…