Browse Source

opt:新增license

wangzhe 11 tháng trước cách đây
mục cha
commit
7d06229ac2
44 tập tin đã thay đổi với 768 bổ sung0 xóa
  1. BIN
      Licensecc/bin/GJDM/lccinspector.exe
  2. BIN
      Licensecc/bin/lccgen.exe
  3. 4 0
      Licensecc/cmake/lccgen/lccgen-config.cmake
  4. 18 0
      Licensecc/cmake/lccgen/license_generator-debug.cmake
  5. 97 0
      Licensecc/cmake/lccgen/license_generator.cmake
  6. 65 0
      Licensecc/cmake/licensecc/licensecc-config-version.cmake
  7. 49 0
      Licensecc/cmake/licensecc/licensecc-config.cmake
  8. 140 0
      Licensecc/include/licensecc/GJDM/licensecc_properties.h
  9. 10 0
      Licensecc/include/licensecc/GJDM/public_key.h
  10. 176 0
      Licensecc/include/licensecc/datatypes.h
  11. 81 0
      Licensecc/include/licensecc/licensecc.h
  12. 19 0
      Licensecc/licensecc/GJDM/cmake/licensecc-debug.cmake
  13. 109 0
      Licensecc/licensecc/GJDM/cmake/licensecc.cmake
  14. BIN
      Licensecc/licensecc/GJDM/licensecc_static.lib
  15. BIN
      Python/Lib/__pycache__/_weakrefset.cpython-312.pyc
  16. BIN
      Python/Lib/__pycache__/contextlib.cpython-312.pyc
  17. BIN
      Python/Lib/__pycache__/copyreg.cpython-312.pyc
  18. BIN
      Python/Lib/__pycache__/enum.cpython-312.pyc
  19. BIN
      Python/Lib/__pycache__/functools.cpython-312.pyc
  20. BIN
      Python/Lib/__pycache__/keyword.cpython-312.pyc
  21. BIN
      Python/Lib/__pycache__/operator.cpython-312.pyc
  22. BIN
      Python/Lib/__pycache__/pkgutil.cpython-312.pyc
  23. BIN
      Python/Lib/__pycache__/reprlib.cpython-312.pyc
  24. BIN
      Python/Lib/__pycache__/types.cpython-312.pyc
  25. BIN
      Python/Lib/__pycache__/typing.cpython-312.pyc
  26. BIN
      Python/Lib/__pycache__/warnings.cpython-312.pyc
  27. BIN
      Python/Lib/__pycache__/weakref.cpython-312.pyc
  28. BIN
      Python/Lib/collections/__pycache__/__init__.cpython-312.pyc
  29. BIN
      Python/Lib/collections/__pycache__/abc.cpython-312.pyc
  30. BIN
      Python/Lib/encodings/__pycache__/__init__.cpython-312.pyc
  31. BIN
      Python/Lib/encodings/__pycache__/aliases.cpython-312.pyc
  32. BIN
      Python/Lib/encodings/__pycache__/gbk.cpython-312.pyc
  33. BIN
      Python/Lib/encodings/__pycache__/utf_8.cpython-312.pyc
  34. BIN
      Python/Lib/importlib/__pycache__/__init__.cpython-312.pyc
  35. BIN
      Python/Lib/importlib/__pycache__/_abc.cpython-312.pyc
  36. BIN
      Python/Lib/json/__pycache__/__init__.cpython-312.pyc
  37. BIN
      Python/Lib/json/__pycache__/decoder.cpython-312.pyc
  38. BIN
      Python/Lib/json/__pycache__/encoder.cpython-312.pyc
  39. BIN
      Python/Lib/json/__pycache__/scanner.cpython-312.pyc
  40. BIN
      Python/Lib/re/__pycache__/__init__.cpython-312.pyc
  41. BIN
      Python/Lib/re/__pycache__/_casefix.cpython-312.pyc
  42. BIN
      Python/Lib/re/__pycache__/_compiler.cpython-312.pyc
  43. BIN
      Python/Lib/re/__pycache__/_constants.cpython-312.pyc
  44. BIN
      Python/Lib/re/__pycache__/_parser.cpython-312.pyc

BIN
Licensecc/bin/GJDM/lccinspector.exe


BIN
Licensecc/bin/lccgen.exe


+ 4 - 0
Licensecc/cmake/lccgen/lccgen-config.cmake

@@ -0,0 +1,4 @@
+# lcc-config.cmake - package configuration file
+
+get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include(${SELF_DIR}/license_generator.cmake)

+ 18 - 0
Licensecc/cmake/lccgen/license_generator-debug.cmake

