Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: pp and setting Windows LegalCopyright in executable header

by mpmcgill (Novice)
on Dec 07, 2016 at 13:21 UTC ( [id://1177384]=note: print w/replies, xml ) Need Help??


in reply to pp and setting Windows LegalCopyright in executable header

Marshall is right. What I want is to have information displayed when viewing the properties from Windows explorer. I have tried most of the options suggested in the stackoverflow "version info for dll" post with little success.

I agree that the problem is in Win32::Exe which, as noted above, has not been updated since 2011. I also agree that the Windows PE (Portable Executable) format is complicated. The reason the --info feature was removed from pp is because it did not work which is because Win32::Exe breaks the executable when used.

I was using ActiveStates PDK which does work very well, but I am trying to find a purely open source solution. As to Visual Studio, I hate to use MS software on a perl project

  • Comment on Re: pp and setting Windows LegalCopyright in executable header

Replies are listed 'Best First'.
Re^2: pp and setting Windows LegalCopyright in executable header
by Marshall (Canon) on Dec 08, 2016 at 19:12 UTC
    Sounds to my like you've tried all the "usual suspects".

    I was going to suggest the Active State PDK (Perl Dev Kit), but I went to the AS website and evidently they no longer sell licenses as a standalone product. That vastly increases the cost. I bought a license 15+ years ago, sure hope that I can continue to get updates because this thing works amazingly well with many features that the open source packaging tools don't have.

    I think you are probably aware of this, but for others, here is the official link to the PE spec: MS PE/COFF specification. Yes, it is complex. I suspect that some sort of checksum or what MS calls the Authenticode PE Image Hash is not being updated correctly. That sounds it would cause the "exe actually works, but throws a bunch of error msgs" problem.

    There is a report from stevieb that VS 2013 has some sort of issue with modifying the .exe header information. That surprised me. Whether or not VS would work in your situation probably has to do with the compiler,linker,etc that you are using to generate the .exe.

    I don't know how interested you are (meaning how much work you want to put into this), but since the specs are public information, an effort to update the appropriate Perl module would in theory succeed. I would be willing to assist.

Re^2: pp and setting Windows LegalCopyright in executable header
by james28909 (Deacon) on Dec 07, 2016 at 17:03 UTC
    I am not sure if you are aware, and I am def not up to par on PE formatting, but I do think there is some form of checksum and by modifying just one byte of the exectuable will can render it useless.
Re^2: pp and setting Windows LegalCopyright in executable header
by stevieb (Canon) on Dec 07, 2016 at 15:13 UTC

    I just attempted to modify this information in a pp'd binary with Visual Studio 2013 by opening the exe and attempting to edit the VERSION tag information. It works when you check properties of the file, but the file becomes corrupted and no longer Does The Right Thing.

      That is the behaviour I have seen with all the tools for changing the exe header I have tried. The properties change, but the executable becomes corrupted with messages that look like:

      format error: bad signature: 0x00004000 at offset 5069472 in file <my-file>

      Oddly the executable appears to work, but these messages are a problem and may indicate a larger underlying issue.

        You could always hardcode the licensing/copyright etc within the Perl code itself, and display it with a flag:

        perlscript.exe --version

        Possible output:

        (c) 2016 Company, Inc. License: Blah Version: 9999999999999999999999999999999.991/2

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1177384]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (2)
As of 2024-04-24 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found