decode.js 529 B

12345678910111213141516171819202122232425
  1. const child_process = require("child_process");
  2. const fs = require("fs");
  3. const file = fs.readFileSync(process.argv[2], "utf8");
  4. console.log(
  5. file.replace(
  6. / \(supertuxkart \+ (0x[0-9a-f]{1,16})\)/g,
  7. (existing, offset) =>
  8. existing +
  9. " => " +
  10. child_process
  11. .execFileSync("aarch64-none-elf-addr2line", [
  12. "-e",
  13. "./bin/supertuxkart",
  14. "-f",
  15. "-p",
  16. "-C",
  17. "-a",
  18. offset,
  19. ])
  20. .toString("utf8")
  21. .trim()
  22. )
  23. );