@@ -0,0 +1,18 @@
+#----------------------------------------------------------------
+# Generated CMake target import file for configuration "Debug".
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "license_generator::lccgen" for configuration "Debug"
+set_property(TARGET license_generator::lccgen APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+set_target_properties(license_generator::lccgen PROPERTIES
+  IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/bin/lccgen.exe"
+  )
+
+list(APPEND _cmake_import_check_targets license_generator::lccgen )
+list(APPEND _cmake_import_check_files_for_license_generator::lccgen "${_IMPORT_PREFIX}/bin/lccgen.exe" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)

+ 97 - 0
Licensecc/cmake/lccgen/license_generator.cmake

@@ -0,0 +1,97 @@
+# Generated by CMake
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
+   message(FATAL_ERROR "CMake >= 2.8.0 required")
+endif()
+if(CMAKE_VERSION VERSION_LESS "2.8.3")
+   message(FATAL_ERROR "CMake >= 2.8.3 required")
+endif()
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8.3...3.25)
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_cmake_targets_defined "")
+set(_cmake_targets_not_defined "")
+set(_cmake_expected_targets "")
+foreach(_cmake_expected_target IN ITEMS license_generator::lccgen)
+  list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
+  if(TARGET "${_cmake_expected_target}")
+    list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
+  else()
+    list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
+  endif()
+endforeach()
+unset(_cmake_expected_target)
+if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
+  unset(_cmake_targets_defined)
+  unset(_cmake_targets_not_defined)
+  unset(_cmake_expected_targets)
+  unset(CMAKE_IMPORT_FILE_VERSION)
+  cmake_policy(POP)
+  return()
+endif()
+if(NOT _cmake_targets_defined STREQUAL "")
+  string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
+  string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
+  message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
+endif()
+unset(_cmake_targets_defined)
+unset(_cmake_targets_not_defined)
+unset(_cmake_expected_targets)
+
+
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+if(_IMPORT_PREFIX STREQUAL "/")
+  set(_IMPORT_PREFIX "")
+endif()
+
+# Create imported target license_generator::lccgen
+add_executable(license_generator::lccgen IMPORTED)
+
+# Load information for each installed configuration.
+file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/license_generator-*.cmake")
+foreach(_cmake_config_file IN LISTS _cmake_config_files)
+  include("${_cmake_config_file}")
+endforeach()
+unset(_cmake_config_file)
+unset(_cmake_config_files)
+
+# Cleanup temporary variables.
+set(_IMPORT_PREFIX)
+
+# Loop over all imported files and verify that they actually exist
+foreach(_cmake_target IN LISTS _cmake_import_check_targets)
+  foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
+    if(NOT EXISTS "${_cmake_file}")
+      message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
+   \"${_cmake_file}\"
+but this file does not exist.  Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+   \"${CMAKE_CURRENT_LIST_FILE}\"
+but not all the files it references.
+")
+    endif()
+  endforeach()
+  unset(_cmake_file)
+  unset("_cmake_import_check_files_for_${_cmake_target}")
+endforeach()
+unset(_cmake_target)
+unset(_cmake_import_check_targets)
+
+# This file does not depend on other imported targets which have
+# been exported from the same project but in a separate export set.
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
+cmake_policy(POP)

+ 65 - 0
Licensecc/cmake/licensecc/licensecc-config-version.cmake

@@ -0,0 +1,65 @@
+# This is a basic version file for the Config-mode of find_package().
+# It is used by write_basic_package_version_file() as input file for configure_file()
+# to create a version-file which can be installed along a config.cmake file.
+#
+# The created file sets PACKAGE_VERSION_EXACT if the current version string and
+# the requested version string are exactly the same and it sets
+# PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version,
+# but only if the requested major version is the same as the current one.
+# The variable CVF_VERSION must be set before calling configure_file().
+
+
+set(PACKAGE_VERSION "2.0.0")
+
+if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
+  set(PACKAGE_VERSION_COMPATIBLE FALSE)
+else()
+
+  if("2.0.0" MATCHES "^([0-9]+)\\.")
+    set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}")
+    if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0)
+      string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}")
+    endif()
+  else()
+    set(CVF_VERSION_MAJOR "2.0.0")
+  endif()
+
+  if(PACKAGE_FIND_VERSION_RANGE)
+    # both endpoints of the range must have the expected major version
+    math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1")
+    if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+        OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR)
+          OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT)))
+      set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR
+        AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX)
+        OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX)))
+      set(PACKAGE_VERSION_COMPATIBLE TRUE)
+    else()
+      set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    endif()
+  else()
+    if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR)
+      set(PACKAGE_VERSION_COMPATIBLE TRUE)
+    else()
+      set(PACKAGE_VERSION_COMPATIBLE FALSE)
+    endif()
+
+    if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
+      set(PACKAGE_VERSION_EXACT TRUE)
+    endif()
+  endif()
+endif()
+
+
+# if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
+if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
+  return()
+endif()
+
+# check that the installed version has the same 32/64bit-ness as the one which is currently searching:
+if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
+  math(EXPR installedBits "8 * 8")
+  set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
+  set(PACKAGE_VERSION_UNSUITABLE TRUE)
+endif()

