Exemplo n.º 1
0
print "Unique system id: " + mProductDetails.fsGetSystemId()

print "Product version information:"
oMainProductDetails = mProductDetails.foGetProductDetailsForMainModule()
aoProductDetails = mProductDetails.faoGetProductDetailsForAllLoadedModules()
# Change order to put main product at the front:
aoProductDetails.remove(oMainProductDetails)
aoProductDetails.insert(0, oMainProductDetails)
for oProductDetails in aoProductDetails:
    print "+ \"%s\" version \"%s\" by \"%s\" installed in \"%s\"." % \
        (oProductDetails.sProductName, oProductDetails.oProductVersion, oProductDetails.sProductAuthor, oProductDetails.sInstallationFolderPath)
print

print "Checking licenses for loaded software products:"
oLicenseCollection = mProductDetails.foGetLicenseCollectionForAllLoadedProducts(
)
(asErrors, asWarnings) = oLicenseCollection.ftasGetLicenseErrorsAndWarnings()
if asErrors:
    print "Software license error%s:" % (len(asErrors) > 1 and "s" or "")
    for sError in asErrors:
        print "- " + sError
    print

if asWarnings:
    print "Software license warning%s:" % (len(asWarnings) > 1 and "s" or "")
    for sWarning in asWarnings:
        print "* " + sWarning
    print

print "Software license information in registry:"
aoLicenses = mProductDetails.faoGetLicensesFromRegistry()
Exemplo n.º 2
0
  def fStart(oCdbWrapper):
    global guSymbolOptions;
    oLicenseCollection = mProductDetails.foGetLicenseCollectionForAllLoadedProducts();
    (asLicenseErrors, asLicenseWarnings) = oLicenseCollection.ftasGetLicenseErrorsAndWarnings();
    if asLicenseErrors:
      if not oCdbWrapper.fbFireEvent("License errors", asLicenseErrors):
        print "You do not have a valid, active license for cBugId:\r\n%s" % "\r\n".join(asLicenseErrors);
        os._exit(5);
      return;
    if asLicenseWarnings:
      oCdbWrapper.fbFireEvent("License warnings", asLicenseWarnings);
    # Create a thread that interacts with the debugger to debug the application
    oCdbWrapper.oCdbStdInOutHelperThread = cHelperThread(oCdbWrapper, "cdb.exe stdin/out thread", oCdbWrapper.fCdbStdInOutHelperThread, bVital = True);
    # Create a thread that reads stderr output and shows it in the console
    oCdbWrapper.oCdbStdErrHelperThread = cHelperThread(oCdbWrapper, "cdb.exe stderr thread", oCdbWrapper.fCdbStdErrHelperThread, bVital = True);
    # Create a thread that waits for the debugger to terminate and cleans up after it.
    oCdbWrapper.oCleanupHelperThread = cHelperThread(oCdbWrapper, "cleanup thread", oCdbWrapper.fCleanupHelperThread, bVital = True);
    # Create a thread that waits for a certain amount of time while cdb is running and then interrupts it.
    oCdbWrapper.oInterruptOnTimeoutHelperThread = cHelperThread(oCdbWrapper, "cdb.exe interrupt on timeout thread", oCdbWrapper.fCdbInterruptOnTimeoutHelperThread);
    # We first start a utility process that we can use to trigger breakpoints in, so we can distinguish them from
    # breakpoints triggered in the target application.
    oCdbWrapper.uUtilityProcessId = None;
    if oCdbWrapper.sApplicationBinaryPath is not None:
      # If a process must be started, add it to the command line.
      assert not oCdbWrapper.auApplicationProcessIds, \
          "Cannot start a process and attach to processes at the same time";
    elif oCdbWrapper.oUWPApplication:
      assert len(oCdbWrapper.asApplicationArguments) <= 1, \
          "You cannot specify multiple arguments for a UWP application.";
    else:
      assert oCdbWrapper.auApplicationProcessIds, \
          "Must start a process or attach to one";
    # Get the command line arguments for cdbe.exe
    # Construct the cdb symbol path if one is needed and add it as an argument.
    sSymbolsPath = ";".join(
      oCdbWrapper.asLocalSymbolPaths +
      ["cache*%s" % x for x in oCdbWrapper.asSymbolCachePaths] +
      ["srv*%s" % x for x in oCdbWrapper.asSymbolServerURLs]
    );
    asArguments = [
      # Debug any child processes spawned by the main processes as well.
      "-o", 
      # Set symbol loading options (See above for details)
      "-sflags", "0x%08X" % guSymbolOptions, 
#      "-sxe", "ld:verifier", # Breakpoint when verifier is loaded, so we can set a breakpoint on VERIFIER STOPs.
    ] + (dxConfig["bEnableSourceCodeSupport"] and [
      "-lines",
    ] or []) + (sSymbolsPath and [
      "-y", sSymbolsPath,
    ] or []) + [
      os.getenv("ComSpec"), "/K", "ECHO OFF", 
    ];
    oCdbWrapper.oCdbConsoleProcess = cConsoleProcess.foCreateForBinaryPathAndArguments(
      sBinaryPath = os.path.join(oCdbWrapper.sDebuggingToolsPath, "cdb.exe"),
      asArguments = asArguments,
    );
    oCdbWrapper.oCdbStdInOutHelperThread.fStart();
    oCdbWrapper.oCdbStdErrHelperThread.fStart();
    oCdbWrapper.oCleanupHelperThread.fStart();
    # If we need to start a binary for this application, do so:
    if oCdbWrapper.sApplicationBinaryPath:
      oMainConsoleProcess = oCdbWrapper.foStartApplicationProcess(
        oCdbWrapper.sApplicationBinaryPath,
        oCdbWrapper.asApplicationArguments
      );
      if oMainConsoleProcess is None:
        oCdbWrapper.fStop();
        return;
      oCdbWrapper.auMainProcessIds.append(oMainConsoleProcess.uId);
    # If we need to attach to existing application processes, do so:
    for uProcessId in oCdbWrapper.auApplicationProcessIds:
      # We assume all application processes have been suspended. This makes sense because otherwise they might crash
      # before BugId has a chance to attach.
      oCdbWrapper.fAttachToProcessForId(uProcessId, bMustBeResumed = True);
