in reply to How can I integrate within the PDK perlapp the manifest assembly workaround for Vista UAC?

Just a guess, but from the error message (Cannot be run in DOS mode), it sounds like by inserting data into the binary, you are changing the offsets of the subsequent PE format sections, but failing to adjust the appropriate offsets within the PE header.

Hence, when NTLDR attempts to load the executable image by following the now mis-sized offsets, it fails to locate the appropriate sections, and so rejects it with a generic error message indicating that it does not recognise, or cannot make sense of the format of the file.

To correct this would require you to parse the header, figure out which section offsets come after the position where you are inserting your xml, and adjust them by the amount you insert. There is the additional complication that the offsets have to be aligned to certain boundaries. I'm not sure whether these would be 4-byte, 8-byte or conceivably even page-sized boundaries under Vista. Conceivably it could be processor size (32-bit -v- 60-bit dependant. You would need to find a document describing the latest (Vista compatible) definition of the PE executable format. I have previously found these to be available on-line, but depending where you get it, it may or may not be complete description.

Like I say, just a semi-informed guess.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re: How can I integrate within the PDK perlapp the manifest assembly workaround for Vista UAC?

Replies are listed 'Best First'.
Re^2: How can I integrate within the PDK perlapp the manifest assembly workaround for Vista UAC?
by ddn123456 (Pilgrim) on Apr 03, 2007 at 10:03 UTC
    Hi BrowserUK,

    Many thanks for the info. I'm googling on it now.

    Yesterday I fumbled with the number of whitespaces behind the xml (reducing the whitespaces for the number of chars added).

    The mt.exe does all the math for c++ files however for the pdk compiler mt.exe doesn't seem to be fully compliant.

    Now in parallel on a colleague's hunch I'm busy applying the "mt.exe -manifest ExeName.exe.manifest -outputresource:ExeName.exe" line to all perl and pdk executables and dlls.

    The idea is that possibly some of these pe's are compiled into the perlapp.exe. However I don't put much faith in this idea.

    I'll keep you posted.

    Many thanks so far for the great pe info!

    With kind regards.

    DDN
      in parallel on a colleague's hunch I'm busy applying the "mt.exe -manifest ExeName.exe.manifest -outputresource:ExeName.exe" line to all perl and pdk executables and dlls.

      Actually, I think that could work.

      Baring in mind I've never use perlapp and I've only the vaguest notion of what mt.exe actually does.

      It seems likely that the manifest checking would not work when you run the distributable .exe resulting from perlapp processing, as (I assume) that is a standalone, all-in-one distributable. It's only when all the bits and pieces of that file are unpacked and decompressed, one of which will be perl.exe and the latter gets run, that the manifest will be checked. Is the right version of perl5x.dll available? Ecetera.

      So, theoretically thinking, if you apply mt.exe to everything in your \perl\bin directory, along with all the dlls that are in perl\lib\auto\*\*.dll and perl\site\lib\auto\*\*.dll; and if running the script passes the validation prior to being packaged, it should also pass validation after it's be packaged and unpacked.

      Again, that purely a thoughware suggestion.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
        Hi BrowserUk, Many thanks for the info. Unfortunately it only works partially. Details below. With kind regards.