+ 49 - 0
Licensecc/cmake/licensecc/licensecc-config.cmake

@@ -0,0 +1,49 @@
+# licensecc-config.cmake - package configuration file
+# SELF_DIR = /extlib/Licensecc/cmake/licensecc
+get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+#TODO windows?
+# LCC_PRJ_BASE = extlib/Licensecc/licensecc/
+set(LCC_PRJ_BASE "${SELF_DIR}/../../licensecc")
+set(LCC_FOUND false)
+
+if(licensecc_FIND_COMPONENTS)
+	foreach(component ${licensecc_FIND_COMPONENTS})
+		set(cmakefile "${LCC_PRJ_BASE}/${component}/cmake/licensecc.cmake")
+		if(EXISTS "${cmakefile}")
+			include("${cmakefile}")
+			set(${component}_FOUND true CACHE BOOL "Licensecc ${component} present")
+			set(LCC_FOUND true)
+		else(EXISTS "${cmakefile}")
+			set(${component}_FOUND false CACHE BOOL "Licensecc ${component} present")
+			message( WARNING "Component ${component} declared but not found." )
+		endif(EXISTS "${cmakefile}")
+		mark_as_advanced(${component}_FOUND)
+	endforeach(component)
+else(licensecc_FIND_COMPONENTS)
+	if(LCC_PROJECT_NAME)
+		if(EXISTS "${LCC_PRJ_BASE}/${LCC_PROJECT_NAME}/cmake/licensecc.cmake")
+			include("${LCC_PRJ_BASE}/${LCC_PROJECT_NAME}/cmake/licensecc.cmake")
+			set(${LCC_PROJECT_NAME}_FOUND true CACHE BOOL "Licensecc ${LCC_PROJECT_NAME} present")
+			set(LCC_FOUND true)
+		else()
+			message( WARNING "Variable LCC_PROJECT_NAME declared but project ${LCC_PROJECT_NAME} not found.")
+		endif()
+		mark_as_advanced(${LCC_PROJECT_NAME}_FOUND)
+	else(LCC_PROJECT_NAME)
+		if(PROJECT_NAME AND (EXISTS "${LCC_PRJ_BASE}/${PROJECT_NAME}/cmake/licensecc.cmake"))
+			include("${LCC_PRJ_BASE}/${PROJECT_NAME}/cmake/licensecc.cmake")
+			set(${PROJECT_NAME}_FOUND true CACHE BOOL "Licensecc ${PROJECT_NAME} present")
+		    mark_as_advanced(${PROJECT_NAME}_FOUND)
+		    set(LCC_FOUND true)
+		endif()
+	endif(LCC_PROJECT_NAME)
+endif(licensecc_FIND_COMPONENTS)
+
+if(LCC_FOUND)
+	get_property(COMPILE_DEF TARGET licensecc::licensecc_static PROPERTY INTERFACE_COMPILE_DEFINITIONS)
+	if("HAS_OPENSSL" IN_LIST COMPILE_DEF AND NOT OpenSSL_FOUND)
+		#message( VERBOSE "Trying to find openssl (required by the target)")
+	    SET ( OPENSSL_USE_STATIC_LIBS ON )
+	    find_package(OpenSSL REQUIRED COMPONENTS Crypto)
+	endif()
+endif(LCC_FOUND)

+ 140 - 0
Licensecc/include/licensecc/GJDM/licensecc_properties.h

