ebourg / jsign

Java implementation of Microsoft Authenticode for signing Windows executables, installers & scripts
https://ebourg.github.io/jsign
Apache License 2.0
250 stars 107 forks source link

Unsupported File ".exe" #212

Open isagargit opened 3 months ago

isagargit commented 3 months ago

We are using GaraSign CLI to sign .NET packages that internally uses jsign. I have installed jsign 6.0 but when i try to sign a .exe file i get the error:

[2024-03-22T05:57:54Z] - INFO | == Begin jsign output == [2024-03-22T05:57:54Z] - INFO | jsign: Unsupported file: testapp.exe [2024-03-22T05:57:54Z] - INFO | Try `jsign --help' for more information.

DLL signing works perfectly

ebourg commented 3 months ago

It looks like Jsign fails to parse the .exe file, are you sure the file is valid? If you can send the file to ebourg@apache.org I'll give it a look.

isagargit commented 3 months ago

The file is valid, but actually cant share it. can you still suggest what could be wrong. jsign should work right ?

ebourg commented 3 months ago

Could you share at least the header of the file? The first 1K will be enough to analyze the issue.

isagargit commented 3 months ago

I parsed the file using pefile module. Here's the file pefile_output.txt

ebourg commented 3 months ago

How was the file generated?

isagargit commented 3 months ago

using this script: import pefile

with open("C:\Users\<>\Downloads\pefile_output.txt", "w") as f: pe = pefile.PE("C:\Users\<>\Downloads\testapp.exe") f.write(pe.dump_info())

ebourg commented 3 months ago

Sorry, I meant how was the .exe generated.

ebourg commented 3 months ago

What are the bytes at the offsets 0xF2 and 0xF3? That's just after "PE" and should be 0.

ebourg commented 1 month ago

@isagargit If you are still around I'd like to figure out why Jsign fails with your file