#include <algorithm>
#include <iostream>
#include <sstream>

int main()
{
    unsigned char buf[1024] = {'\0'};
    std::string shell_str("\x55\x48\x89\x00\x00\x00\x00\xC3\x90");
    std::copy( shell_str.begin(), shell_str.end(), buf );
    buf[shell_str.length()] = '\0';
    
      std::stringstream ss;
       for(unsigned char bin_data : shell_str)
        ss << std::uppercase << std::hex << static_cast<int>(bin_data) << " ";
        
   std::cout << "shell : " << shell_str << std::endl;     
   std::cout << "hex-string : " << ss.str() << std::endl;
   std::cout << "shell length : " << shell_str.length() << std::endl;  
   return 0;      
}