@@ -0,0 +1,140 @@
+/** 
+ * \file
+ * This file contains all the properties that are customizable on on a per-project basis eg:
+ * 1) api parameter sizes
+ * 2)
+ *
+ * It is safe to place the values that your project need to customize here, since each project get its own copy of this
+ * file.
+ */
+
+/** 
+ * \addtogroup api
+ * @{
+ */
+ 
+#ifndef BUILD_PROPERTIES_H_
+#define BUILD_PROPERTIES_H_
+
+ 
+/**
+ * This file contains all the properties that are customizable on on a per-project basis eg:
+ * 1) api parameter sizes
+ * 2) 
+ *
+ * It is safe to place the values that your project need to customize here, since each project get its own copy of this
+ * file.
+ */
+
+#define LCC_PROJECT_NAME "GJDM"
+
+//License retrieval configuration
+#define FIND_LICENSE_NEAR_MODULE true
+#define FIND_LICENSE_WITH_ENV_VAR false
+
+/**
+ * License file name extension
+ */
+#define LCC_LICENSE_FILE_EXTENSION ".lic"
+#define LCC_LICENSE_LOCATION_ENV_VAR "LICENSE_LOCATION"
+#define LCC_LICENSE_DATA_ENV_VAR "LICENSE_DATA"
+
+// Api structure limits
+/**
+ * Maximum size of a license file or base64 data
+ */
+#define LCC_API_MAX_LICENSE_DATA_LENGTH 1024 * 4
+
+// define api structure sizes
+#define LCC_API_PC_IDENTIFIER_SIZE 19
+#define LCC_API_PROPRIETARY_DATA_SIZE 16
+#define LCC_API_AUDIT_EVENT_NUM 5
+#define LCC_API_AUDIT_EVENT_PARAM2 255
+#define LCC_API_VERSION_LENGTH 15
+#define LCC_API_FEATURE_NAME_SIZE 15
+#define LCC_API_EXPIRY_DATE_SIZE 10
+#define LCC_API_ERROR_BUFFER_SIZE 256
+
+/**
+This definition allows to specify a custom expression to verify the magic number passed in by the api.
+*/
+#define LCC_VERIFY_MAGIC (lic_info.m_magic == 0)
+
+/**
+ *
+ * Environment variable name that if defined will change the identification strategy used to generate the hardware
+ * identifier. If a client has an unstable pc-identifier use this variable to generate one. Valid values are integers
+ * defined in `LCC_IDENTIFICATION_STRATEGY` enum.
+ */
+#define LCC_IDENTIFICATION_STRATEGY_ENV_VAR "IDENTIFICATION_STRATEGY"
+
+/**
+ * \enum LCC_API_HW_IDENTIFICATION_STRATEGY
+ *
+ * This enum list all the possible pc identification strategy. It is to be used as a parameter of ::identify_pc
+ *
+ * ::STRATEGY_DEFAULT Should be used in most cases.
+ */
+enum LCC_API_HW_IDENTIFICATION_STRATEGY {
+	/**
+	 * \brief Default strategy.
+	 * 
+	 * This strategy first checks the content of the environment variable `IDENTIFICATION_STRATEGY`. If the variable is defined it will use the 
+	 * strategy specified in there, if not defined it will try to detect which virtual environment the software is running in.
+	 *  - If no virtual environment is detected it will try the strategies defined in ::LCC_BARE_TO_METAL_STRATEGIES
+	 *  - If it detects the software is running in a virtual machine it will use ::LCC_VM_STRATEGIES
+	 *  - If it detects the software is running in a docker or in an LXC it will use ::LCC_DOCKER_STRATEGIES or
+	 * ::LCC_DOCKER_STRATEGIES
+	 *  - If it detects the software is running in a virtual machine in the cloud it will use ::LCC_CLOUD_STRATEGIES
+	 */
+	STRATEGY_DEFAULT = -1,
+	/**
+	 * \brief Uses mac address to generate hardware id.
+	 * 
+	 * This strategy use the mac address of one of the network adapters to generate the hardware identifier.
+	 * Network adapters are scored using their names, trying to avoid vpn adapters and virtual devices.
+	 * Mac address should be unique in the subnetwork, so this strategy poses some limitation on the number of licenses
+	 * that can be in use in the same subnet.
+	 */	
+	STRATEGY_ETHERNET = 0,
+	STRATEGY_IP_ADDRESS = 1,
+	STRATEGY_DISK = 2,
+	/**
+	* Not yet implemented
+	*/
+	STRATEGY_CPU_SIZE = 3,
+	/**
+	* Not yet implemented
+	*/
+	STRATEGY_HOST_NAME = 4,
+	STRATEGY_NONE = -2
+};
+
+/**
+ * @addtogroup strategies
+ * @{
+ */
+/**
+ * List the strategies used when no virtual envrionment is detected
+ */
+#define LCC_BARE_TO_METAL_STRATEGIES { STRATEGY_DISK, STRATEGY_HOST_NAME, STRATEGY_NONE }
+/**
+ * List the strategies used when the software is executing in a virtual machine
+ */
+#define LCC_VM_STRATEGIES { STRATEGY_ETHERNET, STRATEGY_NONE }
+#define LCC_LXC_STRATEGIES { STRATEGY_ETHERNET, STRATEGY_NONE }
+#define LCC_DOCKER_STRATEGIES { STRATEGY_NONE }
+/**
+ * List the strategies used when it's detected an execution in the cloud
+ */
+#define LCC_CLOUD_STRATEGIES { STRATEGY_NONE }
+
+/**
+ * @}
+ */
+
+
+#endif
+/**
+ * @}
+ */

