jsign icon indicating copy to clipboard operation
jsign copied to clipboard

Issue With EXE Signing

Open ghost opened this issue 8 months ago • 2 comments

I am building an exe with npm commands and while trying to sign, I get the error:

[2025-05-05T06:23:34Z] - INFO | java.io.IOException: Invalid certificate table size: 0 [2025-05-05T06:23:34Z] - INFO | at net.jsign.pe.CertificateTableEntry.(CertificateTableEntry.java:46) [2025-05-05T06:23:34Z] - INFO | at net.jsign.pe.PEFile.getCertificateTable(PEFile.java:331) [2025-05-05T06:23:34Z] - INFO | at net.jsign.pe.PEFile.getSignatures(PEFile.java:299) [2025-05-05T06:23:34Z] - INFO | at net.jsign.AuthenticodeSigner.sign(AuthenticodeSigner.java:373) [2025-05-05T06:23:34Z] - INFO | at net.jsign.SignerHelper.sign(SignerHelper.java:454) [2025-05-05T06:23:34Z] - INFO | at net.jsign.SignerHelper.execute(SignerHelper.java:305) [2025-05-05T06:23:34Z] - INFO | at net.jsign.JsignCLI.execute(JsignCLI.java:221) [2025-05-05T06:23:34Z] - INFO | at net.jsign.JsignCLI.main(JsignCLI.java:57) [2025-05-05T06:23:34Z] - INFO | jsign: Couldn't sign ./server.node.exe [2025-05-05T06:23:34Z] - INFO | java.io.IOException: The certificate table isn't at the end of the file

The commands used to build exe:

    "package:exe": "pnpm run prepackage && pnpm run build:exe && pnpm run inject:blob:exe",
    "package:bin": "pnpm run prepackage && pnpm run build:bin && pnpm run inject:blob:bin",
    "build:blob": "node --experimental-sea-config sea-config.json",
    "build:exe": "node -e \"require('fs').copyFileSync(process.execPath, 'dist/server.node.exe')\"",
    "build:bin": "cp $(command -v node) dist/server.node.bin",
    "inject:blob:exe": "pnpm dlx postject dist/server.node.exe NODE_SEA_BLOB dist/server.node.blob --sentinel-fuse NODE_SEA_FUSE_fce68xxxxxxxx2",
    "inject:blob:bin": "pnpm dlx postject dist/server.node.bin NODE_SEA_BLOB dist/server.node.blob --sentinel-fuse NODE_SEA_FUSE_fce6xxxxxxxxxxx8"

ghost avatar May 05 '25 08:05 ghost