ExSetLicenseTamperState

VOID __stdcall ExSetLicenseTamperState(_LICENSING_TAMPER_STATE LicensingTamperState){
  char v2; 
  _EX_PUSH_LOCK *ExpLicenseState; 
  _ETHREAD *CurrentThread; 
  _KSPIN_LOCK *v5; 
  struct _EXP_LICENSE_STATE *v6; 
  __int128 v7[3]; 
  int v8; 

  v8 = 0;
  v2 = 1;
  ExpLicenseState = (_EX_PUSH_LOCK *)PsGetCurrentServerSiloGlobals(*(_KSPIN_LOCK **)&LicensingTamperState)->ExpLicenseState;
  if( LicensingTamperState && LicensingTamperState != LicensingTamperModuleAuthentication )
  {
    CurrentThread = (_ETHREAD *)KeGetCurrentThread();
    --CurrentThread->Tcb.KernelApcDisable;
    ExAcquirePushLockExclusiveEx(ExpLicenseState + 5855, 0i64);
    ExpGetLicenseTamperState((__int64)ExpLicenseState, &v8);
    if( v8 )
      v2 = 0;
    ExpSetLicenseTamperState((INT64)ExpLicenseState, (unsigned int)LicensingTamperState);
    memset(v7, 0, sizeof(v7));
    ExpSetKernelDataProtection(ExpLicenseState, (__int64)v7, 32, 0);
    if( (_InterlockedExchangeAdd64(&ExpLicenseState[5855]._bf_0, 0xFFFFFFFFFFFFFFFFui64) & 6) == 2 )
      ExfTryToWakePushLock(ExpLicenseState + 5855);
    KeAbPostRelease(&ExpLicenseState[5855]);
    KeLeaveCriticalRegionThread(KeGetCurrentThread());
    if( v2 )
    {
      v6 = PsGetCurrentServerSiloGlobals(v5)->ExpLicenseState;
      if( qword_140D2C518 )
        qword_140D2C518(v6);
    }
  }
}

Referenced by:

No references.