+ 10 - 0
Licensecc/include/licensecc/GJDM/public_key.h

@@ -0,0 +1,10 @@
+#ifndef PUBLIC_KEY_H_
+#define PUBLIC_KEY_H_
+
+#define PRODUCT_NAME GJDM
+
+#define PUBLIC_KEY {\
+48,129,137,2,129,129,0,192,212,155,143,137,197,82,40,59,15,17,180,124,181,11,127,29,32,160,235,121,116,164,21,179,91,64,106,39,153,58,172,219,229,107,88,145,78,134,236,74,176,21,237,191,116,198,205,162,157,97,56,25,81,139,77,211,221,112,50,48,205,116,230,61,208,134,107,77,216,2,9,203,201,218,188,179,46,93,251,149,86,131,74,65,158,47,65,142,7,215,56,185,115,66,42,174,9,59,15,142,135,241,94,245,143,58,201,39,41,209,87,132,215,227,20,44,176,185,247,125,130,177,62,152,191,169,209,2,3,1,0,1\
+}
+#define PUBLIC_KEY_LEN 140
+#endif

+ 176 - 0
Licensecc/include/licensecc/datatypes.h

@@ -0,0 +1,176 @@
+#ifndef DATATYPES_H_
+#define DATATYPES_H_
+/** \addtogroup apistruct
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// definition of size_t
+#include <stdlib.h>
+#include <stdint.h>
+#ifndef _MSC_VER
+#include <stdbool.h>
+#endif
+
+#ifdef __unix__
+#define DllExport
+#ifndef MAX_PATH
+#define MAX_PATH 1024
+#endif
+#else
+#include <windows.h>
+#define DllExport __declspec(dllexport)
+#endif
+
+#include <licensecc_properties.h>
+
+typedef enum {
+	LICENSE_OK = 0,  // OK
+	LICENSE_FILE_NOT_FOUND = 1,  // license file not found
+	LICENSE_SERVER_NOT_FOUND = 2,  // license server can't be contacted
+	ENVIRONMENT_VARIABLE_NOT_DEFINED = 3,  // environment variable not defined
+	FILE_FORMAT_NOT_RECOGNIZED = 4,  // license file has invalid format (not .ini file)
+	LICENSE_MALFORMED = 5,  // some mandatory field are missing, or data can't be fully read.
+	PRODUCT_NOT_LICENSED = 6,  // this product was not licensed
+	PRODUCT_EXPIRED = 7,    //!< PRODUCT_EXPIRED
+	LICENSE_CORRUPTED = 8,  // License signature didn't match with current license
+	IDENTIFIERS_MISMATCH = 9,  // Calculated identifier and the one provided in license didn't match
+
+	LICENSE_SPECIFIED = 100,  // license location was specified
+	LICENSE_FOUND = 101,  // License file has been found or license data has been located
+	PRODUCT_FOUND = 102,  // License has been loaded and the declared product has been found
+	SIGNATURE_VERIFIED = 103//!< SIGNATURE_VERIFIED
+} LCC_EVENT_TYPE;
+
+typedef enum {
+	LCC_LOCAL,
+	LCC_REMOTE  // remote licenses are not supported now.
+} LCC_LICENSE_TYPE;
+
+typedef enum { SVRT_INFO, SVRT_WARN, SVRT_ERROR } LCC_SEVERITY;
+
+typedef struct {
+	LCC_SEVERITY severity;
+	LCC_EVENT_TYPE event_type;
+	/**
+	 * License file name or location where the license is stored.
+	 */
+	char license_reference[MAX_PATH];
+	char param2[LCC_API_AUDIT_EVENT_PARAM2 + 1];
+} AuditEvent;
+
+typedef enum {
+	/**
+	 * A list of absolute path separated by ';' containing the eventual location
+	 * of the license files. Can be NULL.
+	 */
+	LICENSE_PATH,
+	/**
+	 * The license is provided as plain data
+	 */
+	LICENSE_PLAIN_DATA,
+	/**
+	 * The license is encoded
+	 */
+	LICENSE_ENCODED
+} LCC_LICENSE_DATA_TYPE;
+
+/**
+ * This structure contains informations on the raw license data. Software authors
+ * can specify the location of the license file or its full content.
+ *
+ * Can be NULL, in this case OpenLicenseManager will try to figure out the
+ * license file location on its own.
+ */
+typedef struct {
+	LCC_LICENSE_DATA_TYPE license_data_type;
+	char licenseData[LCC_API_MAX_LICENSE_DATA_LENGTH];
+} LicenseLocation;
+
+/**
+ * Informations about the software requesting the license verification (eg, software version, feature to verify).
+ */
+typedef struct {
+	/**
+	 *  software version in format xxxx[.xxxx.xxxx]
+	 *  NOT IMPLEMENTED pass '\0'
+	 */
+	char version[LCC_API_VERSION_LENGTH + 1];
+	/**
+	 * Name of the feature you want to verify. If empty ('\0') the 'default' feature will be verified.
+	 * (every project has a default feature that is equal to the project name).
+	 * Every feature has a separate section in the license file:
+	 * <pre>
+	 * [feature_xx]
+	 * sig=AAAA
+	 * [another_feature]
+	 * expiry-date=20201111
+	 * </pre>
+	 */
+	char feature_name[LCC_API_FEATURE_NAME_SIZE + 1];
+	/**
+	 * this number passed in by the application must correspond to the magic number used when compiling the library.
+	 * See cmake parameter -DLCC_PROJECT_MAGIC_NUM and licensecc_properties.h macro VERIFY_MAGIC
+	 */
+	unsigned int magic;
+} CallerInformations;
+
+typedef struct {
+	/**
+	 * Detailed reason of success/failure. Reasons for a failure can be
+	 * multiple (for instance, license expired and signature not verified).
+	 * Only the last AUDIT_EVENT_NUM are reported.
+	 */
+	AuditEvent status[LCC_API_AUDIT_EVENT_NUM];
+	/**
+	 * Eventual expiration date of the software,
+	 * can be '\0' if the software don't expire
+	 * */
+	char expiry_date[LCC_API_EXPIRY_DATE_SIZE + 1];
+	unsigned int days_left;
+	bool has_expiry;
+	bool linked_to_pc;
+	LCC_LICENSE_TYPE license_type;  // Local or Remote
+	/* A string of character inserted into the license understood
+	 * by the calling application.
+	 * '\0' if the application didn't specify one */
+	char proprietary_data[LCC_API_PROPRIETARY_DATA_SIZE + 1];
+	int license_version;  // license file version
+} LicenseInfo;
+
+typedef enum { BARE_TO_METAL, VMWARE, VIRTUALBOX, V_XEN, KVM, HV, PARALLELS, V_OTHER } LCC_API_VIRTUALIZATION_DETAIL;
+
+typedef enum {
+	PROV_UNKNOWN = 0,
+	ON_PREMISE = 1,
+	GOOGLE_CLOUD = 2,
+	AZURE_CLOUD = 3,
+	AWS = 4,
+	/**
+	 * "/sys/class/dmi/id/bios_vendor" SeaBIOS
+	 * "/sys/class/dmi/id/sys_vendor" Alibaba Cloud
+	 * modalias
+	 * "dmi:bvnSeaBIOS:bvrrel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org:bd04/01/2014:svnAlibabaCloud:pnAlibabaCloudECS:pvrpc-i440fx-2.1:cvnAlibabaCloud:ct1:cvrpc-i440fx-2.1:"
+	 */
+	ALI_CLOUD = 5
+} LCC_API_CLOUD_PROVIDER;
+
+typedef enum { NONE, CONTAINER, VM } LCC_API_VIRTUALIZATION_SUMMARY;
+
+typedef struct {
+	LCC_API_CLOUD_PROVIDER cloud_provider;
+	LCC_API_VIRTUALIZATION_SUMMARY virtualization;
+	LCC_API_VIRTUALIZATION_DETAIL virtualization_detail;
+} ExecutionEnvironmentInfo;
+
+#ifdef __cplusplus
+}
+#endif
+
+/**
+ * @}
+ */
+#endif

