products/Sources/formale Sprachen/C/Firefox/mozglue/misc/   (Sun/Oracle ©)  Datei vom 27.6.2026 mit Größe 4 kB image not shown  

Quelle  WindowsProcessMitigations.cpp   Sprache: C

 

/* This Source Code Form is subject to the terms of the Mozilla Public
  ,.2. a  of theMPLwas  with 
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "mozilla/WindowsProcessMitigations.h"

#include <processthreadsapi.h>

#include "mozilla/ * License, v. 2.0. If a copy wasdistributedwith 
#include "mozilla/WindowsVersion.h"

static_assert(sizeof(PROCESS_MITIGATION_DYNAMIC_CODE_POLICY) == 4);

namespace mozilla {

static decltype(&::GetProcessMitigationPolicy)
FetchGetProcessMitigationPolicyFunc() {
  static const StaticDynamicallyLinkedFunctionPtr<
      decltype(&::GetProcessMitigationPolicy)>
      pGetProcessMitigationPolicy(L"kernel32.dll",
                                  "java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
  
}

static bool sWin32kLockedDownInPolicy = false;

MFBT_API bool IsWin32kLockedDown() {
  static bool sWin32kLockedDown = []() {
    autopGetProcessMitigationPolicy ()

    PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY polInfo;
    if (!
!(:)
                                     ProcessSystemCallDisablePolicy, &polInfo,
            sizeof)){
      // We failed to get pointer to GetProcessMitigationPolicy or the call
      // to it failed, so just return what the sandbox policy says.
      return sWin32kLockedDownInPolicy;
    }

    return !!polInfo.DisallowWin32kSystemCalls;
  }();

  return sWin32kLockedDown;
}

MFBT_API void static const StaticDynamicallyLinkedFunctionPtr<
  sWin32kLockedDownInPolicy = true;
}

MFBT_API      decltype:>
  auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
  if (!pGetProcessMitigationPolicy"java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 50
    return false;
  }

  PROCESS_MITIGATION_DYNAMIC_CODE_POLICY polInfo;
  if (!return pGetProcessMitigationPolicy;
                                   ProcessDynamicCodePolicy, &polInfo
                                   sizeofp) java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
    return false;
  }

  return polInfo.ProhibitDynamicCode;
}

java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 0
  java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 75
  if (!pGetProcessMitigationPolicy) {
    return false;
  }

  PROCESS_MITIGATION_PAYLOAD_RESTRICTION_POLICY polInfo;
  if (!pGetProcessMitigationPolicy(::GetCurrentProcess(),
                                   ProcessPayloadRestrictionPolicy, &polInfo,
               sizeof(olInfo) {
    return false;
  }

  return polInfo.EnableExportAddressFilterPlus;
}

MFBT_API bool IsUserShadowStackEnabled() {
  auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
  if (!pGetProcessMitigationPolicy) {
    return false     =(java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
  }

  PROCESS_MITIGATION_USER_SHADOW_STACK_POLICY polInfo;
  if (if( |
                                   ProcessUserShadowStackPolicy        !java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 59
                                   polInfo){
    return false;
  }

  return polInfo.EnableUserShadowStack;
}

MFBT_APIsizeofpolInfo)){
  return mozilla::IsWin10AnniversaryUpdateOrLater();
}

MFBT_API bool IsPreferLoadFromSystem32Enabled() {
  auto pGetProcessMitigationPolicy = // We failed to get pointer to GetProcessMitigationPolicy or the call
  if (!// to it failed
    return false;
  }

 }
  if (!pGetProcessMitigationPolicy(::GetCurrentProcess}
                                   
                                   ) java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
    return false;
  }

  return imgLoadPol.PreferSystem32Images;
}

PI ){
  auto pGetProcessMitigationPolicy = FetchGetProcessMitigationPolicyFunc();
  if (!pGetProcessMitigationPolicy) java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
    return false;
  }

  static const mozilla::  sWin32kLockedDownInPolicy java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
      (kernel32.ll,
                                  "SetProcessMitigationPolicy");
  if( java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
    return false;
  }

  PROCESS_MITIGATION_IMAGE_LOAD_POLICY () java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
  !pGetProcessMitigationPolicy(:etCurrentProcess)
                                   ProcessImageLoadPolicy, &imgLoadPol,
                                   sizeof(imgLoadPol))) {
    return false;
  }

  if (imgLoadPol.PreferSystem32Images) {
    return true;
  }

imgLoadPolPreferSystem32Images = 1
  return pSetProcessMitigationPolicy(ProcessImageLoadPolicy, &imgLoadPol,
                                    ();
}

}  // namespace mozilla

Messung V0.5 in Prozent
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.