[][src]Function elf_utilities::section::build_byte_string_table

pub fn build_byte_string_table(
    strings: Vec<Vec<u8>>,
    alignment: bool
) -> Vec<u8>

STRTABセクション等で使われる文字列テーブル形式を生成します. 具体的には,null-byte (name + null-byte)* という形式を生成します. alignmentがtrueの場合,4バイトアラインメントも行います.

Examples

use elf_utilities::section;
let table = section::build_byte_string_table(vec![".text".as_bytes().to_vec(), ".symtab".as_bytes().to_vec()], false);

assert_eq!(vec![0x00, 0x2e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x2e, 0x73, 0x79, 0x6d, 0x74, 0x61, 0x62, 0x00], table);