+ 81 - 0
Licensecc/include/licensecc/licensecc.h

@@ -0,0 +1,81 @@
+/** \addtogroup api
+ * @{
+ */
+#ifndef LICENSEPP_H_
+#define LICENSEPP_H_
+
+/*
+ * This include file is the public api di Licensecc
+ */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "datatypes.h"
+
+/**
+ * Method used to convert the LicenseInfo into a human readable
+ * representation.
+ */
+void print_error(char out_buffer[LCC_API_ERROR_BUFFER_SIZE], LicenseInfo* licenseInfo);
+
+/**
+ * \brief Calculates the hardware identifier associated with a specific pc.
+ * \details
+ * The caller, when it doesn't find a valid license (see `acquire_license` below) should show to the user the calculated identifier.
+ * The user should report the pc_identifier to the software editor that will in turn use it to issue a license.
+ *
+ * pc_id_method = ::STRATEGY_DEFAULT is usually the best choice.
+ *
+ * First call this method with `identifier_out` = nullptr and `buf_size` = 0 , it will return the requested buffer size
+ * in `buf_size` parameter.
+ *
+ * Then allocate the necessary memory, and call the method again.
+ *
+ * @return true if successful, false if failure (because it is not possible to identify or buffer too small).
+ * @param hw_id_method[in] specifies a preferred identification method. Usually #STRATEGY_DEFAULT works well. See the
+ * wiki for more informations.
+ * @param identifier_out[out] buffer where the identification string will be placed.
+ * @param buf_size[in-out] size of the buffer where the identification string will be placed.
+ * @param execution_environment_info[out] if not null will contain the informations about the execution environment.
+ */
+bool identify_pc(LCC_API_HW_IDENTIFICATION_STRATEGY hw_id_method, char* identifier_out, size_t* buf_size,
+				 ExecutionEnvironmentInfo* execution_environment_info);
+
+/**
+ * This method is used to request the use of one license for a product.
+ * In case of local license it's used to check if the product is licensed.
+ *
+ * @return LCC_EVENT_TYPE::LICENSE_OK(0) if successful. Other values if there are errors.
+ *
+ * @param callerInformation[in] optional, can be NULL.
+ * 			contains informations on the software that is requesting the license verification. Let the software
+ * 			specify its version or request verification for features that need to be enabled separately.  
+ * @param licenseLocation[in] optional, can be NULL.
+ * 					licenseLocation, either the name of the file
+ * 								or the name of the environment variable should be !='\0'
+ * @param license_out[out] optional, can be NULL, if set it will return extra informations about the license.
+ */
+
+LCC_EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation,
+						   LicenseInfo* license_out);
+
+/**
+ * Not implemented yet, useful (later) for network licenses.
+ * Should be called from time to time to confirm we're still using the
+ * license.
+ */
+LCC_EVENT_TYPE confirm_license(char* featureName, LicenseLocation* licenseLocation);
+/**
+ * Not implemented yet, useful (later) for network licenses.
+ */
+LCC_EVENT_TYPE release_license(char* featureName, LicenseLocation licenseLocation);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+/**
+ * @}
+ */

+ 19 - 0
Licensecc/licensecc/GJDM/cmake/licensecc-debug.cmake

@@ -0,0 +1,19 @@
+#----------------------------------------------------------------
+# Generated CMake target import file for configuration "Debug".
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Import target "licensecc::licensecc_static" for configuration "Debug"
+set_property(TARGET licensecc::licensecc_static APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
+set_target_properties(licensecc::licensecc_static PROPERTIES
+  IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "CXX"
+  IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/licensecc/GJDM/licensecc_static.lib"
+  )
+
+list(APPEND _cmake_import_check_targets licensecc::licensecc_static )
+list(APPEND _cmake_import_check_files_for_licensecc::licensecc_static "${_IMPORT_PREFIX}/licensecc/GJDM/licensecc_static.lib" )
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)

+ 109 - 0
Licensecc/licensecc/GJDM/cmake/licensecc.cmake

@@ -0,0 +1,109 @@
+# Generated by CMakelicensecc_staticlicensecc_static
+
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
+   message(FATAL_ERROR "CMake >= 2.8.0 required")
+endif()
+if(CMAKE_VERSION VERSION_LESS "2.8.3")
+   message(FATAL_ERROR "CMake >= 2.8.3 required")
+endif()
+cmake_policy(PUSH)
+cmake_policy(VERSION 2.8.3...3.25)
+#----------------------------------------------------------------
+# Generated CMake target import file.
+#----------------------------------------------------------------
+
+# Commands may need to know the format version.
+set(CMAKE_IMPORT_FILE_VERSION 1)
+
+# Protect against multiple inclusion, which would fail when already imported targets are added once more.
+set(_cmake_targets_defined "")
+set(_cmake_targets_not_defined "")
+set(_cmake_expected_targets "")
+foreach(_cmake_expected_target IN ITEMS licensecc::licensecc_static)
+  list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
+  if(TARGET "${_cmake_expected_target}")
+    list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
+  else()
+    list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
+  endif()
+endforeach()
+unset(_cmake_expected_target)
+if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
+  unset(_cmake_targets_defined)
+  unset(_cmake_targets_not_defined)
+  unset(_cmake_expected_targets)
+  unset(CMAKE_IMPORT_FILE_VERSION)
+  cmake_policy(POP)
+  return()
+endif()
+if(NOT _cmake_targets_defined STREQUAL "")
+  string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
+  string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
+  message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
+endif()
+unset(_cmake_targets_defined)
+unset(_cmake_targets_not_defined)
+unset(_cmake_expected_targets)
+
+
+# Compute the installation prefix relative to this file.
+get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
+# _IMPORT_PREFIX = exitlib/Licensecc
+if(_IMPORT_PREFIX STREQUAL "/")
+  set(_IMPORT_PREFIX "")
+endif()
+
+# Create imported target licensecc::licensecc_static
+add_library(licensecc::licensecc_static STATIC IMPORTED)
+
+set_target_properties(licensecc::licensecc_static PROPERTIES
+  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/licensecc/GJDM"
+  INTERFACE_LINK_LIBRARIES "bcrypt;crypt32;ws2_32;iphlpapi"
+)
+
+if(CMAKE_VERSION VERSION_LESS 2.8.12)
+  message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
+endif()
+
+# Load information for each installed configuration.
+file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/licensecc-*.cmake")
+foreach(_cmake_config_file IN LISTS _cmake_config_files)
+  include("${_cmake_config_file}")
+endforeach()
+unset(_cmake_config_file)
+unset(_cmake_config_files)
+
+# Cleanup temporary variables.
+set(_IMPORT_PREFIX)
+
+# Loop over all imported files and verify that they actually exist
+foreach(_cmake_target IN LISTS _cmake_import_check_targets)
+  foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
+    if(NOT EXISTS "${_cmake_file}")
+      message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
+   \"${_cmake_file}\"
+but this file does not exist.  Possible reasons include:
+* The file was deleted, renamed, or moved to another location.
+* An install or uninstall procedure did not complete successfully.
+* The installation package was faulty and contained
+   \"${CMAKE_CURRENT_LIST_FILE}\"
+but not all the files it references.
+")
+    endif()
+  endforeach()
+  unset(_cmake_file)
+  unset("_cmake_import_check_files_for_${_cmake_target}")
+endforeach()
+unset(_cmake_target)
+unset(_cmake_import_check_targets)
+
+# This file does not depend on other imported targets which have
+# been exported from the same project but in a separate export set.
+
+# Commands beyond this point should not need to know the version.
+set(CMAKE_IMPORT_FILE_VERSION)
+cmake_policy(POP)

