Created
November 12, 2020 20:07
-
-
Save TerrorJack/6f420c532f50b70f7287dd6107ec0a7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import ast | |
import subprocess | |
import sys | |
if __name__ == "__main__": | |
r = subprocess.run(["wasm2wat", "--enable-all", sys.argv[2]], | |
capture_output=True, | |
check=True, | |
text=True).stdout | |
for l in r.splitlines(): | |
toks = [tok.strip("($)") for tok in l.split()] | |
if toks[0] == "data": | |
print("{0} D - {1:x}".format(toks[1], | |
len(ast.literal_eval(toks[4])))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment