Milestone 5: deliver embedded RDP sessions and lifecycle hardening
This commit is contained in:
16
third_party/FreeRDP/cmake/ConvertFileToHexArray.cmake
vendored
Normal file
16
third_party/FreeRDP/cmake/ConvertFileToHexArray.cmake
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
function(file_to_hex_array FILE DATA)
|
||||
# Read the ASCII file as hex.
|
||||
file(READ "${FILE}" HEX_CONTENTS HEX)
|
||||
|
||||
# Separate into individual bytes.
|
||||
string(REGEX MATCHALL "([A-Za-z0-9][A-Za-z0-9])" SEPARATED_HEX "${HEX_CONTENTS}")
|
||||
|
||||
# Append the "0x" to each byte.
|
||||
list(JOIN SEPARATED_HEX ", 0x" FORMATTED_HEX)
|
||||
|
||||
# JOIN misses the first byte's "0x", so add it here.
|
||||
string(PREPEND FORMATTED_HEX "0x")
|
||||
|
||||
# Set the variable named by DATA argument to the formatted hex string.
|
||||
set(${DATA} ${FORMATTED_HEX} PARENT_SCOPE)
|
||||
endfunction()
|
||||
Reference in New Issue
Block a user