BIN
Licensecc/licensecc/GJDM/licensecc_static.lib


BIN
Python/Lib/__pycache__/_weakrefset.cpython-312.pyc


BIN
Python/Lib/__pycache__/contextlib.cpython-312.pyc


BIN
Python/Lib/__pycache__/copyreg.cpython-312.pyc


BIN
Python/Lib/__pycache__/enum.cpython-312.pyc


BIN
Python/Lib/__pycache__/functools.cpython-312.pyc


BIN
Python/Lib/__pycache__/keyword.cpython-312.pyc


BIN
Python/Lib/__pycache__/operator.cpython-312.pyc


BIN
Python/Lib/__pycache__/pkgutil.cpython-312.pyc


BIN
Python/Lib/__pycache__/reprlib.cpython-312.pyc


BIN
Python/Lib/__pycache__/types.cpython-312.pyc


BIN
Python/Lib/__pycache__/typing.cpython-312.pyc


BIN
Python/Lib/__pycache__/warnings.cpython-312.pyc


BIN
Python/Lib/__pycache__/weakref.cpython-312.pyc


BIN
Python/Lib/collections/__pycache__/__init__.cpython-312.pyc


BIN
Python/Lib/collections/__pycache__/abc.cpython-312.pyc


BIN
Python/Lib/encodings/__pycache__/__init__.cpython-312.pyc


BIN
Python/Lib/encodings/__pycache__/aliases.cpython-312.pyc


BIN
Python/Lib/encodings/__pycache__/gbk.cpython-312.pyc


BIN
Python/Lib/encodings/__pycache__/utf_8.cpython-312.pyc


BIN
Python/Lib/importlib/__pycache__/__init__.cpython-312.pyc


BIN
Python/Lib/importlib/__pycache__/_abc.cpython-312.pyc


BIN
Python/Lib/json/__pycache__/__init__.cpython-312.pyc


BIN
Python/Lib/json/__pycache__/decoder.cpython-312.pyc


BIN
Python/Lib/json/__pycache__/encoder.cpython-312.pyc


BIN
Python/Lib/json/__pycache__/scanner.cpython-312.pyc


BIN
Python/Lib/re/__pycache__/__init__.cpython-312.pyc


BIN
Python/Lib/re/__pycache__/_casefix.cpython-312.pyc


BIN
Python/Lib/re/__pycache__/_compiler.cpython-312.pyc


BIN
Python/Lib/re/__pycache__/_constants.cpython-312.pyc


BIN
Python/Lib/re/__pycache__/_parser.cpython-312.pyc