Exemplo n.º 3
0
def ftsReportLicenseHeaderAndFooterHTML(oProductDetails):
  oLicenseCollection = mProductDetails.foGetLicenseCollectionForAllLoadedProducts();
  oLicense = oLicenseCollection.foGetLicenseForProductDetails(oProductDetails);
  bLicensedForCommercialUse = oLicense and oLicense.sUsageTypeDescription == "commercial use";
  sLicenseHeaderHTML = " ".join([
    oLicense and (
      "Licensed to %s for %s." % (oLicense.sLicenseeName, oLicense.sUsageTypeDescription)
    ) or "",
    not bLicensedForCommercialUse and (
      "You may not use this version of " + oProductDetails.sProductName + " for commercial purposes. Please contact "
      "the author if you wish to use " + oProductDetails.sProductName + " commercially. Contact and licensing "
      "information can be found at the bottom of this report."
    ) or "",
  ]);
  if bLicensedForCommercialUse:
    sLicenseFooterHTML = "This copy of BugId is licensed for commercial use by %s." % oLicense.sLicenseeName;
  else:
    sLicenseFooterHTML = (
      "<a "
        "rel=\"license\" "
        "href=\"http://creativecommons.org/licenses/by-nc/4.0/\""
      ">"
        "<img "
          "alt=\"Creative Commons License\" "
          "style=\"vertical-align: middle; float: left;\" "
          "original-src=\"https://i.creativecommons.org/l/by-nc/4.0/88x31.png\" "
          "src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAYAAABjyArgAAAHFUlEQVRoge2aTWsbSRrH+zysha5BAxGEXa"
              "xDgjzDzGWXpMH5AJpTQiCDLjvMbcQ4Y9asdtMblAzZDRihMGQWEg/MbeVEfrcly2rZrVa3+r0l2Vcd9AGEP8F/D+2uqW5gaWWn67+1VP/5"
              "6mnmgEQYBgGH/uFdIZxP2wXtrBb3EG+tIfi4T5KQgmHYhmCLKCqiJA1CTW9BtVQoJkqNEtzuqlCNRUoeg2yJqGqiKjIAg7FMnihhOLhPvK"
              "lPHaLO9gubGFzbwPru2tY287h3dZbvN1cxdvNVaxuZJFd/9+V6TRkArfA53FwVES5wkOQjlBVRNR0GaqpwLB1WA0TdtNC/biOxonT68d12"
              "E0bVsOEYetQTRU1XUZVESFIRyiLPA6Oiijw3ZBz2+8I5NWN7FWFzHjhimVUZAGSKkE1HLB200LqaQrzd+cxE5jpWgozgRnM351H6lkKdtO"
              "CUTegmgpkTUKlVsGhWMbB0YEH8sbeOtZ2cg7kzbcDvXgpuYRIJNJ170gkgqXk0sQwLsI+AZwv7XngypoEzVJhNUykM2mEQqGhdScUCiH9M"
              "g2rYUKzNNR0GSKBXCRysZXfxMauA/k8L868ymA2MkvssyyLRCKBRCIBlmXJ97ORWWReZUaGcJH2CeDi4T7KFZ6Cq8FuWoh9FfPACwaDiMf"
              "j4DgOPM+D53lwHId4PI5gMOj5beyrGCqSAN12IFdqFZRF/kyT97Czv+2Vih5evPLrGwQCAcdeLIZWqwV/a7VaiMWccQYCgZEgXLR9Argkl"
              "CBIR5BUx3P9cIPBIDiOQ6fT6RoA3VZWVjygZyOzqEgCNEuDrEkQpCPwQgn75QL2DnYdqejhxe4AXc+Kx+Oe+7j2/fd27zksgH7208vLeHD"
              "v/sT2CeBDsYyqIkI1FFgN0wM3Go32nNl+rdPpIBqNejzZaphQTQVVRaSkgvLinTXktt55ZGIpuUQ86+T4eCBgAMTThtFM1/5nc3P476ufP"
              "XCvXbuGmT/MYHHhEdrt9lj2PYAFWYCsyTBsHelM2gN3kNcOAzn9Mg2jbjhSIQvgK44X7xZ3sFVwtNiVCRewG3BGmdxWq0UC06CHd+3P/vF"
              "PuHE9jDt//gu+/es3YBgGHMfhx2c/gmEYrGazY9n3AK4qIlRTgd20SEALBoMwTXNkuDRkVy5CoRDspgXVVIkXFw8dL6YzClom3IDjb/F4n"
              "Eycf2kDIIFpmIdnWRY/fL+Av/2wiBvXw6S7nutfOaPY9wCWNQm6rSP1NEUGz3Hc2HDd5uoWwzBIPUvBsHWixaWztI2WCT/gRCLRZdOftfh"
              "bIpEYGjBtX5YkLC488theXHjUBXlY+x7ANb0Gs2Fi/u488V5aGnieRywWA8uyYFnWA99/bXl52TMg14vn787DaphQ9Fq3TOQ3nWyC0uH3D"
              "dht7XYbiwuPMHfzFvHoB/fuo5DPjw9YNRx5cDcR9NLjeb5nvsuyLHK5XM9r9P+7S3omMAO7aUM1FYhnKdt+eR97B7vYKmySdO19SwTdTk9"
              "P8eb1awDAyfGxRzZcnR5LIjRTRf3YJgOnvdANVuFwGK1WCzzPIxwOY2VlhVxzM41cLkeuuY2WifpxHZpHh/c96RoN+Lwg1897xwlytP0H9"
              "+7jxvUw5m7ewtzNW0QmVrNZ/PPvSVwPfTpekNMsFY2TOhk4z/NdD9NLk4fRa3oFNE7q0CwNVaU6EDCdpg0LeJw0jbbfbreR+tcTkqall5d"
              "xeno6lv3fPeDs+mgbDVcbp7HRePHv/3RtNMaxP7JEdDodmKaJcDgMjuM8EuG/5rZxJSK7foW2yucFufMC2TBBzp15J8hZUI3hghwNgS7GR"
              "KNRxONxJBIJz2Zm3GLPRdrvStPcLXIwGOxa5v3StFwuR773XwOAcDjsSdNqVJpW4Punab0084MtV7obDXqb7M9nx2n9NhpHZxuNfOm3jUa"
              "/gs+H3AlgsdZ7qzxKHcDfJt0qXzacqQKmiz1vfnnt0aOpFHsyaRi2jpouQ5AFUrKkC+/+Ys9lw5kqYIZhkHycJOXKh18/9EAepejTarV6l"
              "ysNBU+ePukZFK94/+1D4vvvoJkqrDEK7p1OBxzHeQruX3z5BeymBc1SkXycvOwHvXzADMPgH4+T0CwNVtPyeLILepQjI7tpQbc0/PTzTxM"
              "Nkm70d/7fTGK/32f/fScGTCCbzqHnm19ej37omXEPPdWJ4fZ6YP/fEwLoO3nnTehEgBnGkQv62D6dSQ88tk+/TDvH9rYO1VCmJgu9PHgKD"
              "94X6LQm7lzADMPgs8/nkNvIQTUV6LYOk7x4YlMvntiwm5bnxZO1zRxu37k9FbiDPGmagOnJHHTfqQB2++07t/H8xXMUy0Xq1amzbqpQDQX"
              "FchHPXzyfKlj/Q1+0Bw8CfmGAP/YJOoBPLn0QV7cz/wfb6tgzbhMVpgAAAABJRU5ErkJggg==\""
        "/>"
      "</a>"
      "This copy of " + oProductDetails.sProductName + " is licensed under a "
      "<a "
        "rel=\"license\" "
        "href=\"http://creativecommons.org/licenses/by-nc/4.0/\""
      ">"
        "Creative Commons Attribution-NonCommercial 4.0 International License"
      "</a> "
      + (oLicense and "to %s" % oLicense.sLicenseeName or "during a trial period") + "."
      "<br/>"
      "Please contact the author if you wish to "
      + (oLicense and "use BugId commercially" or "continue to use BugId after the trial period") + "."
    );
  return (sLicenseHeaderHTML, sLicenseFooterHTML);