From fea48d76f9cf1296a19e7b0b863f163265fad9ac Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 24 Jun 2020 18:18:29 +0000 Subject: __ntapi_tt_guid_to_string_utf8(): initial implementation and integration. --- src/guid/ntapi_tt_guid.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) (limited to 'src/guid/ntapi_tt_guid.c') diff --git a/src/guid/ntapi_tt_guid.c b/src/guid/ntapi_tt_guid.c index 00628c3..6e8c7c4 100644 --- a/src/guid/ntapi_tt_guid.c +++ b/src/guid/ntapi_tt_guid.c @@ -214,3 +214,57 @@ int32_t __fastcall __ntapi_tt_string_to_guid_utf8( : __ntapi_tt_string_to_guid_utf16( &guid_str_utf16,guid); } + +void __fastcall __ntapi_tt_guid_to_string_utf8( + __in const nt_guid * guid, + __out nt_guid_str_utf8 * guid_str) +{ + uint16_t key; + uint8_t * ch; + + ch = &(guid_str->group5[0]); + + __ntapi_tt_uint32_to_hex_utf8( + guid->data1, + &guid_str->group1[0]); + + __ntapi_tt_uint16_to_hex_utf8( + guid->data2, + &guid_str->group2[0]); + + __ntapi_tt_uint16_to_hex_utf8( + guid->data3, + &guid_str->group3[0]); + + key = guid->data4[0] * 0x100 + guid->data4[1]; + + __ntapi_tt_uint16_to_hex_utf8( + key, + &guid_str->group4[0]); + + key = guid->data4[2] * 0x100 + guid->data4[3]; + + __ntapi_tt_uint16_to_hex_utf8( + key, + &guid_str->group5[0]); + + key = guid->data4[4] * 0x100 + guid->data4[5]; + + __ntapi_tt_uint16_to_hex_utf8( + key, + &(ch[4])); + + key = guid->data4[6] * 0x100 + guid->data4[7]; + + __ntapi_tt_uint16_to_hex_utf8( + key, + &(ch[8])); + + guid_str->lbrace = '{'; + guid_str->rbrace = '}'; + guid_str->dash1 = '-'; + guid_str->dash2 = '-'; + guid_str->dash3 = '-'; + guid_str->dash4 = '-'; + guid_str->null = 0; +} -- cgit v1.2.3